Table of Contents
Inspector.Client¶A low-level client representing Amazon Inspector:
client = session.create_client('inspector')
These are the available methods:
add_attributes_to_findings()can_paginate()create_assessment_target()create_assessment_template()create_resource_group()delete_assessment_run()delete_assessment_target()delete_assessment_template()describe_assessment_runs()describe_assessment_targets()describe_assessment_templates()describe_cross_account_access_role()describe_findings()describe_resource_groups()describe_rules_packages()generate_presigned_url()get_assessment_report()get_paginator()get_telemetry_metadata()get_waiter()list_assessment_run_agents()list_assessment_runs()list_assessment_targets()list_assessment_templates()list_event_subscriptions()list_findings()list_rules_packages()list_tags_for_resource()preview_agents()register_cross_account_access_role()remove_attributes_from_findings()set_tags_for_resource()start_assessment_run()stop_assessment_run()subscribe_to_event()unsubscribe_from_event()update_assessment_target()add_attributes_to_findings(**kwargs)¶Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.
See also: AWS API Documentation
Request Syntax
response = client.add_attributes_to_findings(
findingArns=[
'string',
],
attributes=[
{
'key': 'string',
'value': 'string'
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'failedItems': {
'string': {
'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
'retryable': True|False
}
}
}
Response Structure
|
Examples
Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.
response = client.add_attributes_to_findings(
attributes=[
{
'key': 'Example',
'value': 'example',
},
],
findingArns=[
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU',
],
)
print(response)
Expected Output:
{
'failedItems': {
},
'ResponseMetadata': {
'...': '...',
},
}
can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
create_assessment_target(**kwargs)¶Creates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup . You can create up to 50 assessment targets per AWS account. You can run up to 500 concurrent agents per AWS account. For more information, see Amazon Inspector Assessment Targets .
See also: AWS API Documentation
Request Syntax
response = client.create_assessment_target(
assessmentTargetName='string',
resourceGroupArn='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'assessmentTargetArn': 'string'
}
Response Structure
|
Examples
Creates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup. You can create up to 50 assessment targets per AWS account. You can run up to 500 concurrent agents per AWS account.
response = client.create_assessment_target(
assessmentTargetName='ExampleAssessmentTarget',
resourceGroupArn='arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv',
)
print(response)
Expected Output:
{
'assessmentTargetArn': 'arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX',
'ResponseMetadata': {
'...': '...',
},
}
create_assessment_template(**kwargs)¶Creates an assessment template for the assessment target that is specified by the ARN of the assessment target.
See also: AWS API Documentation
Request Syntax
response = client.create_assessment_template(
assessmentTargetArn='string',
assessmentTemplateName='string',
durationInSeconds=123,
rulesPackageArns=[
'string',
],
userAttributesForFindings=[
{
'key': 'string',
'value': 'string'
},
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'assessmentTemplateArn': 'string'
}
Response Structure
|
Examples
Creates an assessment template for the assessment target that is specified by the ARN of the assessment target.
response = client.create_assessment_template(
assessmentTargetArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX',
assessmentTemplateName='ExampleAssessmentTemplate',
durationInSeconds=180,
rulesPackageArns=[
'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-11B9DBXp',
],
userAttributesForFindings=[
{
'key': 'Example',
'value': 'example',
},
],
)
print(response)
Expected Output:
{
'assessmentTemplateArn': 'arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T',
'ResponseMetadata': {
'...': '...',
},
}
create_resource_group(**kwargs)¶Creates a resource group using the specified set of tags (key and value pairs) that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. The created resource group is then used to create an Amazon Inspector assessment target. For more information, see CreateAssessmentTarget .
See also: AWS API Documentation
Request Syntax
response = client.create_resource_group(
resourceGroupTags=[
{
'key': 'string',
'value': 'string'
},
]
)
| Parameters: | resourceGroupTags (list) – [REQUIRED] A collection of keys and an array of possible values, ‘[{“key”:”key1”,”values”:[“Value1”,”Value2”]},{“key”:”Key2”,”values”:[“Value3”]}]’. For example,’[{“key”:”Name”,”values”:[“TestEC2Instance”]}]’.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'resourceGroupArn': 'string'
}
Response Structure
|
Examples
Creates a resource group using the specified set of tags (key and value pairs) that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. The created resource group is then used to create an Amazon Inspector assessment target.
response = client.create_resource_group(
resourceGroupTags=[
{
'key': 'Name',
'value': 'example',
},
],
)
print(response)
Expected Output:
{
'resourceGroupArn': 'arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv',
'ResponseMetadata': {
'...': '...',
},
}
delete_assessment_run(**kwargs)¶Deletes the assessment run that is specified by the ARN of the assessment run.
See also: AWS API Documentation
Request Syntax
response = client.delete_assessment_run(
assessmentRunArn='string'
)
| Parameters: | assessmentRunArn (string) – [REQUIRED] The ARN that specifies the assessment run that you want to delete. |
|---|---|
| Returns: | None |
Examples
Deletes the assessment run that is specified by the ARN of the assessment run.
response = client.delete_assessment_run(
assessmentRunArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_assessment_target(**kwargs)¶Deletes the assessment target that is specified by the ARN of the assessment target.
See also: AWS API Documentation
Request Syntax
response = client.delete_assessment_target(
assessmentTargetArn='string'
)
| Parameters: | assessmentTargetArn (string) – [REQUIRED] The ARN that specifies the assessment target that you want to delete. |
|---|---|
| Returns: | None |
Examples
Deletes the assessment target that is specified by the ARN of the assessment target.
response = client.delete_assessment_target(
assessmentTargetArn='arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
delete_assessment_template(**kwargs)¶Deletes the assessment template that is specified by the ARN of the assessment template.
See also: AWS API Documentation
Request Syntax
response = client.delete_assessment_template(
assessmentTemplateArn='string'
)
| Parameters: | assessmentTemplateArn (string) – [REQUIRED] The ARN that specifies the assessment template that you want to delete. |
|---|---|
| Returns: | None |
Examples
Deletes the assessment template that is specified by the ARN of the assessment template.
response = client.delete_assessment_template(
assessmentTemplateArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
describe_assessment_runs(**kwargs)¶Describes the assessment runs that are specified by the ARNs of the assessment runs.
See also: AWS API Documentation
Request Syntax
response = client.describe_assessment_runs(
assessmentRunArns=[
'string',
]
)
| Parameters: | assessmentRunArns (list) – [REQUIRED] The ARN that specifies the assessment run that you want to describe.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'assessmentRuns': [
{
'arn': 'string',
'name': 'string',
'assessmentTemplateArn': 'string',
'state': 'CREATED'|'START_DATA_COLLECTION_PENDING'|'START_DATA_COLLECTION_IN_PROGRESS'|'COLLECTING_DATA'|'STOP_DATA_COLLECTION_PENDING'|'DATA_COLLECTED'|'START_EVALUATING_RULES_PENDING'|'EVALUATING_RULES'|'FAILED'|'ERROR'|'COMPLETED'|'COMPLETED_WITH_ERRORS'|'CANCELED',
'durationInSeconds': 123,
'rulesPackageArns': [
'string',
],
'userAttributesForFindings': [
{
'key': 'string',
'value': 'string'
},
],
'createdAt': datetime(2015, 1, 1),
'startedAt': datetime(2015, 1, 1),
'completedAt': datetime(2015, 1, 1),
'stateChangedAt': datetime(2015, 1, 1),
'dataCollected': True|False,
'stateChanges': [
{
'stateChangedAt': datetime(2015, 1, 1),
'state': 'CREATED'|'START_DATA_COLLECTION_PENDING'|'START_DATA_COLLECTION_IN_PROGRESS'|'COLLECTING_DATA'|'STOP_DATA_COLLECTION_PENDING'|'DATA_COLLECTED'|'START_EVALUATING_RULES_PENDING'|'EVALUATING_RULES'|'FAILED'|'ERROR'|'COMPLETED'|'COMPLETED_WITH_ERRORS'|'CANCELED'
},
],
'notifications': [
{
'date': datetime(2015, 1, 1),
'event': 'ASSESSMENT_RUN_STARTED'|'ASSESSMENT_RUN_COMPLETED'|'ASSESSMENT_RUN_STATE_CHANGED'|'FINDING_REPORTED'|'OTHER',
'message': 'string',
'error': True|False,
'snsTopicArn': 'string',
'snsPublishStatusCode': 'SUCCESS'|'TOPIC_DOES_NOT_EXIST'|'ACCESS_DENIED'|'INTERNAL_ERROR'
},
],
'findingCounts': {
'string': 123
}
},
],
'failedItems': {
'string': {
'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
'retryable': True|False
}
}
}
Response Structure
|
Examples
Describes the assessment runs that are specified by the ARNs of the assessment runs.
response = client.describe_assessment_runs(
assessmentRunArns=[
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE',
],
)
print(response)
Expected Output:
{
'assessmentRuns': [
{
'name': 'Run 1 for ExampleAssessmentTemplate',
'arn': 'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE',
'assessmentTemplateArn': 'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw',
'completedAt': datetime(2016, 3, 22, 20, 58, 21, 1, 82, 0),
'createdAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
'dataCollected': True,
'durationInSeconds': 3600,
'notifications': [
],
'rulesPackageArns': [
'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP',
],
'startedAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
'state': 'COMPLETED',
'stateChangedAt': datetime(2016, 3, 22, 20, 58, 21, 1, 82, 0),
'stateChanges': [
{
'state': 'CREATED',
'stateChangedAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
},
{
'state': 'START_DATA_COLLECTION_PENDING',
'stateChangedAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
},
{
'state': 'START_DATA_COLLECTION_IN_PROGRESS',
'stateChangedAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
},
{
'state': 'COLLECTING_DATA',
'stateChangedAt': datetime(2016, 3, 22, 20, 56, 10, 1, 82, 0),
},
{
'state': 'STOP_DATA_COLLECTION_PENDING',
'stateChangedAt': datetime(2016, 3, 22, 20, 57, 19, 1, 82, 0),
},
{
'state': 'DATA_COLLECTED',
'stateChangedAt': datetime(2016, 3, 22, 20, 58, 19, 1, 82, 0),
},
{
'state': 'EVALUATING_RULES',
'stateChangedAt': datetime(2016, 3, 22, 20, 58, 20, 1, 82, 0),
},
{
'state': 'COMPLETED',
'stateChangedAt': datetime(2016, 3, 22, 20, 58, 21, 1, 82, 0),
},
],
'userAttributesForFindings': [
],
},
],
'failedItems': {
},
'ResponseMetadata': {
'...': '...',
},
}
describe_assessment_targets(**kwargs)¶Describes the assessment targets that are specified by the ARNs of the assessment targets.
See also: AWS API Documentation
Request Syntax
response = client.describe_assessment_targets(
assessmentTargetArns=[
'string',
]
)
| Parameters: | assessmentTargetArns (list) – [REQUIRED] The ARNs that specifies the assessment targets that you want to describe.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'assessmentTargets': [
{
'arn': 'string',
'name': 'string',
'resourceGroupArn': 'string',
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1)
},
],
'failedItems': {
'string': {
'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
'retryable': True|False
}
}
}
Response Structure
|
Examples
Describes the assessment targets that are specified by the ARNs of the assessment targets.
response = client.describe_assessment_targets(
assessmentTargetArns=[
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq',
],
)
print(response)
Expected Output:
{
'assessmentTargets': [
{
'name': 'ExampleAssessmentTarget',
'arn': 'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq',
'createdAt': datetime(2016, 3, 15, 20, 36, 31, 1, 75, 0),
'resourceGroupArn': 'arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI',
'updatedAt': datetime(2016, 3, 15, 20, 36, 31, 1, 75, 0),
},
],
'failedItems': {
},
'ResponseMetadata': {
'...': '...',
},
}
describe_assessment_templates(**kwargs)¶Describes the assessment templates that are specified by the ARNs of the assessment templates.
See also: AWS API Documentation
Request Syntax
response = client.describe_assessment_templates(
assessmentTemplateArns=[
'string',
]
)
| Parameters: | assessmentTemplateArns (list) – [REQUIRED]
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'assessmentTemplates': [
{
'arn': 'string',
'name': 'string',
'assessmentTargetArn': 'string',
'durationInSeconds': 123,
'rulesPackageArns': [
'string',
],
'userAttributesForFindings': [
{
'key': 'string',
'value': 'string'
},
],
'createdAt': datetime(2015, 1, 1)
},
],
'failedItems': {
'string': {
'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
'retryable': True|False
}
}
}
Response Structure
|
Examples
Describes the assessment templates that are specified by the ARNs of the assessment templates.
response = client.describe_assessment_templates(
assessmentTemplateArns=[
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw',
],
)
print(response)
Expected Output:
{
'assessmentTemplates': [
{
'name': 'ExampleAssessmentTemplate',
'arn': 'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw',
'assessmentTargetArn': 'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq',
'createdAt': datetime(2016, 3, 15, 20, 36, 31, 1, 75, 0),
'durationInSeconds': 3600,
'rulesPackageArns': [
'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP',
],
'userAttributesForFindings': [
],
},
],
'failedItems': {
},
'ResponseMetadata': {
'...': '...',
},
}
describe_cross_account_access_role()¶Describes the IAM role that enables Amazon Inspector to access your AWS account.
See also: AWS API Documentation
Request Syntax
response = client.describe_cross_account_access_role()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'roleArn': 'string',
'valid': True|False,
'registeredAt': datetime(2015, 1, 1)
}
Response Structure
|
Examples
Describes the IAM role that enables Amazon Inspector to access your AWS account.
response = client.describe_cross_account_access_role(
)
print(response)
Expected Output:
{
'registeredAt': datetime(2016, 3, 15, 19, 13, 2, 1, 75, 0),
'roleArn': 'arn:aws:iam::123456789012:role/inspector',
'valid': True,
'ResponseMetadata': {
'...': '...',
},
}
describe_findings(**kwargs)¶Describes the findings that are specified by the ARNs of the findings.
See also: AWS API Documentation
Request Syntax
response = client.describe_findings(
findingArns=[
'string',
],
locale='EN_US'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'findings': [
{
'arn': 'string',
'schemaVersion': 123,
'service': 'string',
'serviceAttributes': {
'schemaVersion': 123,
'assessmentRunArn': 'string',
'rulesPackageArn': 'string'
},
'assetType': 'ec2-instance',
'assetAttributes': {
'schemaVersion': 123,
'agentId': 'string',
'autoScalingGroup': 'string',
'amiId': 'string',
'hostname': 'string',
'ipv4Addresses': [
'string',
]
},
'id': 'string',
'title': 'string',
'description': 'string',
'recommendation': 'string',
'severity': 'Low'|'Medium'|'High'|'Informational'|'Undefined',
'numericSeverity': 123.0,
'confidence': 123,
'indicatorOfCompromise': True|False,
'attributes': [
{
'key': 'string',
'value': 'string'
},
],
'userAttributes': [
{
'key': 'string',
'value': 'string'
},
],
'createdAt': datetime(2015, 1, 1),
'updatedAt': datetime(2015, 1, 1)
},
],
'failedItems': {
'string': {
'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
'retryable': True|False
}
}
}
Response Structure
|
Examples
Describes the findings that are specified by the ARNs of the findings.
response = client.describe_findings(
findingArns=[
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4',
],
)
print(response)
Expected Output:
{
'failedItems': {
},
'findings': [
{
'arn': 'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4',
'assetAttributes': {
'ipv4Addresses': [
],
'schemaVersion': 1,
},
'assetType': 'ec2-instance',
'attributes': [
],
'confidence': 10,
'createdAt': datetime(2016, 3, 22, 20, 58, 21, 1, 82, 0),
'description': 'Amazon Inspector did not find any potential security issues during this assessment.',
'indicatorOfCompromise': False,
'numericSeverity': 0,
'recommendation': 'No remediation needed.',
'schemaVersion': 1,
'service': 'Inspector',
'serviceAttributes': {
'assessmentRunArn': 'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE',
'rulesPackageArn': 'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP',
'schemaVersion': 1,
},
'severity': 'Informational',
'title': 'No potential security issues found',
'updatedAt': datetime(2016, 3, 22, 20, 58, 21, 1, 82, 0),
'userAttributes': [
],
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_resource_groups(**kwargs)¶Describes the resource groups that are specified by the ARNs of the resource groups.
See also: AWS API Documentation
Request Syntax
response = client.describe_resource_groups(
resourceGroupArns=[
'string',
]
)
| Parameters: | resourceGroupArns (list) – [REQUIRED] The ARN that specifies the resource group that you want to describe.
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'resourceGroups': [
{
'arn': 'string',
'tags': [
{
'key': 'string',
'value': 'string'
},
],
'createdAt': datetime(2015, 1, 1)
},
],
'failedItems': {
'string': {
'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
'retryable': True|False
}
}
}
Response Structure
|
Examples
Describes the resource groups that are specified by the ARNs of the resource groups.
response = client.describe_resource_groups(
resourceGroupArns=[
'arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI',
],
)
print(response)
Expected Output:
{
'failedItems': {
},
'resourceGroups': [
{
'arn': 'arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI',
'createdAt': datetime(2016, 3, 15, 20, 36, 31, 1, 75, 0),
'tags': [
{
'key': 'Name',
'value': 'example',
},
],
},
],
'ResponseMetadata': {
'...': '...',
},
}
describe_rules_packages(**kwargs)¶Describes the rules packages that are specified by the ARNs of the rules packages.
See also: AWS API Documentation
Request Syntax
response = client.describe_rules_packages(
rulesPackageArns=[
'string',
],
locale='EN_US'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'rulesPackages': [
{
'arn': 'string',
'name': 'string',
'version': 'string',
'provider': 'string',
'description': 'string'
},
],
'failedItems': {
'string': {
'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
'retryable': True|False
}
}
}
Response Structure
|
Examples
Describes the rules packages that are specified by the ARNs of the rules packages.
response = client.describe_rules_packages(
rulesPackageArns=[
'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ',
],
)
print(response)
Expected Output:
{
'failedItems': {
},
'rulesPackages': [
{
'version': '1.1',
'name': 'Security Best Practices',
'arn': 'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ',
'description': 'The rules in this package help determine whether your systems are configured securely.',
'provider': 'Amazon Web Services, Inc.',
},
],
'ResponseMetadata': {
'...': '...',
},
}
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_assessment_report(**kwargs)¶Produces an assessment report that includes detailed and comprehensive results of a specified assessment run.
See also: AWS API Documentation
Request Syntax
response = client.get_assessment_report(
assessmentRunArn='string',
reportFileFormat='HTML'|'PDF',
reportType='FINDING'|'FULL'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'status': 'WORK_IN_PROGRESS'|'FAILED'|'COMPLETED',
'url': 'string'
}
Response Structure
|
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_telemetry_metadata(**kwargs)¶Information about the data that is collected for the specified assessment run.
See also: AWS API Documentation
Request Syntax
response = client.get_telemetry_metadata(
assessmentRunArn='string'
)
| Parameters: | assessmentRunArn (string) – [REQUIRED] The ARN that specifies the assessment run that has the telemetry data that you want to obtain. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'telemetryMetadata': [
{
'messageType': 'string',
'count': 123,
'dataSize': 123
},
]
}
Response Structure
|
Examples
Information about the data that is collected for the specified assessment run.
response = client.get_telemetry_metadata(
assessmentRunArn='arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE',
)
print(response)
Expected Output:
{
'telemetryMetadata': [
{
'count': 2,
'dataSize': 345,
'messageType': 'InspectorDuplicateProcess',
},
{
'count': 3,
'dataSize': 255,
'messageType': 'InspectorTimeEventMsg',
},
{
'count': 4,
'dataSize': 1082,
'messageType': 'InspectorNetworkInterface',
},
{
'count': 2,
'dataSize': 349,
'messageType': 'InspectorDnsEntry',
},
{
'count': 11,
'dataSize': 2514,
'messageType': 'InspectorDirectoryInfoMsg',
},
{
'count': 1,
'dataSize': 179,
'messageType': 'InspectorTcpV6ListeningPort',
},
{
'count': 101,
'dataSize': 10949,
'messageType': 'InspectorTerminal',
},
{
'count': 26,
'dataSize': 5916,
'messageType': 'InspectorUser',
},
{
'count': 282,
'dataSize': 32148,
'messageType': 'InspectorDynamicallyLoadedCodeModule',
},
{
'count': 18,
'dataSize': 10172,
'messageType': 'InspectorCreateProcess',
},
{
'count': 3,
'dataSize': 8001,
'messageType': 'InspectorProcessPerformance',
},
{
'count': 1,
'dataSize': 360,
'messageType': 'InspectorOperatingSystem',
},
{
'count': 6,
'dataSize': 546,
'messageType': 'InspectorStopProcess',
},
{
'count': 1,
'dataSize': 1553,
'messageType': 'InspectorInstanceMetaData',
},
{
'count': 2,
'dataSize': 434,
'messageType': 'InspectorTcpV4Connection',
},
{
'count': 474,
'dataSize': 2960322,
'messageType': 'InspectorPackageInfo',
},
{
'count': 3,
'dataSize': 2235,
'messageType': 'InspectorSystemPerformance',
},
{
'count': 105,
'dataSize': 46048,
'messageType': 'InspectorCodeModule',
},
{
'count': 1,
'dataSize': 182,
'messageType': 'InspectorUdpV6ListeningPort',
},
{
'count': 2,
'dataSize': 371,
'messageType': 'InspectorUdpV4ListeningPort',
},
{
'count': 18,
'dataSize': 8362,
'messageType': 'InspectorKernelModule',
},
{
'count': 29,
'dataSize': 48788,
'messageType': 'InspectorConfigurationInfo',
},
{
'count': 1,
'dataSize': 79,
'messageType': 'InspectorMonitoringStart',
},
{
'count': 5,
'dataSize': 0,
'messageType': 'InspectorSplitMsgBegin',
},
{
'count': 51,
'dataSize': 4593,
'messageType': 'InspectorGroup',
},
{
'count': 1,
'dataSize': 184,
'messageType': 'InspectorTcpV4ListeningPort',
},
{
'count': 1159,
'dataSize': 3146579,
'messageType': 'Total',
},
{
'count': 5,
'dataSize': 0,
'messageType': 'InspectorSplitMsgEnd',
},
{
'count': 1,
'dataSize': 612,
'messageType': 'InspectorLoadImageInProcess',
},
],
'ResponseMetadata': {
'...': '...',
},
}
get_waiter(waiter_name)¶list_assessment_run_agents(**kwargs)¶Lists the agents of the assessment runs that are specified by the ARNs of the assessment runs.
See also: AWS API Documentation
Request Syntax
response = client.list_assessment_run_agents(
assessmentRunArn='string',
filter={
'agentHealths': [
'HEALTHY'|'UNHEALTHY',
],
'agentHealthCodes': [
'IDLE'|'RUNNING'|'SHUTDOWN'|'UNHEALTHY'|'THROTTLED'|'UNKNOWN',
]
},
nextToken='string',
maxResults=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'assessmentRunAgents': [
{
'agentId': 'string',
'assessmentRunArn': 'string',
'agentHealth': 'HEALTHY'|'UNHEALTHY',
'agentHealthCode': 'IDLE'|'RUNNING'|'SHUTDOWN'|'UNHEALTHY'|'THROTTLED'|'UNKNOWN',
'agentHealthDetails': 'string',
'autoScalingGroup': 'string',
'telemetryMetadata': [
{
'messageType': 'string',
'count': 123,
'dataSize': 123
},
]
},
],
'nextToken': 'string'
}
Response Structure
|
Examples
Lists the agents of the assessment runs that are specified by the ARNs of the assessment runs.
response = client.list_assessment_run_agents(
assessmentRunArn='arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE',
maxResults=123,
)
print(response)
Expected Output:
{
'assessmentRunAgents': [
{
'agentHealth': 'HEALTHY',
'agentHealthCode': 'RUNNING',
'agentId': 'i-49113b93',
'assessmentRunArn': 'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE',
'telemetryMetadata': [
{
'count': 2,
'dataSize': 345,
'messageType': 'InspectorDuplicateProcess',
},
{
'count': 3,
'dataSize': 255,
'messageType': 'InspectorTimeEventMsg',
},
{
'count': 4,
'dataSize': 1082,
'messageType': 'InspectorNetworkInterface',
},
{
'count': 2,
'dataSize': 349,
'messageType': 'InspectorDnsEntry',
},
{
'count': 11,
'dataSize': 2514,
'messageType': 'InspectorDirectoryInfoMsg',
},
{
'count': 1,
'dataSize': 179,
'messageType': 'InspectorTcpV6ListeningPort',
},
{
'count': 101,
'dataSize': 10949,
'messageType': 'InspectorTerminal',
},
{
'count': 26,
'dataSize': 5916,
'messageType': 'InspectorUser',
},
{
'count': 282,
'dataSize': 32148,
'messageType': 'InspectorDynamicallyLoadedCodeModule',
},
{
'count': 18,
'dataSize': 10172,
'messageType': 'InspectorCreateProcess',
},
{
'count': 3,
'dataSize': 8001,
'messageType': 'InspectorProcessPerformance',
},
{
'count': 1,
'dataSize': 360,
'messageType': 'InspectorOperatingSystem',
},
{
'count': 6,
'dataSize': 546,
'messageType': 'InspectorStopProcess',
},
{
'count': 1,
'dataSize': 1553,
'messageType': 'InspectorInstanceMetaData',
},
{
'count': 2,
'dataSize': 434,
'messageType': 'InspectorTcpV4Connection',
},
{
'count': 474,
'dataSize': 2960322,
'messageType': 'InspectorPackageInfo',
},
{
'count': 3,
'dataSize': 2235,
'messageType': 'InspectorSystemPerformance',
},
{
'count': 105,
'dataSize': 46048,
'messageType': 'InspectorCodeModule',
},
{
'count': 1,
'dataSize': 182,
'messageType': 'InspectorUdpV6ListeningPort',
},
{
'count': 2,
'dataSize': 371,
'messageType': 'InspectorUdpV4ListeningPort',
},
{
'count': 18,
'dataSize': 8362,
'messageType': 'InspectorKernelModule',
},
{
'count': 29,
'dataSize': 48788,
'messageType': 'InspectorConfigurationInfo',
},
{
'count': 1,
'dataSize': 79,
'messageType': 'InspectorMonitoringStart',
},
{
'count': 5,
'dataSize': 0,
'messageType': 'InspectorSplitMsgBegin',
},
{
'count': 51,
'dataSize': 4593,
'messageType': 'InspectorGroup',
},
{
'count': 1,
'dataSize': 184,
'messageType': 'InspectorTcpV4ListeningPort',
},
{
'count': 1159,
'dataSize': 3146579,
'messageType': 'Total',
},
{
'count': 5,
'dataSize': 0,
'messageType': 'InspectorSplitMsgEnd',
},
{
'count': 1,
'dataSize': 612,
'messageType': 'InspectorLoadImageInProcess',
},
],
},
],
'nextToken': '1',
'ResponseMetadata': {
'...': '...',
},
}
list_assessment_runs(**kwargs)¶Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the assessment templates.
See also: AWS API Documentation
Request Syntax
response = client.list_assessment_runs(
assessmentTemplateArns=[
'string',
],
filter={
'namePattern': 'string',
'states': [
'CREATED'|'START_DATA_COLLECTION_PENDING'|'START_DATA_COLLECTION_IN_PROGRESS'|'COLLECTING_DATA'|'STOP_DATA_COLLECTION_PENDING'|'DATA_COLLECTED'|'START_EVALUATING_RULES_PENDING'|'EVALUATING_RULES'|'FAILED'|'ERROR'|'COMPLETED'|'COMPLETED_WITH_ERRORS'|'CANCELED',
],
'durationRange': {
'minSeconds': 123,
'maxSeconds': 123
},
'rulesPackageArns': [
'string',
],
'startTimeRange': {
'beginDate': datetime(2015, 1, 1),
'endDate': datetime(2015, 1, 1)
},
'completionTimeRange': {
'beginDate': datetime(2015, 1, 1),
'endDate': datetime(2015, 1, 1)
},
'stateChangeTimeRange': {
'beginDate': datetime(2015, 1, 1),
'endDate': datetime(2015, 1, 1)
}
},
nextToken='string',
maxResults=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'assessmentRunArns': [
'string',
],
'nextToken': 'string'
}
Response Structure
|
Examples
Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the assessment templates.
response = client.list_assessment_runs(
assessmentTemplateArns=[
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw',
],
maxResults=123,
)
print(response)
Expected Output:
{
'assessmentRunArns': [
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE',
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-v5D6fI3v',
],
'nextToken': '1',
'ResponseMetadata': {
'...': '...',
},
}
list_assessment_targets(**kwargs)¶Lists the ARNs of the assessment targets within this AWS account. For more information about assessment targets, see Amazon Inspector Assessment Targets .
See also: AWS API Documentation
Request Syntax
response = client.list_assessment_targets(
filter={
'assessmentTargetNamePattern': 'string'
},
nextToken='string',
maxResults=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'assessmentTargetArns': [
'string',
],
'nextToken': 'string'
}
Response Structure
|
Examples
Lists the ARNs of the assessment targets within this AWS account.
response = client.list_assessment_targets(
maxResults=123,
)
print(response)
Expected Output:
{
'assessmentTargetArns': [
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq',
],
'nextToken': '1',
'ResponseMetadata': {
'...': '...',
},
}
list_assessment_templates(**kwargs)¶Lists the assessment templates that correspond to the assessment targets that are specified by the ARNs of the assessment targets.
See also: AWS API Documentation
Request Syntax
response = client.list_assessment_templates(
assessmentTargetArns=[
'string',
],
filter={
'namePattern': 'string',
'durationRange': {
'minSeconds': 123,
'maxSeconds': 123
},
'rulesPackageArns': [
'string',
]
},
nextToken='string',
maxResults=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'assessmentTemplateArns': [
'string',
],
'nextToken': 'string'
}
Response Structure
|
Examples
Lists the assessment templates that correspond to the assessment targets that are specified by the ARNs of the assessment targets.
response = client.list_assessment_templates(
assessmentTargetArns=[
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq',
],
maxResults=123,
)
print(response)
Expected Output:
{
'assessmentTemplateArns': [
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw',
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-Uza6ihLh',
],
'nextToken': '1',
'ResponseMetadata': {
'...': '...',
},
}
list_event_subscriptions(**kwargs)¶Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment template. For more information, see SubscribeToEvent and UnsubscribeFromEvent .
See also: AWS API Documentation
Request Syntax
response = client.list_event_subscriptions(
resourceArn='string',
nextToken='string',
maxResults=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'subscriptions': [
{
'resourceArn': 'string',
'topicArn': 'string',
'eventSubscriptions': [
{
'event': 'ASSESSMENT_RUN_STARTED'|'ASSESSMENT_RUN_COMPLETED'|'ASSESSMENT_RUN_STATE_CHANGED'|'FINDING_REPORTED'|'OTHER',
'subscribedAt': datetime(2015, 1, 1)
},
]
},
],
'nextToken': 'string'
}
Response Structure
|
Examples
Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment template.
response = client.list_event_subscriptions(
maxResults=123,
resourceArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0',
)
print(response)
Expected Output:
{
'nextToken': '1',
'subscriptions': [
{
'eventSubscriptions': [
{
'event': 'ASSESSMENT_RUN_COMPLETED',
'subscribedAt': datetime(2016, 3, 31, 20, 17, 20, 3, 91, 0),
},
],
'resourceArn': 'arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0',
'topicArn': 'arn:aws:sns:us-west-2:123456789012:exampletopic',
},
],
'ResponseMetadata': {
'...': '...',
},
}
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: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'findingArns': [
'string',
],
'nextToken': 'string'
}
Response Structure
|
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': {
'...': '...',
},
}
list_rules_packages(**kwargs)¶Lists all available Amazon Inspector rules packages.
See also: AWS API Documentation
Request Syntax
response = client.list_rules_packages(
nextToken='string',
maxResults=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'rulesPackageArns': [
'string',
],
'nextToken': 'string'
}
Response Structure
|
Examples
Lists all available Amazon Inspector rules packages.
response = client.list_rules_packages(
maxResults=123,
)
print(response)
Expected Output:
{
'nextToken': '1',
'rulesPackageArns': [
'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p',
'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-H5hpSawc',
'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ',
'arn:aws:inspector:us-west-2:758058086616:rulespackage/0-vg5GGHSD',
],
'ResponseMetadata': {
'...': '...',
},
}
Lists all tags associated with an assessment template.
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
resourceArn='string'
)
| Parameters: | resourceArn (string) – [REQUIRED] The ARN that specifies the assessment template whose tags you want to list. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'tags': [
{
'key': 'string',
'value': 'string'
},
]
}
Response Structure
|
Examples
Lists all tags associated with an assessment template.
response = client.list_tags_for_resource(
resourceArn='arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-gcwFliYu',
)
print(response)
Expected Output:
{
'tags': [
{
'key': 'Name',
'value': 'Example',
},
],
'ResponseMetadata': {
'...': '...',
},
}
preview_agents(**kwargs)¶Previews the agents installed on the EC2 instances that are part of the specified assessment target.
See also: AWS API Documentation
Request Syntax
response = client.preview_agents(
previewAgentsArn='string',
nextToken='string',
maxResults=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'agentPreviews': [
{
'agentId': 'string',
'autoScalingGroup': 'string'
},
],
'nextToken': 'string'
}
Response Structure
|
Examples
Previews the agents installed on the EC2 instances that are part of the specified assessment target.
response = client.preview_agents(
maxResults=123,
previewAgentsArn='arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq',
)
print(response)
Expected Output:
{
'agentPreviews': [
{
'agentId': 'i-49113b93',
},
],
'nextToken': '1',
'ResponseMetadata': {
'...': '...',
},
}
register_cross_account_access_role(**kwargs)¶Registers the IAM role that Amazon Inspector uses to list your EC2 instances at the start of the assessment run or when you call the PreviewAgents action.
See also: AWS API Documentation
Request Syntax
response = client.register_cross_account_access_role(
roleArn='string'
)
| Parameters: | roleArn (string) – [REQUIRED] The ARN of the IAM role that Amazon Inspector uses to list your EC2 instances during the assessment run or when you call the PreviewAgents action. |
|---|---|
| Returns: | None |
Examples
Registers the IAM role that Amazon Inspector uses to list your EC2 instances at the start of the assessment run or when you call the PreviewAgents action.
response = client.register_cross_account_access_role(
roleArn='arn:aws:iam::123456789012:role/inspector',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
remove_attributes_from_findings(**kwargs)¶Removes entire attributes (key and value pairs) from the findings that are specified by the ARNs of the findings where an attribute with the specified key exists.
See also: AWS API Documentation
Request Syntax
response = client.remove_attributes_from_findings(
findingArns=[
'string',
],
attributeKeys=[
'string',
]
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'failedItems': {
'string': {
'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
'retryable': True|False
}
}
}
Response Structure
|
Examples
Removes entire attributes (key and value pairs) from the findings that are specified by the ARNs of the findings where an attribute with the specified key exists.
response = client.remove_attributes_from_findings(
attributeKeys=[
'key=Example,value=example',
],
findingArns=[
'arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU',
],
)
print(response)
Expected Output:
{
'failedItems': {
},
'ResponseMetadata': {
'...': '...',
},
}
Sets tags (key and value pairs) to the assessment template that is specified by the ARN of the assessment template.
See also: AWS API Documentation
Request Syntax
response = client.set_tags_for_resource(
resourceArn='string',
tags=[
{
'key': 'string',
'value': 'string'
},
]
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
Sets tags (key and value pairs) to the assessment template that is specified by the ARN of the assessment template.
response = client.set_tags_for_resource(
resourceArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0',
tags=[
{
'key': 'Example',
'value': 'example',
},
],
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
start_assessment_run(**kwargs)¶Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you must not exceed the limit of running up to 500 concurrent agents per AWS account.
See also: AWS API Documentation
Request Syntax
response = client.start_assessment_run(
assessmentTemplateArn='string',
assessmentRunName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'assessmentRunArn': 'string'
}
Response Structure
|
Examples
Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you must not exceed the limit of running up to 500 concurrent agents per AWS account.
response = client.start_assessment_run(
assessmentRunName='examplerun',
assessmentTemplateArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T',
)
print(response)
Expected Output:
{
'assessmentRunArn': 'arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-jOoroxyY',
'ResponseMetadata': {
'...': '...',
},
}
stop_assessment_run(**kwargs)¶Stops the assessment run that is specified by the ARN of the assessment run.
See also: AWS API Documentation
Request Syntax
response = client.stop_assessment_run(
assessmentRunArn='string',
stopAction='START_EVALUATION'|'SKIP_EVALUATION'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
Stops the assessment run that is specified by the ARN of the assessment run.
response = client.stop_assessment_run(
assessmentRunArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
subscribe_to_event(**kwargs)¶Enables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.
See also: AWS API Documentation
Request Syntax
response = client.subscribe_to_event(
resourceArn='string',
event='ASSESSMENT_RUN_STARTED'|'ASSESSMENT_RUN_COMPLETED'|'ASSESSMENT_RUN_STATE_CHANGED'|'FINDING_REPORTED'|'OTHER',
topicArn='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
Enables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.
response = client.subscribe_to_event(
event='ASSESSMENT_RUN_COMPLETED',
resourceArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0',
topicArn='arn:aws:sns:us-west-2:123456789012:exampletopic',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
unsubscribe_from_event(**kwargs)¶Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.
See also: AWS API Documentation
Request Syntax
response = client.unsubscribe_from_event(
resourceArn='string',
event='ASSESSMENT_RUN_STARTED'|'ASSESSMENT_RUN_COMPLETED'|'ASSESSMENT_RUN_STATE_CHANGED'|'FINDING_REPORTED'|'OTHER',
topicArn='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.
response = client.unsubscribe_from_event(
event='ASSESSMENT_RUN_COMPLETED',
resourceArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0',
topicArn='arn:aws:sns:us-west-2:123456789012:exampletopic',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
update_assessment_target(**kwargs)¶Updates the assessment target that is specified by the ARN of the assessment target.
See also: AWS API Documentation
Request Syntax
response = client.update_assessment_target(
assessmentTargetArn='string',
assessmentTargetName='string',
resourceGroupArn='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
Examples
Updates the assessment target that is specified by the ARN of the assessment target.
response = client.update_assessment_target(
assessmentTargetArn='arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX',
assessmentTargetName='Example',
resourceGroupArn='arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-yNbgL5Pt',
)
print(response)
Expected Output:
{
'ResponseMetadata': {
'...': '...',
},
}
The available paginators are: