Inspector2

2024/08/22 - Inspector2 - 5 updated api methods

Changes  Add enums for Agentless scan statuses and EC2 enablement error states

BatchGetAccountStatus (updated) Link ¶
Changes (response)
{'accounts': {'resourceState': {'ec2': {'errorCode': {'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                                                      'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'}},
                                'ecr': {'errorCode': {'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                                                      'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'}},
                                'lambda': {'errorCode': {'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                                                         'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'}},
                                'lambdaCode': {'errorCode': {'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                                                             'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'}}},
              'state': {'errorCode': {'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                                      'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'}}},
 'failedAccounts': {'errorCode': {'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                                  'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'}}}

Retrieves the Amazon Inspector status of multiple Amazon Web Services accounts within your environment.

See also: AWS API Documentation

Request Syntax

client.batch_get_account_status(
    accountIds=[
        'string',
    ]
)
type accountIds:

list

param accountIds:

The 12-digit Amazon Web Services account IDs of the accounts to retrieve Amazon Inspector status for.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'accounts': [
        {
            'accountId': 'string',
            'resourceState': {
                'ec2': {
                    'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                    'errorMessage': 'string',
                    'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
                },
                'ecr': {
                    'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                    'errorMessage': 'string',
                    'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
                },
                'lambda': {
                    'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                    'errorMessage': 'string',
                    'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
                },
                'lambdaCode': {
                    'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                    'errorMessage': 'string',
                    'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
                }
            },
            'state': {
                'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                'errorMessage': 'string',
                'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
            }
        },
    ],
    'failedAccounts': [
        {
            'accountId': 'string',
            'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
            'errorMessage': 'string',
            'resourceStatus': {
                'ec2': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'ecr': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambda': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambdaCode': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
            },
            'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
        },
    ]
}

Response Structure

  • (dict) --

    • accounts (list) --

      An array of objects that provide details on the status of Amazon Inspector for each of the requested accounts.

      • (dict) --

        An object with details the status of an Amazon Web Services account within your Amazon Inspector environment.

        • accountId (string) --

          The Amazon Web Services account ID.

        • resourceState (dict) --

          An object detailing which resources Amazon Inspector is enabled to scan for the account.

          • ec2 (dict) --

            An object detailing the state of Amazon Inspector scanning for Amazon EC2 resources.

            • errorCode (string) --

              The error code explaining why the account failed to enable Amazon Inspector.

            • errorMessage (string) --

              The error message received when the account failed to enable Amazon Inspector.

            • status (string) --

              The status of Amazon Inspector for the account.

          • ecr (dict) --

            An object detailing the state of Amazon Inspector scanning for Amazon ECR resources.

            • errorCode (string) --

              The error code explaining why the account failed to enable Amazon Inspector.

            • errorMessage (string) --

              The error message received when the account failed to enable Amazon Inspector.

            • status (string) --

              The status of Amazon Inspector for the account.

          • lambda (dict) --

            An object that described the state of Amazon Inspector scans for an account.

            • errorCode (string) --

              The error code explaining why the account failed to enable Amazon Inspector.

            • errorMessage (string) --

              The error message received when the account failed to enable Amazon Inspector.

            • status (string) --

              The status of Amazon Inspector for the account.

          • lambdaCode (dict) --

            An object that described the state of Amazon Inspector scans for an account.

            • errorCode (string) --

              The error code explaining why the account failed to enable Amazon Inspector.

            • errorMessage (string) --

              The error message received when the account failed to enable Amazon Inspector.

            • status (string) --

              The status of Amazon Inspector for the account.

        • state (dict) --

          An object detailing the status of Amazon Inspector for the account.

          • errorCode (string) --

            The error code explaining why the account failed to enable Amazon Inspector.

          • errorMessage (string) --

            The error message received when the account failed to enable Amazon Inspector.

          • status (string) --

            The status of Amazon Inspector for the account.

    • failedAccounts (list) --

      An array of objects detailing any accounts that failed to enable Amazon Inspector and why.

      • (dict) --

        An object with details on why an account failed to enable Amazon Inspector.

        • accountId (string) --

          The Amazon Web Services account ID.

        • errorCode (string) --

          The error code explaining why the account failed to enable Amazon Inspector.

        • errorMessage (string) --

          The error message received when the account failed to enable Amazon Inspector.

        • resourceStatus (dict) --

          An object detailing which resources Amazon Inspector is enabled to scan for the account.

          • ec2 (string) --

            The status of Amazon Inspector scanning for Amazon EC2 resources.

          • ecr (string) --

            The status of Amazon Inspector scanning for Amazon ECR resources.

          • lambda (string) --

            The status of Amazon Inspector scanning for Amazon Web Services Lambda function.

          • lambdaCode (string) --

            The status of Amazon Inspector scanning for custom application code for Amazon Web Services Lambda functions.

        • status (string) --

          The status of Amazon Inspector for the account.

Disable (updated) Link ¶
Changes (response)
{'failedAccounts': {'errorCode': {'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                                  'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'}}}

Disables Amazon Inspector scans for one or more Amazon Web Services accounts. Disabling all scan types in an account disables the Amazon Inspector service.

See also: AWS API Documentation

Request Syntax

client.disable(
    accountIds=[
        'string',
    ],
    resourceTypes=[
        'EC2'|'ECR'|'LAMBDA'|'LAMBDA_CODE',
    ]
)
type accountIds:

list

param accountIds:

An array of account IDs you want to disable Amazon Inspector scans for.

  • (string) --

type resourceTypes:

list

param resourceTypes:

The resource scan types you want to disable.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'accounts': [
        {
            'accountId': 'string',
            'resourceStatus': {
                'ec2': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'ecr': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambda': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambdaCode': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
            },
            'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
        },
    ],
    'failedAccounts': [
        {
            'accountId': 'string',
            'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
            'errorMessage': 'string',
            'resourceStatus': {
                'ec2': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'ecr': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambda': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambdaCode': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
            },
            'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
        },
    ]
}

Response Structure

  • (dict) --

    • accounts (list) --

      Information on the accounts that have had Amazon Inspector scans successfully disabled. Details are provided for each account.

      • (dict) --

        An Amazon Web Services account within your environment that Amazon Inspector has been enabled for.

        • accountId (string) --

          The ID of the Amazon Web Services account.

        • resourceStatus (dict) --

          Details of the status of Amazon Inspector scans by resource type.

          • ec2 (string) --

            The status of Amazon Inspector scanning for Amazon EC2 resources.

          • ecr (string) --

            The status of Amazon Inspector scanning for Amazon ECR resources.

          • lambda (string) --

            The status of Amazon Inspector scanning for Amazon Web Services Lambda function.

          • lambdaCode (string) --

            The status of Amazon Inspector scanning for custom application code for Amazon Web Services Lambda functions.

        • status (string) --

          The status of Amazon Inspector for the account.

    • failedAccounts (list) --

      Information on any accounts for which Amazon Inspector scans could not be disabled. Details are provided for each account.

      • (dict) --

        An object with details on why an account failed to enable Amazon Inspector.

        • accountId (string) --

          The Amazon Web Services account ID.

        • errorCode (string) --

          The error code explaining why the account failed to enable Amazon Inspector.

        • errorMessage (string) --

          The error message received when the account failed to enable Amazon Inspector.

        • resourceStatus (dict) --

          An object detailing which resources Amazon Inspector is enabled to scan for the account.

          • ec2 (string) --

            The status of Amazon Inspector scanning for Amazon EC2 resources.

          • ecr (string) --

            The status of Amazon Inspector scanning for Amazon ECR resources.

          • lambda (string) --

            The status of Amazon Inspector scanning for Amazon Web Services Lambda function.

          • lambdaCode (string) --

            The status of Amazon Inspector scanning for custom application code for Amazon Web Services Lambda functions.

        • status (string) --

          The status of Amazon Inspector for the account.

Enable (updated) Link ¶
Changes (response)
{'failedAccounts': {'errorCode': {'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
                                  'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'}}}

Enables Amazon Inspector scans for one or more Amazon Web Services accounts.

See also: AWS API Documentation

Request Syntax

client.enable(
    accountIds=[
        'string',
    ],
    clientToken='string',
    resourceTypes=[
        'EC2'|'ECR'|'LAMBDA'|'LAMBDA_CODE',
    ]
)
type accountIds:

list

param accountIds:

A list of account IDs you want to enable Amazon Inspector scans for.

  • (string) --

type clientToken:

string

param clientToken:

The idempotency token for the request.

This field is autopopulated if not provided.

type resourceTypes:

list

param resourceTypes:

[REQUIRED]

The resource scan types you want to enable.

  • (string) --

rtype:

dict

returns:

Response Syntax

{
    'accounts': [
        {
            'accountId': 'string',
            'resourceStatus': {
                'ec2': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'ecr': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambda': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambdaCode': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
            },
            'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
        },
    ],
    'failedAccounts': [
        {
            'accountId': 'string',
            'errorCode': 'ALREADY_ENABLED'|'ENABLE_IN_PROGRESS'|'DISABLE_IN_PROGRESS'|'SUSPEND_IN_PROGRESS'|'RESOURCE_NOT_FOUND'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'SSM_UNAVAILABLE'|'SSM_THROTTLED'|'EVENTBRIDGE_UNAVAILABLE'|'EVENTBRIDGE_THROTTLED'|'RESOURCE_SCAN_NOT_DISABLED'|'DISASSOCIATE_ALL_MEMBERS'|'ACCOUNT_IS_ISOLATED'|'EC2_SSM_RESOURCE_DATA_SYNC_LIMIT_EXCEEDED'|'EC2_SSM_ASSOCIATION_VERSION_LIMIT_EXCEEDED',
            'errorMessage': 'string',
            'resourceStatus': {
                'ec2': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'ecr': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambda': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED',
                'lambdaCode': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
            },
            'status': 'ENABLING'|'ENABLED'|'DISABLING'|'DISABLED'|'SUSPENDING'|'SUSPENDED'
        },
    ]
}

Response Structure

  • (dict) --

    • accounts (list) --

      Information on the accounts that have had Amazon Inspector scans successfully enabled. Details are provided for each account.

      • (dict) --

        An Amazon Web Services account within your environment that Amazon Inspector has been enabled for.

        • accountId (string) --

          The ID of the Amazon Web Services account.

        • resourceStatus (dict) --

          Details of the status of Amazon Inspector scans by resource type.

          • ec2 (string) --

            The status of Amazon Inspector scanning for Amazon EC2 resources.

          • ecr (string) --

            The status of Amazon Inspector scanning for Amazon ECR resources.

          • lambda (string) --

            The status of Amazon Inspector scanning for Amazon Web Services Lambda function.

          • lambdaCode (string) --

            The status of Amazon Inspector scanning for custom application code for Amazon Web Services Lambda functions.

        • status (string) --

          The status of Amazon Inspector for the account.

    • failedAccounts (list) --

      Information on any accounts for which Amazon Inspector scans could not be enabled. Details are provided for each account.

      • (dict) --

        An object with details on why an account failed to enable Amazon Inspector.

        • accountId (string) --

          The Amazon Web Services account ID.

        • errorCode (string) --

          The error code explaining why the account failed to enable Amazon Inspector.

        • errorMessage (string) --

          The error message received when the account failed to enable Amazon Inspector.

        • resourceStatus (dict) --

          An object detailing which resources Amazon Inspector is enabled to scan for the account.

          • ec2 (string) --

            The status of Amazon Inspector scanning for Amazon EC2 resources.

          • ecr (string) --

            The status of Amazon Inspector scanning for Amazon ECR resources.

          • lambda (string) --

            The status of Amazon Inspector scanning for Amazon Web Services Lambda function.

          • lambdaCode (string) --

            The status of Amazon Inspector scanning for custom application code for Amazon Web Services Lambda functions.

        • status (string) --

          The status of Amazon Inspector for the account.

ListCoverage (updated) Link ¶
Changes (response)
{'coveredResources': {'scanStatus': {'reason': {'AGENTLESS_INSTANCE_COLLECTION_TIME_LIMIT_EXCEEDED',
                                                'AGENTLESS_INSTANCE_STORAGE_LIMIT_EXCEEDED'}}}}

Lists coverage details for you environment.

See also: AWS API Documentation

Request Syntax

client.list_coverage(
    filterCriteria={
        'accountId': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ],
        'ec2InstanceTags': [
            {
                'comparison': 'EQUALS',
                'key': 'string',
                'value': 'string'
            },
        ],
        'ecrImageTags': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ],
        'ecrRepositoryName': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ],
        'imagePulledAt': [
            {
                'endInclusive': datetime(2015, 1, 1),
                'startInclusive': datetime(2015, 1, 1)
            },
        ],
        'lambdaFunctionName': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ],
        'lambdaFunctionRuntime': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ],
        'lambdaFunctionTags': [
            {
                'comparison': 'EQUALS',
                'key': 'string',
                'value': 'string'
            },
        ],
        'lastScannedAt': [
            {
                'endInclusive': datetime(2015, 1, 1),
                'startInclusive': datetime(2015, 1, 1)
            },
        ],
        'resourceId': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ],
        'resourceType': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ],
        'scanMode': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ],
        'scanStatusCode': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ],
        'scanStatusReason': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ],
        'scanType': [
            {
                'comparison': 'EQUALS'|'NOT_EQUALS',
                'value': 'string'
            },
        ]
    },
    maxResults=123,
    nextToken='string'
)
type filterCriteria:

dict

param filterCriteria:

An object that contains details on the filters to apply to the coverage data for your environment.

  • accountId (list) --

    An array of Amazon Web Services account IDs to return coverage statistics for.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

  • ec2InstanceTags (list) --

    The Amazon EC2 instance tags to filter on.

    • (dict) --

      Contains details of a coverage map filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare coverage on.

      • key (string) -- [REQUIRED]

        The tag key associated with the coverage map filter.

      • value (string) --

        The tag value associated with the coverage map filter.

  • ecrImageTags (list) --

    The Amazon ECR image tags to filter on.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

  • ecrRepositoryName (list) --

    The Amazon ECR repository name to filter on.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

  • imagePulledAt (list) --

    The date an image was last pulled at.

    • (dict) --

      Contains details of a coverage date filter.

      • endInclusive (datetime) --

        A timestamp representing the end of the time period to filter results by.

      • startInclusive (datetime) --

        A timestamp representing the start of the time period to filter results by.

  • lambdaFunctionName (list) --

    Returns coverage statistics for Amazon Web Services Lambda functions filtered by function names.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

  • lambdaFunctionRuntime (list) --

    Returns coverage statistics for Amazon Web Services Lambda functions filtered by runtime.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

  • lambdaFunctionTags (list) --

    Returns coverage statistics for Amazon Web Services Lambda functions filtered by tag.

    • (dict) --

      Contains details of a coverage map filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare coverage on.

      • key (string) -- [REQUIRED]

        The tag key associated with the coverage map filter.

      • value (string) --

        The tag value associated with the coverage map filter.

  • lastScannedAt (list) --

    Filters Amazon Web Services resources based on whether Amazon Inspector has checked them for vulnerabilities within the specified time range.

    • (dict) --

      Contains details of a coverage date filter.

      • endInclusive (datetime) --

        A timestamp representing the end of the time period to filter results by.

      • startInclusive (datetime) --

        A timestamp representing the start of the time period to filter results by.

  • resourceId (list) --

    An array of Amazon Web Services resource IDs to return coverage statistics for.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

  • resourceType (list) --

    An array of Amazon Web Services resource types to return coverage statistics for. The values can be AWS_EC2_INSTANCE, AWS_LAMBDA_FUNCTION, AWS_ECR_CONTAINER_IMAGE, AWS_ECR_REPOSITORY or AWS_ACCOUNT.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

  • scanMode (list) --

    The filter to search for Amazon EC2 instance coverage by scan mode. Valid values are EC2_SSM_AGENT_BASED and EC2_HYBRID.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

  • scanStatusCode (list) --

    The scan status code to filter on. Valid values are: ValidationException, InternalServerException, ResourceNotFoundException, BadRequestException, and ThrottlingException.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

  • scanStatusReason (list) --

    The scan status reason to filter on.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

  • scanType (list) --

    An array of Amazon Inspector scan types to return coverage statistics for.

    • (dict) --

      Contains details of a coverage string filter.

      • comparison (string) -- [REQUIRED]

        The operator to compare strings on.

      • value (string) -- [REQUIRED]

        The value to compare strings on.

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.

rtype:

dict

returns:

Response Syntax

{
    'coveredResources': [
        {
            'accountId': 'string',
            'lastScannedAt': datetime(2015, 1, 1),
            'resourceId': 'string',
            'resourceMetadata': {
                'ec2': {
                    'amiId': 'string',
                    'platform': 'WINDOWS'|'LINUX'|'UNKNOWN'|'MACOS',
                    'tags': {
                        'string': 'string'
                    }
                },
                'ecrImage': {
                    'imagePulledAt': datetime(2015, 1, 1),
                    'tags': [
                        'string',
                    ]
                },
                'ecrRepository': {
                    'name': 'string',
                    'scanFrequency': 'MANUAL'|'SCAN_ON_PUSH'|'CONTINUOUS_SCAN'
                },
                'lambdaFunction': {
                    'functionName': 'string',
                    'functionTags': {
                        'string': 'string'
                    },
                    'layers': [
                        'string',
                    ],
                    'runtime': 'NODEJS'|'NODEJS_12_X'|'NODEJS_14_X'|'NODEJS_16_X'|'JAVA_8'|'JAVA_8_AL2'|'JAVA_11'|'PYTHON_3_7'|'PYTHON_3_8'|'PYTHON_3_9'|'UNSUPPORTED'|'NODEJS_18_X'|'GO_1_X'|'JAVA_17'|'PYTHON_3_10'
                }
            },
            'resourceType': 'AWS_EC2_INSTANCE'|'AWS_ECR_CONTAINER_IMAGE'|'AWS_ECR_REPOSITORY'|'AWS_LAMBDA_FUNCTION',
            'scanMode': 'EC2_SSM_AGENT_BASED'|'EC2_AGENTLESS',
            'scanStatus': {
                'reason': 'PENDING_INITIAL_SCAN'|'ACCESS_DENIED'|'INTERNAL_ERROR'|'UNMANAGED_EC2_INSTANCE'|'UNSUPPORTED_OS'|'SCAN_ELIGIBILITY_EXPIRED'|'RESOURCE_TERMINATED'|'SUCCESSFUL'|'NO_RESOURCES_FOUND'|'IMAGE_SIZE_EXCEEDED'|'SCAN_FREQUENCY_MANUAL'|'SCAN_FREQUENCY_SCAN_ON_PUSH'|'EC2_INSTANCE_STOPPED'|'PENDING_DISABLE'|'NO_INVENTORY'|'STALE_INVENTORY'|'EXCLUDED_BY_TAG'|'UNSUPPORTED_RUNTIME'|'UNSUPPORTED_MEDIA_TYPE'|'UNSUPPORTED_CONFIG_FILE'|'DEEP_INSPECTION_PACKAGE_COLLECTION_LIMIT_EXCEEDED'|'DEEP_INSPECTION_DAILY_SSM_INVENTORY_LIMIT_EXCEEDED'|'DEEP_INSPECTION_COLLECTION_TIME_LIMIT_EXCEEDED'|'DEEP_INSPECTION_NO_INVENTORY'|'AGENTLESS_INSTANCE_STORAGE_LIMIT_EXCEEDED'|'AGENTLESS_INSTANCE_COLLECTION_TIME_LIMIT_EXCEEDED',
                'statusCode': 'ACTIVE'|'INACTIVE'
            },
            'scanType': 'NETWORK'|'PACKAGE'|'CODE'
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    • coveredResources (list) --

      An object that contains details on the covered resources in your environment.

      • (dict) --

        An object that contains details about a resource covered by Amazon Inspector.

        • accountId (string) --

          The Amazon Web Services account ID of the covered resource.

        • lastScannedAt (datetime) --

          The date and time the resource was last checked for vulnerabilities.

        • resourceId (string) --

          The ID of the covered resource.

        • resourceMetadata (dict) --

          An object that contains details about the metadata.

          • ec2 (dict) --

            An object that contains metadata details for an Amazon EC2 instance.

            • amiId (string) --

              The ID of the Amazon Machine Image (AMI) used to launch the instance.

            • platform (string) --

              The platform of the instance.

            • tags (dict) --

              The tags attached to the instance.

              • (string) --

                • (string) --

          • ecrImage (dict) --

            An object that contains details about the container metadata for an Amazon ECR image.

            • imagePulledAt (datetime) --

              The date an image was last pulled at.

            • tags (list) --

              Tags associated with the Amazon ECR image metadata.

              • (string) --

          • ecrRepository (dict) --

            An object that contains details about the repository an Amazon ECR image resides in.

            • name (string) --

              The name of the Amazon ECR repository.

            • scanFrequency (string) --

              The frequency of scans.

          • lambdaFunction (dict) --

            An object that contains metadata details for an Amazon Web Services Lambda function.

            • functionName (string) --

              The name of a function.

            • functionTags (dict) --

              The resource tags on an Amazon Web Services Lambda function.

              • (string) --

                • (string) --

            • layers (list) --

              The layers for an Amazon Web Services Lambda function. A Lambda function can have up to five layers.

              • (string) --

            • runtime (string) --

              An Amazon Web Services Lambda function's runtime.

        • resourceType (string) --

          The type of the covered resource.

        • scanMode (string) --

          The scan method that is applied to the instance.

        • scanStatus (dict) --

          The status of the scan covering the resource.

          • reason (string) --

            The scan status. Possible return values and descriptions are:

            PENDING_INITIAL_SCAN - This resource has been identified for scanning, results will be available soon.

            ACCESS_DENIED - Resource access policy restricting Amazon Inspector access. Please update the IAM policy.

            INTERNAL_ERROR - Amazon Inspector has encountered an internal error for this resource. Amazon Inspector service will automatically resolve the issue and resume the scanning. No action required from the user.

            UNMANAGED_EC2_INSTANCE - The EC2 instance is not managed by SSM, please use the following SSM automation to remediate the issue: https://docs.aws.amazon.com/systems-manager-automation-runbooks/latest/userguide/automation-awssupport-troubleshoot-managed-instance.html. Once the instance becomes managed by SSM, Inspector will automatically begin scanning this instance.

            UNSUPPORTED_OS - Amazon Inspector does not support this OS, architecture, or image manifest type at this time. To see a complete list of supported operating systems see: https://docs.aws.amazon.com/inspector/latest/user/supported.html.

            SCAN_ELIGIBILITY_EXPIRED - The configured scan duration has lapsed for this image.

            RESOURCE_TERMINATED - This resource has been terminated. The findings and coverage associated with this resource are in the process of being cleaned up.

            SUCCESSFUL - The scan was successful.

            NO_RESOURCES_FOUND - Reserved for future use.

            IMAGE_SIZE_EXCEEDED - Reserved for future use.

            SCAN_FREQUENCY_MANUAL - This image will not be covered by Amazon Inspector due to the repository scan frequency configuration.

            ``SCAN_FREQUENCY_SCAN_ON_PUSH ``- This image will be scanned one time and will not new findings because of the scan frequency configuration.

            EC2_INSTANCE_STOPPED - This EC2 instance is in a stopped state, therefore, Amazon Inspector will pause scanning. The existing findings will continue to exist until the instance is terminated. Once the instance is re-started, Inspector will automatically start scanning the instance again. Please note that you will not be charged for this instance while it’s in a stopped state.

            PENDING_DISABLE - This resource is pending cleanup during disablement. The customer will not be billed while a resource is in the pending disable status.

            NO INVENTORY - Amazon Inspector couldn’t find software application inventory to scan for vulnerabilities. This might be caused due to required Amazon Inspector associations being deleted or failing to run on your resource. Please verify the status of InspectorInventoryCollection-do-not-delete association in the SSM console for the resource. Additionally, you can verify the instance’s inventory in the SSM Fleet Manager console.

            STALE_INVENTORY - Amazon Inspector wasn’t able to collect an updated software application inventory in the last 7 days. Please confirm the required Amazon Inspector associations still exist and you can still see an updated inventory in the SSM console.

            EXCLUDED_BY_TAG - This resource was not scanned because it has been excluded by a tag.

            UNSUPPORTED_RUNTIME - The function was not scanned because it has an unsupported runtime. To see a complete list of supported runtimes see: https://docs.aws.amazon.com/inspector/latest/user/supported.html.

            ``UNSUPPORTED_MEDIA_TYPE ``- The ECR image has an unsupported media type.

            UNSUPPORTED_CONFIG_FILE - Reserved for future use.

            DEEP_INSPECTION_PACKAGE_COLLECTION_LIMIT_EXCEEDED - The instance has exceeded the 5000 package limit for Amazon Inspector Deep inspection. To resume Deep inspection for this instance you can try to adjust the custom paths associated with the account.

            DEEP_INSPECTION_DAILY_SSM_INVENTORY_LIMIT_EXCEEDED - The SSM agent couldn't send inventory to Amazon Inspector because the SSM quota for Inventory data collected per instance per day has already been reached for this instance.

            DEEP_INSPECTION_COLLECTION_TIME_LIMIT_EXCEEDED - Amazon Inspector failed to extract the package inventory because the package collection time exceeding the maximum threshold of 15 minutes.

            DEEP_INSPECTION_NO_INVENTORY The Amazon Inspector plugin hasn't yet been able to collect an inventory of packages for this instance. This is usually the result of a pending scan, however, if this status persists after 6 hours, use SSM to ensure that the required Amazon Inspector associations exist and are running for the instance.

          • statusCode (string) --

            The status code of the scan.

        • scanType (string) --

          The Amazon Inspector scan type covering the resource.

    • 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.

ListFindingAggregations (updated) Link ¶
Changes (response)
{'responses': {'accountAggregation': {'exploitAvailableCount': 'long',
                                      'fixAvailableCount': 'long'},
               'findingTypeAggregation': {'exploitAvailableCount': 'long',
                                          'fixAvailableCount': 'long'}}}

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

See also: AWS API Documentation

Request Syntax

client.list_finding_aggregations(
    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',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'sortOrder': 'ASC'|'DESC'
        },
        'amiAggregation': {
            'amis': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortBy': 'CRITICAL'|'HIGH'|'ALL'|'AFFECTED_INSTANCES',
            'sortOrder': 'ASC'|'DESC'
        },
        'awsEcrContainerAggregation': {
            'architectures': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'imageShas': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'imageTags': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'repositories': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'resourceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'sortOrder': 'ASC'|'DESC'
        },
        'ec2InstanceAggregation': {
            'amis': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'instanceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'instanceTags': [
                {
                    'comparison': 'EQUALS',
                    'key': 'string',
                    'value': 'string'
                },
            ],
            'operatingSystems': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortBy': 'NETWORK_FINDINGS'|'CRITICAL'|'HIGH'|'ALL',
            'sortOrder': 'ASC'|'DESC'
        },
        'findingTypeAggregation': {
            'findingType': 'NETWORK_REACHABILITY'|'PACKAGE_VULNERABILITY'|'CODE_VULNERABILITY',
            'resourceType': 'AWS_EC2_INSTANCE'|'AWS_ECR_CONTAINER_IMAGE'|'AWS_LAMBDA_FUNCTION',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'sortOrder': 'ASC'|'DESC'
        },
        'imageLayerAggregation': {
            'layerHashes': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'repositories': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'resourceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'sortOrder': 'ASC'|'DESC'
        },
        'lambdaFunctionAggregation': {
            'functionNames': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'functionTags': [
                {
                    'comparison': 'EQUALS',
                    'key': 'string',
                    'value': 'string'
                },
            ],
            'resourceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'runtimes': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'sortOrder': 'ASC'|'DESC'
        },
        'lambdaLayerAggregation': {
            'functionNames': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'layerArns': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'resourceIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'sortOrder': 'ASC'|'DESC'
        },
        'packageAggregation': {
            'packageNames': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'sortOrder': 'ASC'|'DESC'
        },
        'repositoryAggregation': {
            'repositories': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'sortBy': 'CRITICAL'|'HIGH'|'ALL'|'AFFECTED_IMAGES',
            'sortOrder': 'ASC'|'DESC'
        },
        'titleAggregation': {
            'findingType': 'NETWORK_REACHABILITY'|'PACKAGE_VULNERABILITY'|'CODE_VULNERABILITY',
            'resourceType': 'AWS_EC2_INSTANCE'|'AWS_ECR_CONTAINER_IMAGE'|'AWS_LAMBDA_FUNCTION',
            'sortBy': 'CRITICAL'|'HIGH'|'ALL',
            'sortOrder': 'ASC'|'DESC',
            'titles': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ],
            'vulnerabilityIds': [
                {
                    'comparison': 'EQUALS'|'PREFIX'|'NOT_EQUALS',
                    'value': 'string'
                },
            ]
        }
    },
    aggregationType='FINDING_TYPE'|'PACKAGE'|'TITLE'|'REPOSITORY'|'AMI'|'AWS_EC2_INSTANCE'|'AWS_ECR_CONTAINER'|'IMAGE_LAYER'|'ACCOUNT'|'AWS_LAMBDA_FUNCTION'|'LAMBDA_LAYER',
    maxResults=123,
    nextToken='string'
)
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.

    • sortBy (string) --

      The value to sort by.

    • sortOrder (string) --

      The sort order (ascending or descending).

  • 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.

    • sortBy (string) --

      The value to sort results by.

    • sortOrder (string) --

      The order to sort results by.

  • awsEcrContainerAggregation (dict) --

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

    • 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.

    • 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.

    • 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.

    • 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.

    • 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.

    • sortBy (string) --

      The value to sort by.

    • sortOrder (string) --

      The sort order (ascending or descending).

  • 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.

    • 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.

    • 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.

    • sortBy (string) --

      The value to sort results by.

    • sortOrder (string) --

      The order 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.

    • sortBy (string) --

      The value to sort results by.

    • sortOrder (string) --

      The order to sort results by.

  • imageLayerAggregation (dict) --

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

    • 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.

    • 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.

    • sortBy (string) --

      The value to sort results by.

    • sortOrder (string) --

      The order to sort results by.

  • lambdaFunctionAggregation (dict) --

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

    • 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.

    • 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.

    • 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.

    • 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.

    • sortBy (string) --

      The finding severity to use for sorting the results.

    • sortOrder (string) --

      The order to use for sorting the results.

  • 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.

    • 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.

    • 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.

    • sortBy (string) --

      The finding severity to use for sorting the results.

    • sortOrder (string) --

      The order to use for sorting the results.

  • 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.

    • sortBy (string) --

      The value to sort results by.

    • sortOrder (string) --

      The order 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.

    • sortBy (string) --

      The value to sort results by.

    • sortOrder (string) --

      The order to sort results by.

  • titleAggregation (dict) --

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

    • findingType (string) --

      The type of finding to aggregate on.

    • resourceType (string) --

      The resource type to aggregate on.

    • sortBy (string) --

      The value to sort results by.

    • sortOrder (string) --

      The order to sort results by.

    • 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.

type aggregationType:

string

param aggregationType:

[REQUIRED]

The type of the aggregation request.

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.

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',
    'nextToken': 'string',
    'responses': [
        {
            'accountAggregation': {
                'accountId': 'string',
                'exploitAvailableCount': 123,
                'fixAvailableCount': 123,
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                }
            },
            'amiAggregation': {
                'accountId': 'string',
                'affectedInstances': 123,
                'ami': 'string',
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                }
            },
            'awsEcrContainerAggregation': {
                'accountId': 'string',
                'architecture': 'string',
                'imageSha': 'string',
                'imageTags': [
                    'string',
                ],
                'repository': 'string',
                'resourceId': 'string',
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                }
            },
            'ec2InstanceAggregation': {
                'accountId': 'string',
                'ami': 'string',
                'instanceId': 'string',
                'instanceTags': {
                    'string': 'string'
                },
                'networkFindings': 123,
                'operatingSystem': 'string',
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                }
            },
            'findingTypeAggregation': {
                'accountId': 'string',
                'exploitAvailableCount': 123,
                'fixAvailableCount': 123,
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                }
            },
            'imageLayerAggregation': {
                'accountId': 'string',
                'layerHash': 'string',
                'repository': 'string',
                'resourceId': 'string',
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                }
            },
            'lambdaFunctionAggregation': {
                'accountId': 'string',
                'functionName': 'string',
                'lambdaTags': {
                    'string': 'string'
                },
                'lastModifiedAt': datetime(2015, 1, 1),
                'resourceId': 'string',
                'runtime': 'string',
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                }
            },
            'lambdaLayerAggregation': {
                'accountId': 'string',
                'functionName': 'string',
                'layerArn': 'string',
                'resourceId': 'string',
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                }
            },
            'packageAggregation': {
                'accountId': 'string',
                'packageName': 'string',
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                }
            },
            'repositoryAggregation': {
                'accountId': 'string',
                'affectedImages': 123,
                'repository': 'string',
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                }
            },
            'titleAggregation': {
                'accountId': 'string',
                'severityCounts': {
                    'all': 123,
                    'critical': 123,
                    'high': 123,
                    'medium': 123
                },
                'title': 'string',
                'vulnerabilityId': 'string'
            }
        },
    ]
}

