CodeGuruSecurity / Client / get_metrics_summary

get_metrics_summary#

CodeGuruSecurity.Client.get_metrics_summary(**kwargs)#

Returns a summary of metrics for an account from a specified date, including number of open findings, the categories with most findings, the scans with most open findings, and scans with most open critical findings.

See also: AWS API Documentation

Request Syntax

response = client.get_metrics_summary(
    date=datetime(2015, 1, 1)
)
Parameters:

date (datetime) –

[REQUIRED]

The date you want to retrieve summary metrics from, rounded to the nearest day. The date must be within the past two years.

Return type:

dict

Returns:

Response Syntax

{
    'metricsSummary': {
        'categoriesWithMostFindings': [
            {
                'categoryName': 'string',
                'findingNumber': 123
            },
        ],
        'date': datetime(2015, 1, 1),
        'openFindings': {
            'critical': 123.0,
            'high': 123.0,
            'info': 123.0,
            'low': 123.0,
            'medium': 123.0
        },
        'scansWithMostOpenCriticalFindings': [
            {
                'findingNumber': 123,
                'scanName': 'string'
            },
        ],
        'scansWithMostOpenFindings': [
            {
                'findingNumber': 123,
                'scanName': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) –

    • metricsSummary (dict) –

      The summary metrics from the specified date.

      • categoriesWithMostFindings (list) –

        A list of CategoryWithFindingNum objects for the top 5 finding categories with the most findings.

        • (dict) –

          Information about a finding category with open findings.

          • categoryName (string) –

            The name of the finding category. A finding category is determined by the detector that detected the finding.

          • findingNumber (integer) –

            The number of open findings in the category.

      • date (datetime) –

        The date from which the metrics summary information was retrieved.

      • openFindings (dict) –

        The number of open findings of each severity.

        • critical (float) –

          A numeric value corresponding to a critical finding.

        • high (float) –

          A numeric value corresponding to a high severity finding.

        • info (float) –

          A numeric value corresponding to an informational finding.

        • low (float) –

          A numeric value corresponding to a low severity finding.

        • medium (float) –

          A numeric value corresponding to a medium severity finding.

      • scansWithMostOpenCriticalFindings (list) –

        A list of ScanNameWithFindingNum objects for the top 3 scans with the most number of open critical findings.

        • (dict) –

          Information about the number of findings generated by a scan.

          • findingNumber (integer) –

            The number of findings generated by a scan.

          • scanName (string) –

            The name of the scan.

      • scansWithMostOpenFindings (list) –

        A list of ScanNameWithFindingNum objects for the top 3 scans with the most number of open findings.

        • (dict) –

          Information about the number of findings generated by a scan.

          • findingNumber (integer) –

            The number of findings generated by a scan.

          • scanName (string) –

            The name of the scan.

Exceptions

  • CodeGuruSecurity.Client.exceptions.InternalServerException

  • CodeGuruSecurity.Client.exceptions.ThrottlingException

  • CodeGuruSecurity.Client.exceptions.ValidationException

  • CodeGuruSecurity.Client.exceptions.AccessDeniedException