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
)
The ARNs of the assessment runs that generate the findings that you want to list.
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.
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.
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.
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.
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.
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.
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.
This data type is used as a request parameter in the AddAttributesToFindings and CreateAssessmentTemplate actions.
The attribute key.
The value assigned to the attribute key.
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.
This data type is used as a request parameter in the AddAttributesToFindings and CreateAssessmentTemplate actions.
The attribute key.
The value assigned to the attribute key.
The time range during which the finding is generated.
The minimum value of the timestamp range.
The maximum value of the timestamp range.
dict
Response Syntax
{
'findingArns': [
'string',
],
'nextToken': 'string'
}
Response Structure
(dict) --
findingArns (list) --
A list of ARNs that specifies the findings returned by the action.
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': {
'...': '...',
},
}