Technical Tip: Retrieving Cloud Compliance Summary (CIS AWS 1.4) via API
| Description | This article describes how to retrieve Cloud Compliance summary metrics for CIS AWS 1.4 via API, ensuring alignment with the summary shown in the UI and PDF report header. |
| Scope | FortiCNAPP (Lacework), users generating CIS AWS 1.4 compliance reports and requiring accurate summary metrics via API. |
| Solution | Prerequisites:
The /api/v2/Reports endpoint may return summary metrics that include duplicate non-compliant resources (for example, the same resource counted once per violating policy), resulting in discrepancies with the UI/PDF report header, which counts distinct resources. The /api/v2/ReportConfigurations/{reportConfigGuid}/generate endpoint, when used with format=json, returns summary counters that match the UI/PDF report header by counting distinct resources. The reportConfigGuid is the unique identifier of the report configuration created in the Lacework UI. To obtain accurate summary metrics:
curl -X POST 'https://<youraccount>.lacework.net/api/v2/ReportConfigurations/<reportConfigGuid>/generate?format=json' \ -H 'Authorization: Bearer <your_api_token>'
Example of a simplified JSON response (truncated for clarity):
This is the recommended and supported method for retrieving PDF-equivalent summary metrics programmatically. While this article focuses on CIS AWS 1.4, the same approach (using ReportConfigurations/{reportConfigGuid}/generate?format=json) applies to other cloud compliance reports where alignment with the UI/PDF summary is required. |