Response Structure

  • (dict) --

    • aggregationType (string) --

      The type of aggregation to perform.

    • 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.

    • 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.

          • exploitAvailableCount (integer) --

            The number of findings that have an exploit available.

          • fixAvailableCount (integer) --

            Details about the number of fixes.

          • severityCounts (dict) --

            The number of findings by severity.

            • all (integer) --

              The total count of findings from all severities.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

        • amiAggregation (dict) --

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

          • accountId (string) --

            The Amazon Web Services account ID for the AMI.

          • affectedInstances (integer) --

            The IDs of Amazon EC2 instances using this AMI.

          • ami (string) --

            The ID of the AMI that findings were aggregated for.

          • severityCounts (dict) --

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

            • all (integer) --

              The total count of findings from all severities.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

        • awsEcrContainerAggregation (dict) --

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

          • accountId (string) --

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

          • architecture (string) --

            The architecture of the container.

          • imageSha (string) --

            The SHA value of the container image.

          • imageTags (list) --

            The container image stags.

            • (string) --

          • repository (string) --

            The container repository.

          • resourceId (string) --

            The resource ID of the container.

          • severityCounts (dict) --

            The number of finding by severity.

            • all (integer) --

              The total count of findings from all severities.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

        • ec2InstanceAggregation (dict) --

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

          • accountId (string) --

            The Amazon Web Services account for the Amazon EC2 instance.

          • ami (string) --

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

          • instanceId (string) --

            The Amazon EC2 instance ID.

          • instanceTags (dict) --

            The tags attached to the instance.

            • (string) --

              • (string) --

          • networkFindings (integer) --

            The number of network findings for the Amazon EC2 instance.

          • operatingSystem (string) --

            The operating system of 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.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

        • 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.

          • exploitAvailableCount (integer) --

            The number of findings that have an exploit available.

          • fixAvailableCount (integer) --

            Details about the number of fixes.

          • severityCounts (dict) --

            The value to sort results by.

            • all (integer) --

              The total count of findings from all severities.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

        • imageLayerAggregation (dict) --

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

          • accountId (string) --

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

          • layerHash (string) --

            The layer hash.

          • repository (string) --

            The repository the layer resides in.

          • resourceId (string) --

            The resource ID of the container image layer.

          • severityCounts (dict) --

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

            • all (integer) --

              The total count of findings from all severities.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

        • lambdaFunctionAggregation (dict) --

          An aggregation of findings by Amazon Web Services Lambda function.

          • accountId (string) --

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

          • functionName (string) --

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

          • lambdaTags (dict) --

            The tags included in the aggregation results.

            • (string) --

              • (string) --

          • lastModifiedAt (datetime) --

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

          • resourceId (string) --

            The resource IDs included in the aggregation results.

          • runtime (string) --

            The runtimes included in the aggregation results.

          • severityCounts (dict) --

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

            • all (integer) --

              The total count of findings from all severities.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

        • lambdaLayerAggregation (dict) --

          An aggregation of findings by Amazon Web Services Lambda layer.

          • accountId (string) --

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

          • functionName (string) --

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

          • layerArn (string) --

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

          • resourceId (string) --

            The Resource 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.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

        • packageAggregation (dict) --

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

          • accountId (string) --

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

          • packageName (string) --

            The name of the operating system package.

          • severityCounts (dict) --

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

            • all (integer) --

              The total count of findings from all severities.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

        • repositoryAggregation (dict) --

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

          • accountId (string) --

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

          • affectedImages (integer) --

            The number of container images impacted by the findings.

          • repository (string) --

            The name of the repository 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.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

        • titleAggregation (dict) --

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

          • 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.

            • critical (integer) --

              The total count of critical severity findings.

            • high (integer) --

              The total count of high severity findings.

            • medium (integer) --

              The total count of medium severity findings.

          • title (string) --

            The title that the findings were aggregated on.

          • vulnerabilityId (string) --

            The vulnerability ID of the finding.