Inspector / Client / list_findings

list_findings#

Inspector.Client.list_findings(**kwargs)#

Lists findings that are generated by the assessment runs that are specified by the ARNs of the assessment runs.

See also: AWS API Documentation

Request Syntax

response = client.list_findings(
    assessmentRunArns=[
        'string',
    ],
    filter={
        'agentIds': [
            'string',
        ],
        'autoScalingGroups': [
            'string',
        ],
        'ruleNames': [
            'string',
        ],
        'severities': [
            'Low'|'Medium'|'High'|'Informational'|'Undefined',
        ],
        'rulesPackageArns': [
            'string',
        ],
        'attributes': [
            {
                'key': 'string',
                'value': 'string'
            },
        ],
        'userAttributes': [
            {
                'key': 'string',
                'value': 'string'
            },
        ],
        'creationTimeRange': {
            'beginDate': datetime(2015, 1, 1),
            'endDate': datetime(2015, 1, 1)
        }
    },
    nextToken='string',
    maxResults=123
)
Parameters:
  • assessmentRunArns (list) –

    The ARNs of the assessment runs that generate the findings that you want to list.

    • (string) –

  • filter (dict) –

    You can use this parameter to specify a subset of data to be included in the action’s response.

    For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.

    • agentIds (list) –

      For a record to match a filter, one of the values that is specified for this data type property must be the exact match of the value of the agentId property of the Finding data type.

      • (string) –

    • autoScalingGroups (list) –

      For a record to match a filter, one of the values that is specified for this data type property must be the exact match of the value of the autoScalingGroup property of the Finding data type.

      • (string) –

    • ruleNames (list) –

      For a record to match a filter, one of the values that is specified for this data type property must be the exact match of the value of the ruleName property of the Finding data type.

      • (string) –

    • severities (list) –

      For a record to match a filter, one of the values that is specified for this data type property must be the exact match of the value of the severity property of the Finding data type.

      • (string) –

    • rulesPackageArns (list) –

      For a record to match a filter, one of the values that is specified for this data type property must be the exact match of the value of the rulesPackageArn property of the Finding data type.

      • (string) –

    • attributes (list) –

      For a record to match a filter, the list of values that are specified for this data type property must be contained in the list of values of the attributes property of the Finding data type.

      • (dict) –

        This data type is used as a request parameter in the AddAttributesToFindings and CreateAssessmentTemplate actions.

        • key (string) – [REQUIRED]

          The attribute key.

        • value (string) –

          The value assigned to the attribute key.

    • userAttributes (list) –

      For a record to match a filter, the value that is specified for this data type property must be contained in the list of values of the userAttributes property of the Finding data type.

      • (dict) –

        This data type is used as a request parameter in the AddAttributesToFindings and CreateAssessmentTemplate actions.

        • key (string) – [REQUIRED]

          The attribute key.

        • value (string) –

          The value assigned to the attribute key.

    • creationTimeRange (dict) –

      The time range during which the finding is generated.

      • beginDate (datetime) –

        The minimum value of the timestamp range.

      • endDate (datetime) –

        The maximum value of the timestamp range.

  • nextToken (string) – You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListFindings action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

  • maxResults (integer) – You can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.

Return type:

dict

Returns:

Response Syntax

{
    'findingArns': [
        'string',
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • findingArns (list) –

      A list of ARNs that specifies the findings returned by the action.

      • (string) –

    • nextToken (string) –

      When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.

Exceptions

  • Inspector.Client.exceptions.InternalException

  • Inspector.Client.exceptions.InvalidInputException

  • Inspector.Client.exceptions.AccessDeniedException

  • Inspector.Client.exceptions.NoSuchEntityException

Examples

Lists findings that are generated by the assessment runs that are specified by the ARNs of the assessment runs.

response = client.list_findings(
    assessmentRunArns=[
        'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE',
    ],
    maxResults=123,
)

print(response)

Expected Output:

{
    'findingArns': [
        'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4',
        'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-v5D6fI3v/finding/0-tyvmqBLy',
    ],
    'nextToken': '1',
    'ResponseMetadata': {
        '...': '...',
    },
}