Inspector2

2025/07/31 - Inspector2 - 2 updated api methods

Changes  Extend usage to include agentless hours and add CODE_REPOSITORY to aggregation resource type

ListFindingAggregations (updated) Link ¶
Changes (request)
{'aggregationRequest': {'accountAggregation': {'resourceType': {'CODE_REPOSITORY'}},
                        'findingTypeAggregation': {'resourceType': {'CODE_REPOSITORY'}},
                        'titleAggregation': {'resourceType': {'CODE_REPOSITORY'}}}}

Lists aggregated finding data for your environment based on specific criteria.

See also: AWS API Documentation

Request Syntax

client.list_finding_aggregations(
    aggregationType='FINDING_TYPE'|'PACKAGE'|'TITLE'|'REPOSITORY'|'AMI'|'AWS_EC2_INSTANCE'|'AWS_ECR_CONTAINER'|'IMAGE_LAYER'|'ACCOUNT'|'AWS_LAMBDA_FUNCTION'|'LAMBDA_LAYER'|'CODE_REPOSITORY',
    nextToken='string',
    maxResults=123,
    accountIds=[
        {
            'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
            'value': 'string'
        },
    ],
    aggregationRequest={
        'accountAggregation': {
            'findingType': 'NETWORK_REACHABILITY'|'PACKAGE_VULNERABILITY'|'CODE_VULNERABILITY',
            'resourceType': 'AWS_EC2_INSTANCE'|'AWS_ECR_CONTAINER_IMAGE'|'AWS_LAMBDA_FUNCTION'|'CODE_REPOSITORY',
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL'
        },
        'amiAggregation': {
            'amis': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL'|'AFFECTED_INSTANCES'
        },
        'awsEcrContainerAggregation': {
            'resourceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'imageShas': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'repositories': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'architectures': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'imageTags': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'lastInUseAt': [
                {
                    'startInclusive': datetime(2015, 1, 1),
                    'endInclusive': datetime(2015, 1, 1)
                },
            ],
            'inUseCount': [
                {
                    'upperInclusive': 123.0,
                    'lowerInclusive': 123.0
                },
            ]
        },
        'ec2InstanceAggregation': {
            'amis': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'operatingSystems': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'instanceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'instanceTags': [
                {
                    'comparison': 'EQUALS',
                    'key': 'string',
                    'value': 'string'
                },
            ],
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'NETWORK_FINDINGS'|'CRITICAL'|'HIGH'|'ALL'
        },
        'findingTypeAggregation': {
            'findingType': 'NETWORK_REACHABILITY'|'PACKAGE_VULNERABILITY'|'CODE_VULNERABILITY',
            'resourceType': 'AWS_EC2_INSTANCE'|'AWS_ECR_CONTAINER_IMAGE'|'AWS_LAMBDA_FUNCTION'|'CODE_REPOSITORY',
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL'
        },
        'imageLayerAggregation': {
            'repositories': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'resourceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'layerHashes': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL'
        },
        'packageAggregation': {
            'packageNames': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL'
        },
        'repositoryAggregation': {
            'repositories': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL'|'AFFECTED_IMAGES'
        },
        'titleAggregation': {
            'titles': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'vulnerabilityIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'resourceType': 'AWS_EC2_INSTANCE'|'AWS_ECR_CONTAINER_IMAGE'|'AWS_LAMBDA_FUNCTION'|'CODE_REPOSITORY',
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'findingType': 'NETWORK_REACHABILITY'|'PACKAGE_VULNERABILITY'|'CODE_VULNERABILITY'
        },
        'lambdaLayerAggregation': {
            'functionNames': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'resourceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'layerArns': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL'
        },
        'lambdaFunctionAggregation': {
            'resourceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'functionNames': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'runtimes': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'functionTags': [
                {
                    'comparison': 'EQUALS',
                    'key': 'string',
                    'value': 'string'
                },
            ],
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL'
        },
        'codeRepositoryAggregation': {
            'projectNames': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'providerTypes': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortOrder': 'ASC'|'DESC',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'resourceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ]
        }
    }
)
type aggregationType:

string

param aggregationType:

[REQUIRED]

The type of the aggregation request.

type nextToken:

string

param nextToken:

A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request to a list action. If your response returns more than the maxResults maximum value it will also return a nextToken value. For subsequent calls, use the nextToken value returned from the previous request to continue listing results after the first page.

type maxResults:

integer

param maxResults:

The maximum number of results the response can return. If your request would return more than the maximum the response will return a nextToken value, use this value when you call the action again to get the remaining results.

type accountIds:

list

param accountIds:

The Amazon Web Services account IDs to retrieve finding aggregation data for.

  • (dict) --

    An object that describes the details of a string filter.

    • comparison (string) -- [REQUIRED]

      The operator to use when comparing values in the filter.

    • value (string) -- [REQUIRED]

      The value to filter on.

type aggregationRequest:

dict

param aggregationRequest:

Details of the aggregation request that is used to filter your aggregation results.

  • accountAggregation (dict) --

    An object that contains details about an aggregation request based on Amazon Web Services account IDs.

    • findingType (string) --

      The type of finding.

    • resourceType (string) --

      The type of resource.

    • sortOrder (string) --

      The sort order (ascending or descending).

    • sortBy (string) --

      The value to sort by.

  • amiAggregation (dict) --

    An object that contains details about an aggregation request based on Amazon Machine Images (AMIs).

    • amis (list) --

      The IDs of AMIs to aggregate findings for.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • sortOrder (string) --

      The order to sort results by.

    • sortBy (string) --

      The value to sort results by.

  • awsEcrContainerAggregation (dict) --

    An object that contains details about an aggregation request based on Amazon ECR container images.

    • resourceIds (list) --

      The container resource IDs.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • imageShas (list) --

      The image SHA values.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • repositories (list) --

      The container repositories.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • architectures (list) --

      The architecture of the containers.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • imageTags (list) --

      The image tags.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • sortOrder (string) --

      The sort order (ascending or descending).

    • sortBy (string) --

      The value to sort by.

    • lastInUseAt (list) --

      The last time an Amazon ECR image was used in an Amazon ECS task or Amazon EKS pod.

      • (dict) --

        Contains details on the time range used to filter findings.

        • startInclusive (datetime) --

          A timestamp representing the start of the time period filtered on.

        • endInclusive (datetime) --

          A timestamp representing the end of the time period filtered on.

    • inUseCount (list) --

      The number of Amazon ECS tasks or Amazon EKS pods where the Amazon ECR container image is in use.

      • (dict) --

        An object that describes the details of a number filter.

        • upperInclusive (float) --

          The highest number to be included in the filter.

        • lowerInclusive (float) --

          The lowest number to be included in the filter.

  • ec2InstanceAggregation (dict) --

    An object that contains details about an aggregation request based on Amazon EC2 instances.

    • amis (list) --

      The AMI IDs associated with the Amazon EC2 instances to aggregate findings for.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • operatingSystems (list) --

      The operating system types to aggregate findings for. Valid values must be uppercase and underscore separated, examples are ORACLE_LINUX_7 and ALPINE_LINUX_3_8.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • instanceIds (list) --

      The Amazon EC2 instance IDs to aggregate findings for.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • instanceTags (list) --

      The Amazon EC2 instance tags to aggregate findings for.

      • (dict) --

        An object that describes details of a map filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • key (string) -- [REQUIRED]

          The tag key used in the filter.

        • value (string) --

          The tag value used in the filter.

    • sortOrder (string) --

      The order to sort results by.

    • sortBy (string) --

      The value to sort results by.

  • findingTypeAggregation (dict) --

    An object that contains details about an aggregation request based on finding types.

    • findingType (string) --

      The finding type to aggregate.

    • resourceType (string) --

      The resource type to aggregate.

    • sortOrder (string) --

      The order to sort results by.

    • sortBy (string) --

      The value to sort results by.

  • imageLayerAggregation (dict) --

    An object that contains details about an aggregation request based on container image layers.

    • repositories (list) --

      The repository associated with the container image hosting the layers.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • resourceIds (list) --

      The ID of the container image layer.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • layerHashes (list) --

      The hashes associated with the layers.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • sortOrder (string) --

      The order to sort results by.

    • sortBy (string) --

      The value to sort results by.

  • packageAggregation (dict) --

    An object that contains details about an aggregation request based on operating system package type.

    • packageNames (list) --

      The names of packages to aggregate findings on.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • sortOrder (string) --

      The order to sort results by.

    • sortBy (string) --

      The value to sort results by.

  • repositoryAggregation (dict) --

    An object that contains details about an aggregation request based on Amazon ECR repositories.

    • repositories (list) --

      The names of repositories to aggregate findings on.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • sortOrder (string) --

      The order to sort results by.

    • sortBy (string) --

      The value to sort results by.

  • titleAggregation (dict) --

    An object that contains details about an aggregation request based on finding title.

    • titles (list) --

      The finding titles to aggregate on.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • vulnerabilityIds (list) --

      The vulnerability IDs of the findings.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • resourceType (string) --

      The resource type to aggregate on.

    • sortOrder (string) --

      The order to sort results by.

    • sortBy (string) --

      The value to sort results by.

    • findingType (string) --

      The type of finding to aggregate on.

  • lambdaLayerAggregation (dict) --

    Returns an object with findings aggregated by Amazon Web Services Lambda layer.

    • functionNames (list) --

      The names of the Amazon Web Services Lambda functions associated with the layers.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • resourceIds (list) --

      The resource IDs for the Amazon Web Services Lambda function layers.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • layerArns (list) --

      The Amazon Resource Name (ARN) of the Amazon Web Services Lambda function layer.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • sortOrder (string) --

      The order to use for sorting the results.

    • sortBy (string) --

      The finding severity to use for sorting the results.

  • lambdaFunctionAggregation (dict) --

    Returns an object with findings aggregated by Amazon Web Services Lambda function.

    • resourceIds (list) --

      The resource IDs to include in the aggregation results.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • functionNames (list) --

      The Amazon Web Services Lambda function names to include in the aggregation results.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • runtimes (list) --

      Returns findings aggregated by Amazon Web Services Lambda function runtime environments.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • functionTags (list) --

      The tags to include in the aggregation results.

      • (dict) --

        An object that describes details of a map filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • key (string) -- [REQUIRED]

          The tag key used in the filter.

        • value (string) --

          The tag value used in the filter.

    • sortOrder (string) --

      The order to use for sorting the results.

    • sortBy (string) --

      The finding severity to use for sorting the results.

  • codeRepositoryAggregation (dict) --

    An object that contains details about an aggregation request based on code repositories.

    • projectNames (list) --

      The project names to include in the aggregation results.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • providerTypes (list) --

      The repository provider types to include in the aggregation results.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

    • sortOrder (string) --

      The order to sort results by (ascending or descending) in the code repository aggregation.

    • sortBy (string) --

      The value to sort results by in the code repository aggregation.

    • resourceIds (list) --

      The resource IDs to include in the aggregation results.

      • (dict) --

        An object that describes the details of a string filter.

        • comparison (string) -- [REQUIRED]

          The operator to use when comparing values in the filter.

        • value (string) -- [REQUIRED]

          The value to filter on.

