Macie2 / Client / get_finding_statistics

get_finding_statistics#

Macie2.Client.get_finding_statistics(**kwargs)#

Retrieves (queries) aggregated statistical data about findings.

See also: AWS API Documentation

Request Syntax

response = client.get_finding_statistics(
    findingCriteria={
        'criterion': {
            'string': {
                'eq': [
                    'string',
                ],
                'eqExactMatch': [
                    'string',
                ],
                'gt': 123,
                'gte': 123,
                'lt': 123,
                'lte': 123,
                'neq': [
                    'string',
                ]
            }
        }
    },
    groupBy='resourcesAffected.s3Bucket.name'|'type'|'classificationDetails.jobId'|'severity.description',
    size=123,
    sortCriteria={
        'attributeName': 'groupKey'|'count',
        'orderBy': 'ASC'|'DESC'
    }
)
Parameters:
  • findingCriteria (dict) –

    The criteria to use to filter the query results.

    • criterion (dict) –

      A condition that specifies the property, operator, and one or more values to use to filter the results.

      • (string) –

        • (dict) –

          Specifies the operator to use in a property-based condition that filters the results of a query for findings. For detailed information and examples of each operator, see Fundamentals of filtering findings in the Amazon Macie User Guide.

          • eq (list) –

            The value for the property matches (equals) the specified value. If you specify multiple values, Macie uses OR logic to join the values.

            • (string) –

          • eqExactMatch (list) –

            The value for the property exclusively matches (equals an exact match for) all the specified values. If you specify multiple values, Amazon Macie uses AND logic to join the values.

            You can use this operator with the following properties: customDataIdentifiers.detections.arn, customDataIdentifiers.detections.name, resourcesAffected.s3Bucket.tags.key, resourcesAffected.s3Bucket.tags.value, resourcesAffected.s3Object.tags.key, resourcesAffected.s3Object.tags.value, sensitiveData.category, and sensitiveData.detections.type.

            • (string) –

          • gt (integer) –

            The value for the property is greater than the specified value.

          • gte (integer) –

            The value for the property is greater than or equal to the specified value.

          • lt (integer) –

            The value for the property is less than the specified value.

          • lte (integer) –

            The value for the property is less than or equal to the specified value.

          • neq (list) –

            The value for the property doesn’t match (doesn’t equal) the specified value. If you specify multiple values, Macie uses OR logic to join the values.

            • (string) –

  • groupBy (string) –

    [REQUIRED]

    The finding property to use to group the query results. Valid values are:

    • classificationDetails.jobId - The unique identifier for the classification job that produced the finding.

    • resourcesAffected.s3Bucket.name - The name of the S3 bucket that the finding applies to.

    • severity.description - The severity level of the finding, such as High or Medium.

    • type - The type of finding, such as Policy:IAMUser/S3BucketPublic and SensitiveData:S3Object/Personal.

  • size (integer) – The maximum number of items to include in each page of the response.

  • sortCriteria (dict) –

    The criteria to use to sort the query results.

    • attributeName (string) –

      The grouping to sort the results by. Valid values are: count, sort the results by the number of findings in each group of results; and, groupKey, sort the results by the name of each group of results.

    • orderBy (string) –

      The sort order to apply to the results, based on the value for the property specified by the attributeName property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.

Return type:

dict

Returns:

Response Syntax

{
    'countsByGroup': [
        {
            'count': 123,
            'groupKey': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    The request succeeded.

    • countsByGroup (list) –

      An array of objects, one for each group of findings that matches the filter criteria specified in the request.

      • (dict) –

        Provides a group of results for a query that retrieved aggregated statistical data about findings.

        • count (integer) –

          The total number of findings in the group of query results.

        • groupKey (string) –

          The name of the property that defines the group in the query results, as specified by the groupBy property in the query request.

Exceptions