rtype:

dict

returns:

Response Syntax

{
    'aggregationType': 'FINDING_TYPE'|'PACKAGE'|'TITLE'|'REPOSITORY'|'AMI'|'AWS_EC2_INSTANCE'|'AWS_ECR_CONTAINER'|'IMAGE_LAYER'|'ACCOUNT'|'AWS_LAMBDA_FUNCTION'|'LAMBDA_LAYER'|'CODE_REPOSITORY',
    'responses': [
        {
            'accountAggregation': {
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                },
                'exploitAvailableCount': 123,
                'fixAvailableCount': 123
            },
            'amiAggregation': {
                'ami': 'string',
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                },
                'affectedInstances': 123
            },
            'awsEcrContainerAggregation': {
                'resourceId': 'string',
                'imageSha': 'string',
                'repository': 'string',
                'architecture': 'string',
                'imageTags': [
                    'string',
                ],
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                },
                'lastInUseAt': datetime(2015, 1, 1),
                'inUseCount': 123
            },
            'ec2InstanceAggregation': {
                'instanceId': 'string',
                'ami': 'string',
                'operatingSystem': 'string',
                'instanceTags': {
                    'string': 'string'
                },
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                },
                'networkFindings': 123
            },
            'findingTypeAggregation': {
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                },
                'exploitAvailableCount': 123,
                'fixAvailableCount': 123
            },
            'imageLayerAggregation': {
                'repository': 'string',
                'resourceId': 'string',
                'layerHash': 'string',
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                }
            },
            'packageAggregation': {
                'packageName': 'string',
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                }
            },
            'repositoryAggregation': {
                'repository': 'string',
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                },
                'affectedImages': 123
            },
            'titleAggregation': {
                'title': 'string',
                'vulnerabilityId': 'string',
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                }
            },
            'lambdaLayerAggregation': {
                'functionName': 'string',
                'resourceId': 'string',
                'layerArn': 'string',
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                }
            },
            'lambdaFunctionAggregation': {
                'resourceId': 'string',
                'functionName': 'string',
                'runtime': 'string',
                'lambdaTags': {
                    'string': 'string'
                },
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                },
                'lastModifiedAt': datetime(2015, 1, 1)
            },
            'codeRepositoryAggregation': {
                'projectNames': 'string',
                'providerType': 'string',
                'severityCounts': {
                    'all': 123,
                    'medium': 123,
                    'high': 123,
                    'critical': 123
                },
                'exploitAvailableActiveFindingsCount': 123,
                'fixAvailableActiveFindingsCount': 123,
                'accountId': 'string',
                'resourceId': 'string'
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • aggregationType (string) --

      The type of aggregation to perform.

    • responses (list) --

      Objects that contain the results of an aggregation operation.

      • (dict) --

        A structure that contains details about the results of an aggregation type.

        • accountAggregation (dict) --

          An object that contains details about an aggregation response based on Amazon Web Services account IDs.

          • accountId (string) --

            The Amazon Web Services account ID.

          • severityCounts (dict) --

            The number of findings by severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

          • exploitAvailableCount (integer) --

            The number of findings that have an exploit available.

          • fixAvailableCount (integer) --

            Details about the number of fixes.

        • amiAggregation (dict) --

          An object that contains details about an aggregation response based on Amazon Machine Images (AMIs).

          • ami (string) --

            The ID of the AMI that findings were aggregated for.

          • accountId (string) --

            The Amazon Web Services account ID for the AMI.

          • severityCounts (dict) --

            An object that contains the count of matched findings per severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

          • affectedInstances (integer) --

            The IDs of Amazon EC2 instances using this AMI.

        • awsEcrContainerAggregation (dict) --

          An object that contains details about an aggregation response based on Amazon ECR container images.

          • resourceId (string) --

            The resource ID of the container.

          • imageSha (string) --

            The SHA value of the container image.

          • repository (string) --

            The container repository.

          • architecture (string) --

            The architecture of the container.

          • imageTags (list) --

            The container image stags.

            • (string) --

          • accountId (string) --

            The Amazon Web Services account ID of the account that owns the container.

          • severityCounts (dict) --

            The number of finding by severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

          • lastInUseAt (datetime) --

            The last time an Amazon ECR image was used in an Amazon ECS task or Amazon EKS pod.

          • inUseCount (integer) --

            The number of Amazon ECS tasks or Amazon EKS pods where the Amazon ECR container image is in use.

        • ec2InstanceAggregation (dict) --

          An object that contains details about an aggregation response based on Amazon EC2 instances.

          • instanceId (string) --

            The Amazon EC2 instance ID.

          • ami (string) --

            The Amazon Machine Image (AMI) of the Amazon EC2 instance.

          • operatingSystem (string) --

            The operating system of the Amazon EC2 instance.

          • instanceTags (dict) --

            The tags attached to the instance.

            • (string) --

              • (string) --

          • accountId (string) --

            The Amazon Web Services account for the Amazon EC2 instance.

          • severityCounts (dict) --

            An object that contains the count of matched findings per severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

          • networkFindings (integer) --

            The number of network findings for the Amazon EC2 instance.

        • findingTypeAggregation (dict) --

          An object that contains details about an aggregation response based on finding types.

          • accountId (string) --

            The ID of the Amazon Web Services account associated with the findings.

          • severityCounts (dict) --

            The value to sort results by.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

          • exploitAvailableCount (integer) --

            The number of findings that have an exploit available.

          • fixAvailableCount (integer) --

            Details about the number of fixes.

        • imageLayerAggregation (dict) --

          An object that contains details about an aggregation response based on container image layers.

          • repository (string) --

            The repository the layer resides in.

          • resourceId (string) --

            The resource ID of the container image layer.

          • layerHash (string) --

            The layer hash.

          • accountId (string) --

            The ID of the Amazon Web Services account that owns the container image hosting the layer image.

          • severityCounts (dict) --

            An object that represents the count of matched findings per severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

        • packageAggregation (dict) --

          An object that contains details about an aggregation response based on operating system package type.

          • packageName (string) --

            The name of the operating system package.

          • accountId (string) --

            The ID of the Amazon Web Services account associated with the findings.

          • severityCounts (dict) --

            An object that contains the count of matched findings per severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

        • repositoryAggregation (dict) --

          An object that contains details about an aggregation response based on Amazon ECR repositories.

          • repository (string) --

            The name of the repository associated with the findings.

          • accountId (string) --

            The ID of the Amazon Web Services account associated with the findings.

          • severityCounts (dict) --

            An object that represent the count of matched findings per severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

          • affectedImages (integer) --

            The number of container images impacted by the findings.

        • titleAggregation (dict) --

          An object that contains details about an aggregation response based on finding title.

          • title (string) --

            The title that the findings were aggregated on.

          • vulnerabilityId (string) --

            The vulnerability ID of the finding.

          • accountId (string) --

            The ID of the Amazon Web Services account associated with the findings.

          • severityCounts (dict) --

            An object that represent the count of matched findings per severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

        • lambdaLayerAggregation (dict) --

          An aggregation of findings by Amazon Web Services Lambda layer.

          • functionName (string) --

            The names of the Amazon Web Services Lambda functions associated with the layers.

          • resourceId (string) --

            The Resource ID of the Amazon Web Services Lambda function layer.

          • layerArn (string) --

            The Amazon Resource Name (ARN) of the Amazon Web Services Lambda function layer.

          • accountId (string) --

            The account ID of the Amazon Web Services Lambda function layer.

          • severityCounts (dict) --

            An object that contains the counts of aggregated finding per severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

        • lambdaFunctionAggregation (dict) --

          An aggregation of findings by Amazon Web Services Lambda function.

          • resourceId (string) --

            The resource IDs included in the aggregation results.

          • functionName (string) --

            The Amazon Web Services Lambda function names included in the aggregation results.

          • runtime (string) --

            The runtimes included in the aggregation results.

          • lambdaTags (dict) --

            The tags included in the aggregation results.

            • (string) --

              • (string) --

          • accountId (string) --

            The ID of the Amazon Web Services account that owns the Amazon Web Services Lambda function.

          • severityCounts (dict) --

            An object that contains the counts of aggregated finding per severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

          • lastModifiedAt (datetime) --

            The date that the Amazon Web Services Lambda function included in the aggregation results was last changed.

        • codeRepositoryAggregation (dict) --

          An object that contains details about an aggregation response based on code repositories.

          • projectNames (string) --

            The names of the projects associated with the code repository.

          • providerType (string) --

            The type of repository provider for the code repository.

          • severityCounts (dict) --

            An object that contains the counts of aggregated finding per severity.

            • all (integer) --

              The total count of findings from all severities.

            • medium (integer) --

              The total count of medium severity findings.

            • high (integer) --

              The total count of high severity findings.

            • critical (integer) --

              The total count of critical severity findings.

          • exploitAvailableActiveFindingsCount (integer) --

            The number of active findings that have an exploit available for the code repository.

          • fixAvailableActiveFindingsCount (integer) --

            The number of active findings that have a fix available for the code repository.

          • accountId (string) --

            The Amazon Web Services account ID associated with the code repository.

          • resourceId (string) --

            The resource ID of the code repository.

    • nextToken (string) --

      A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request to a list action. For subsequent calls, use the NextToken value returned from the previous request to continue listing results after the first page.

ListUsageTotals (updated) Link ¶
Changes (response)
{'totals': {'usage': {'type': {'EC2_AGENTLESS_INSTANCE_HOURS'}}}}

Lists the Amazon Inspector usage totals over the last 30 days.

See also: AWS API Documentation

Request Syntax

client.list_usage_totals(
    maxResults=123,
    nextToken='string',
    accountIds=[
        'string',
    ]
)
type maxResults:

integer

param maxResults:

The maximum number of results the response can return. If your request would return more than the maximum the response will return a nextToken value, use this value when you call the action again to get the remaining results.

type nextToken:

string

param nextToken:

A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request to a list action. If your response returns more than the maxResults maximum value it will also return a nextToken value. For subsequent calls, use the nextToken value returned from the previous request to continue listing results after the first page.

type accountIds:

list

param accountIds:

The Amazon Web Services account IDs to retrieve usage totals for.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'nextToken': 'string',
    'totals': [
        {
            'accountId': 'string',
            'usage': [
                {
                    'type': 'EC2_INSTANCE_HOURS'|'ECR_INITIAL_SCAN'|'ECR_RESCAN'|'LAMBDA_FUNCTION_HOURS'|'LAMBDA_FUNCTION_CODE_HOURS'|'CODE_REPOSITORY_SAST'|'CODE_REPOSITORY_IAC'|'CODE_REPOSITORY_SCA'|'EC2_AGENTLESS_INSTANCE_HOURS',
                    'total': 123.0,
                    'estimatedMonthlyCost': 123.0,
                    'currency': 'USD'
                },
            ]
        },
    ]
}

Response Structure

  • (dict) --

    • nextToken (string) --

      The pagination parameter to be used on the next list operation to retrieve more items.

    • totals (list) --

      An object with details on the total usage for the requested account.

      • (dict) --

        The total of usage for an account ID.

        • accountId (string) --

          The account ID of the account that usage data was retrieved for.

        • usage (list) --

          An object representing the total usage for an account.

          • (dict) --

            Contains usage information about the cost of Amazon Inspector operation.

            • type (string) --

              The type scan.

            • total (float) --

              The total of usage.

            • estimatedMonthlyCost (float) --

              The estimated monthly cost of Amazon Inspector.

            • currency (string) --

              The currency type used when calculating usage data.