Table of Contents
A low-level client representing Access Analyzer
Identity and Access Management Access Analyzer helps identify potential resource-access risks by enabling you to identify any policies that grant access to an external principal. It does this by using logic-based reasoning to analyze resource-based policies in your Amazon Web Services environment. An external principal can be another Amazon Web Services account, a root user, an IAM user or role, a federated user, an Amazon Web Services service, or an anonymous user. You can also use IAM Access Analyzer to preview and validate public and cross-account access to your resources before deploying permissions changes. This guide describes the Identity and Access Management Access Analyzer operations that you can call programmatically. For general information about IAM Access Analyzer, see Identity and Access Management Access Analyzer in the IAM User Guide .
To start using IAM Access Analyzer, you first need to create an analyzer.
import boto3
client = boto3.client('accessanalyzer')
These are the available methods:
Retroactively applies the archive rule to existing findings that meet the archive rule criteria.
See also: AWS API Documentation
Request Syntax
response = client.apply_archive_rule(
analyzerArn='string',
clientToken='string',
ruleName='string'
)
[REQUIRED]
The Amazon resource name (ARN) of the analyzer.
A client token.
This field is autopopulated if not provided.
[REQUIRED]
The name of the rule to apply.
None
Exceptions
Check if an operation can be paginated.
Cancels the requested policy generation.
See also: AWS API Documentation
Request Syntax
response = client.cancel_policy_generation(
jobId='string'
)
[REQUIRED]
The JobId that is returned by the StartPolicyGeneration operation. The JobId can be used with GetGeneratedPolicy to retrieve the generated policies or used with CancelPolicyGeneration to cancel the policy generation request.
{}
Response Structure
Exceptions
Creates an access preview that allows you to preview IAM Access Analyzer findings for your resource before deploying resource permissions.
See also: AWS API Documentation
Request Syntax
response = client.create_access_preview(
analyzerArn='string',
clientToken='string',
configurations={
'string': {
'iamRole': {
'trustPolicy': 'string'
},
'kmsKey': {
'grants': [
{
'constraints': {
'encryptionContextEquals': {
'string': 'string'
},
'encryptionContextSubset': {
'string': 'string'
}
},
'granteePrincipal': 'string',
'issuingAccount': 'string',
'operations': [
'CreateGrant'|'Decrypt'|'DescribeKey'|'Encrypt'|'GenerateDataKey'|'GenerateDataKeyPair'|'GenerateDataKeyPairWithoutPlaintext'|'GenerateDataKeyWithoutPlaintext'|'GetPublicKey'|'ReEncryptFrom'|'ReEncryptTo'|'RetireGrant'|'Sign'|'Verify',
],
'retiringPrincipal': 'string'
},
],
'keyPolicies': {
'string': 'string'
}
},
's3Bucket': {
'accessPoints': {
'string': {
'accessPointPolicy': 'string',
'networkOrigin': {
'internetConfiguration': {}
,
'vpcConfiguration': {
'vpcId': 'string'
}
},
'publicAccessBlock': {
'ignorePublicAcls': True|False,
'restrictPublicBuckets': True|False
}
}
},
'bucketAclGrants': [
{
'grantee': {
'id': 'string',
'uri': 'string'
},
'permission': 'READ'|'WRITE'|'READ_ACP'|'WRITE_ACP'|'FULL_CONTROL'
},
],
'bucketPolicy': 'string',
'bucketPublicAccessBlock': {
'ignorePublicAcls': True|False,
'restrictPublicBuckets': True|False
}
},
'secretsManagerSecret': {
'kmsKeyId': 'string',
'secretPolicy': 'string'
},
'sqsQueue': {
'queuePolicy': 'string'
}
}
}
)
[REQUIRED]
The ARN of the account analyzer used to generate the access preview. You can only create an access preview for analyzers with an Account type and Active status.
A client token.
This field is autopopulated if not provided.
[REQUIRED]
Access control configuration for your resource that is used to generate the access preview. The access preview includes findings for external access allowed to the resource with the proposed access control configuration. The configuration must contain exactly one element.
Access control configuration structures for your resource. You specify the configuration as a type-value pair. You can specify only one type of access control configuration.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: iamRole, kmsKey, s3Bucket, secretsManagerSecret, sqsQueue.
The access control configuration is for an IAM role.
The proposed trust policy for the IAM role.
The access control configuration is for a KMS key.
A list of proposed grant configurations for the KMS key. If the proposed grant configuration is for an existing key, the access preview uses the proposed list of grant configurations in place of the existing grants. Otherwise, the access preview uses the existing grants for the key.
A proposed grant configuration for a KMS key. For more information, see CreateGrant .
Use this structure to propose allowing cryptographic operations in the grant only when the operation request includes the specified encryption context .
A list of key-value pairs that must match the encryption context in the cryptographic operation request. The grant allows the operation only when the encryption context in the request is the same as the encryption context specified in this constraint.
A list of key-value pairs that must be included in the encryption context of the cryptographic operation request. The grant allows the cryptographic operation only when the encryption context in the request includes the key-value pairs specified in this constraint, although it can include additional key-value pairs.
The principal that is given permission to perform the operations that the grant permits.
The Amazon Web Services account under which the grant was issued. The account is used to propose KMS grants issued by accounts other than the owner of the key.
A list of operations that the grant permits.
The principal that is given permission to retire the grant by using RetireGrant operation.
Resource policy configuration for the KMS key. The only valid value for the name of the key policy is default . For more information, see Default key policy .
The access control configuration is for an Amazon S3 Bucket.
The configuration of Amazon S3 access points or multi-region access points for the bucket. You can propose up to 10 new access points per bucket.
The configuration for an Amazon S3 access point or multi-region access point for the bucket. You can propose up to 10 access points or multi-region access points per bucket. If the proposed Amazon S3 access point configuration is for an existing bucket, the access preview uses the proposed access point configuration in place of the existing access points. To propose an access point without a policy, you can provide an empty string as the access point policy. For more information, see Creating access points . For more information about access point policy limits, see Access points restrictions and limitations .
The access point or multi-region access point policy.
The proposed Internet and VpcConfiguration to apply to this Amazon S3 access point. VpcConfiguration does not apply to multi-region access points. If the access preview is for a new resource and neither is specified, the access preview uses Internet for the network origin. If the access preview is for an existing resource and neither is specified, the access preview uses the exiting network origin.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: internetConfiguration, vpcConfiguration.
The configuration for the Amazon S3 access point or multi-region access point with an Internet origin.
The proposed virtual private cloud (VPC) configuration for the Amazon S3 access point. VPC configuration does not apply to multi-region access points. For more information, see VpcConfiguration .
If this field is specified, this access point will only allow connections from the specified VPC ID.
The proposed S3PublicAccessBlock configuration to apply to this Amazon S3 access point or multi-region access point.
Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
The proposed list of ACL grants for the Amazon S3 bucket. You can propose up to 100 ACL grants per bucket. If the proposed grant configuration is for an existing bucket, the access preview uses the proposed list of grant configurations in place of the existing grants. Otherwise, the access preview uses the existing grants for the bucket.
A proposed access control list grant configuration for an Amazon S3 bucket. For more information, see How to Specify an ACL .
The grantee to whom you’re assigning access rights.
Note
This is a Tagged Union structure. Only one of the following top level keys can be set: id, uri.
The value specified is the canonical user ID of an Amazon Web Services account.
Used for granting permissions to a predefined group.
The permissions being granted.
The proposed bucket policy for the Amazon S3 bucket.
The proposed block public access configuration for the Amazon S3 bucket.
Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
The access control configuration is for a Secrets Manager secret.
The proposed ARN, key ID, or alias of the KMS customer master key (CMK).
The proposed resource policy defining who can access or manage the secret.
The access control configuration is for an Amazon SQS queue.
The proposed resource policy for the Amazon SQS queue.
dict
Response Syntax
{
'id': 'string'
}
Response Structure
(dict) --
id (string) --
The unique ID for the access preview.
Exceptions
Creates an analyzer for your account.
See also: AWS API Documentation
Request Syntax
response = client.create_analyzer(
analyzerName='string',
archiveRules=[
{
'filter': {
'string': {
'contains': [
'string',
],
'eq': [
'string',
],
'exists': True|False,
'neq': [
'string',
]
}
},
'ruleName': 'string'
},
],
clientToken='string',
tags={
'string': 'string'
},
type='ACCOUNT'|'ORGANIZATION'
)
[REQUIRED]
The name of the analyzer to create.
Specifies the archive rules to add for the analyzer. Archive rules automatically archive findings that meet the criteria you define for the rule.
An criterion statement in an archive rule. Each archive rule may have multiple criteria.
The condition and values for a criterion.
The criteria to use in the filter that defines the archive rule.
A "contains" operator to match for the filter used to create the rule.
An "equals" operator to match for the filter used to create the rule.
An "exists" operator to match for the filter used to create the rule.
A "not equals" operator to match for the filter used to create the rule.
The name of the rule.
A client token.
This field is autopopulated if not provided.
The tags to apply to the analyzer.
[REQUIRED]
The type of analyzer to create. Only ACCOUNT and ORGANIZATION analyzers are supported. You can create only one analyzer per account per Region. You can create up to 5 analyzers per organization per Region.
dict
Response Syntax
{
'arn': 'string'
}
Response Structure
(dict) --
The response to the request to create an analyzer.
arn (string) --
The ARN of the analyzer that was created by the request.
Exceptions
Creates an archive rule for the specified analyzer. Archive rules automatically archive new findings that meet the criteria you define when you create the rule.
To learn about filter keys that you can use to create an archive rule, see IAM Access Analyzer filter keys in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.create_archive_rule(
analyzerName='string',
clientToken='string',
filter={
'string': {
'contains': [
'string',
],
'eq': [
'string',
],
'exists': True|False,
'neq': [
'string',
]
}
},
ruleName='string'
)
[REQUIRED]
The name of the created analyzer.
A client token.
This field is autopopulated if not provided.
[REQUIRED]
The criteria for the rule.
The criteria to use in the filter that defines the archive rule.
A "contains" operator to match for the filter used to create the rule.
An "equals" operator to match for the filter used to create the rule.
An "exists" operator to match for the filter used to create the rule.
A "not equals" operator to match for the filter used to create the rule.
[REQUIRED]
The name of the rule to create.
None
Exceptions
Deletes the specified analyzer. When you delete an analyzer, IAM Access Analyzer is disabled for the account or organization in the current or specific Region. All findings that were generated by the analyzer are deleted. You cannot undo this action.
See also: AWS API Documentation
Request Syntax
response = client.delete_analyzer(
analyzerName='string',
clientToken='string'
)
[REQUIRED]
The name of the analyzer to delete.
A client token.
This field is autopopulated if not provided.
None
Exceptions
Deletes the specified archive rule.
See also: AWS API Documentation
Request Syntax
response = client.delete_archive_rule(
analyzerName='string',
clientToken='string',
ruleName='string'
)
[REQUIRED]
The name of the analyzer that associated with the archive rule to delete.
A client token.
This field is autopopulated if not provided.
[REQUIRED]
The name of the rule to delete.
None
Exceptions
Retrieves information about an access preview for the specified analyzer.
See also: AWS API Documentation
Request Syntax
response = client.get_access_preview(
accessPreviewId='string',
analyzerArn='string'
)
[REQUIRED]
The unique ID for the access preview.
[REQUIRED]
The ARN of the analyzer used to generate the access preview.
dict
Response Syntax
{
'accessPreview': {
'analyzerArn': 'string',
'configurations': {
'string': {
'iamRole': {
'trustPolicy': 'string'
},
'kmsKey': {
'grants': [
{
'constraints': {
'encryptionContextEquals': {
'string': 'string'
},
'encryptionContextSubset': {
'string': 'string'
}
},
'granteePrincipal': 'string',
'issuingAccount': 'string',
'operations': [
'CreateGrant'|'Decrypt'|'DescribeKey'|'Encrypt'|'GenerateDataKey'|'GenerateDataKeyPair'|'GenerateDataKeyPairWithoutPlaintext'|'GenerateDataKeyWithoutPlaintext'|'GetPublicKey'|'ReEncryptFrom'|'ReEncryptTo'|'RetireGrant'|'Sign'|'Verify',
],
'retiringPrincipal': 'string'
},
],
'keyPolicies': {
'string': 'string'
}
},
's3Bucket': {
'accessPoints': {
'string': {
'accessPointPolicy': 'string',
'networkOrigin': {
'internetConfiguration': {},
'vpcConfiguration': {
'vpcId': 'string'
}
},
'publicAccessBlock': {
'ignorePublicAcls': True|False,
'restrictPublicBuckets': True|False
}
}
},
'bucketAclGrants': [
{
'grantee': {
'id': 'string',
'uri': 'string'
},
'permission': 'READ'|'WRITE'|'READ_ACP'|'WRITE_ACP'|'FULL_CONTROL'
},
],
'bucketPolicy': 'string',
'bucketPublicAccessBlock': {
'ignorePublicAcls': True|False,
'restrictPublicBuckets': True|False
}
},
'secretsManagerSecret': {
'kmsKeyId': 'string',
'secretPolicy': 'string'
},
'sqsQueue': {
'queuePolicy': 'string'
}
}
},
'createdAt': datetime(2015, 1, 1),
'id': 'string',
'status': 'COMPLETED'|'CREATING'|'FAILED',
'statusReason': {
'code': 'INTERNAL_ERROR'|'INVALID_CONFIGURATION'
}
}
}
Response Structure
(dict) --
accessPreview (dict) --
An object that contains information about the access preview.
analyzerArn (string) --
The ARN of the analyzer used to generate the access preview.
configurations (dict) --
A map of resource ARNs for the proposed resource configuration.
(string) --
(dict) --
Access control configuration structures for your resource. You specify the configuration as a type-value pair. You can specify only one type of access control configuration.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: iamRole, kmsKey, s3Bucket, secretsManagerSecret, sqsQueue. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
iamRole (dict) --
The access control configuration is for an IAM role.
trustPolicy (string) --
The proposed trust policy for the IAM role.
kmsKey (dict) --
The access control configuration is for a KMS key.
grants (list) --
A list of proposed grant configurations for the KMS key. If the proposed grant configuration is for an existing key, the access preview uses the proposed list of grant configurations in place of the existing grants. Otherwise, the access preview uses the existing grants for the key.
(dict) --
A proposed grant configuration for a KMS key. For more information, see CreateGrant .
constraints (dict) --
Use this structure to propose allowing cryptographic operations in the grant only when the operation request includes the specified encryption context .
encryptionContextEquals (dict) --
A list of key-value pairs that must match the encryption context in the cryptographic operation request. The grant allows the operation only when the encryption context in the request is the same as the encryption context specified in this constraint.
encryptionContextSubset (dict) --
A list of key-value pairs that must be included in the encryption context of the cryptographic operation request. The grant allows the cryptographic operation only when the encryption context in the request includes the key-value pairs specified in this constraint, although it can include additional key-value pairs.
granteePrincipal (string) --
The principal that is given permission to perform the operations that the grant permits.
issuingAccount (string) --
The Amazon Web Services account under which the grant was issued. The account is used to propose KMS grants issued by accounts other than the owner of the key.
operations (list) --
A list of operations that the grant permits.
retiringPrincipal (string) --
The principal that is given permission to retire the grant by using RetireGrant operation.
keyPolicies (dict) --
Resource policy configuration for the KMS key. The only valid value for the name of the key policy is default . For more information, see Default key policy .
s3Bucket (dict) --
The access control configuration is for an Amazon S3 Bucket.
accessPoints (dict) --
The configuration of Amazon S3 access points or multi-region access points for the bucket. You can propose up to 10 new access points per bucket.
(string) --
(dict) --
The configuration for an Amazon S3 access point or multi-region access point for the bucket. You can propose up to 10 access points or multi-region access points per bucket. If the proposed Amazon S3 access point configuration is for an existing bucket, the access preview uses the proposed access point configuration in place of the existing access points. To propose an access point without a policy, you can provide an empty string as the access point policy. For more information, see Creating access points . For more information about access point policy limits, see Access points restrictions and limitations .
accessPointPolicy (string) --
The access point or multi-region access point policy.
networkOrigin (dict) --
The proposed Internet and VpcConfiguration to apply to this Amazon S3 access point. VpcConfiguration does not apply to multi-region access points. If the access preview is for a new resource and neither is specified, the access preview uses Internet for the network origin. If the access preview is for an existing resource and neither is specified, the access preview uses the exiting network origin.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: internetConfiguration, vpcConfiguration. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
internetConfiguration (dict) --
The configuration for the Amazon S3 access point or multi-region access point with an Internet origin.
vpcConfiguration (dict) --
The proposed virtual private cloud (VPC) configuration for the Amazon S3 access point. VPC configuration does not apply to multi-region access points. For more information, see VpcConfiguration .
vpcId (string) --
If this field is specified, this access point will only allow connections from the specified VPC ID.
publicAccessBlock (dict) --
The proposed S3PublicAccessBlock configuration to apply to this Amazon S3 access point or multi-region access point.
ignorePublicAcls (boolean) --
Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
restrictPublicBuckets (boolean) --
Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
bucketAclGrants (list) --
The proposed list of ACL grants for the Amazon S3 bucket. You can propose up to 100 ACL grants per bucket. If the proposed grant configuration is for an existing bucket, the access preview uses the proposed list of grant configurations in place of the existing grants. Otherwise, the access preview uses the existing grants for the bucket.
(dict) --
A proposed access control list grant configuration for an Amazon S3 bucket. For more information, see How to Specify an ACL .
grantee (dict) --
The grantee to whom you’re assigning access rights.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: id, uri. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
id (string) --
The value specified is the canonical user ID of an Amazon Web Services account.
uri (string) --
Used for granting permissions to a predefined group.
permission (string) --
The permissions being granted.
bucketPolicy (string) --
The proposed bucket policy for the Amazon S3 bucket.
bucketPublicAccessBlock (dict) --
The proposed block public access configuration for the Amazon S3 bucket.
ignorePublicAcls (boolean) --
Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
restrictPublicBuckets (boolean) --
Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
secretsManagerSecret (dict) --
The access control configuration is for a Secrets Manager secret.
kmsKeyId (string) --
The proposed ARN, key ID, or alias of the KMS customer master key (CMK).
secretPolicy (string) --
The proposed resource policy defining who can access or manage the secret.
sqsQueue (dict) --
The access control configuration is for an Amazon SQS queue.
queuePolicy (string) --
The proposed resource policy for the Amazon SQS queue.
createdAt (datetime) --
The time at which the access preview was created.
id (string) --
The unique ID for the access preview.
status (string) --
The status of the access preview.
statusReason (dict) --
Provides more details about the current status of the access preview.
For example, if the creation of the access preview fails, a Failed status is returned. This failure can be due to an internal issue with the analysis or due to an invalid resource configuration.
code (string) --
The reason code for the current status of the access preview.
Exceptions
Retrieves information about a resource that was analyzed.
See also: AWS API Documentation
Request Syntax
response = client.get_analyzed_resource(
analyzerArn='string',
resourceArn='string'
)
[REQUIRED]
The ARN of the analyzer to retrieve information from.
[REQUIRED]
The ARN of the resource to retrieve information about.
dict
Response Syntax
{
'resource': {
'actions': [
'string',
],
'analyzedAt': datetime(2015, 1, 1),
'createdAt': datetime(2015, 1, 1),
'error': 'string',
'isPublic': True|False,
'resourceArn': 'string',
'resourceOwnerAccount': 'string',
'resourceType': 'AWS::S3::Bucket'|'AWS::IAM::Role'|'AWS::SQS::Queue'|'AWS::Lambda::Function'|'AWS::Lambda::LayerVersion'|'AWS::KMS::Key'|'AWS::SecretsManager::Secret',
'sharedVia': [
'string',
],
'status': 'ACTIVE'|'ARCHIVED'|'RESOLVED',
'updatedAt': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
The response to the request.
resource (dict) --
An AnalyzedResource object that contains information that IAM Access Analyzer found when it analyzed the resource.
actions (list) --
The actions that an external principal is granted permission to use by the policy that generated the finding.
analyzedAt (datetime) --
The time at which the resource was analyzed.
createdAt (datetime) --
The time at which the finding was created.
error (string) --
An error message.
isPublic (boolean) --
Indicates whether the policy that generated the finding grants public access to the resource.
resourceArn (string) --
The ARN of the resource that was analyzed.
resourceOwnerAccount (string) --
The Amazon Web Services account ID that owns the resource.
resourceType (string) --
The type of the resource that was analyzed.
sharedVia (list) --
Indicates how the access that generated the finding is granted. This is populated for Amazon S3 bucket findings.
status (string) --
The current status of the finding generated from the analyzed resource.
updatedAt (datetime) --
The time at which the finding was updated.
Exceptions
Retrieves information about the specified analyzer.
See also: AWS API Documentation
Request Syntax
response = client.get_analyzer(
analyzerName='string'
)
[REQUIRED]
The name of the analyzer retrieved.
{
'analyzer': {
'arn': 'string',
'createdAt': datetime(2015, 1, 1),
'lastResourceAnalyzed': 'string',
'lastResourceAnalyzedAt': datetime(2015, 1, 1),
'name': 'string',
'status': 'ACTIVE'|'CREATING'|'DISABLED'|'FAILED',
'statusReason': {
'code': 'AWS_SERVICE_ACCESS_DISABLED'|'DELEGATED_ADMINISTRATOR_DEREGISTERED'|'ORGANIZATION_DELETED'|'SERVICE_LINKED_ROLE_CREATION_FAILED'
},
'tags': {
'string': 'string'
},
'type': 'ACCOUNT'|'ORGANIZATION'
}
}
Response Structure
The response to the request.
An AnalyzerSummary object that contains information about the analyzer.
The ARN of the analyzer.
A timestamp for the time at which the analyzer was created.
The resource that was most recently analyzed by the analyzer.
The time at which the most recently analyzed resource was analyzed.
The name of the analyzer.
The status of the analyzer. An Active analyzer successfully monitors supported resources and generates new findings. The analyzer is Disabled when a user action, such as removing trusted access for Identity and Access Management Access Analyzer from Organizations, causes the analyzer to stop generating new findings. The status is Creating when the analyzer creation is in progress and Failed when the analyzer creation has failed.
The statusReason provides more details about the current status of the analyzer. For example, if the creation for the analyzer fails, a Failed status is returned. For an analyzer with organization as the type, this failure can be due to an issue with creating the service-linked roles required in the member accounts of the Amazon Web Services organization.
The reason code for the current status of the analyzer.
The tags added to the analyzer.
The type of analyzer, which corresponds to the zone of trust chosen for the analyzer.
Exceptions
Retrieves information about an archive rule.
To learn about filter keys that you can use to create an archive rule, see IAM Access Analyzer filter keys in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.get_archive_rule(
analyzerName='string',
ruleName='string'
)
[REQUIRED]
The name of the analyzer to retrieve rules from.
[REQUIRED]
The name of the rule to retrieve.
dict
Response Syntax
{
'archiveRule': {
'createdAt': datetime(2015, 1, 1),
'filter': {
'string': {
'contains': [
'string',
],
'eq': [
'string',
],
'exists': True|False,
'neq': [
'string',
]
}
},
'ruleName': 'string',
'updatedAt': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
The response to the request.
archiveRule (dict) --
Contains information about an archive rule.
createdAt (datetime) --
The time at which the archive rule was created.
filter (dict) --
A filter used to define the archive rule.
(string) --
(dict) --
The criteria to use in the filter that defines the archive rule.
contains (list) --
A "contains" operator to match for the filter used to create the rule.
eq (list) --
An "equals" operator to match for the filter used to create the rule.
exists (boolean) --
An "exists" operator to match for the filter used to create the rule.
neq (list) --
A "not equals" operator to match for the filter used to create the rule.
ruleName (string) --
The name of the archive rule.
updatedAt (datetime) --
The time at which the archive rule was last updated.
Exceptions
Retrieves information about the specified finding.
See also: AWS API Documentation
Request Syntax
response = client.get_finding(
analyzerArn='string',
id='string'
)
[REQUIRED]
The ARN of the analyzer that generated the finding.
[REQUIRED]
The ID of the finding to retrieve.
dict
Response Syntax
{
'finding': {
'action': [
'string',
],
'analyzedAt': datetime(2015, 1, 1),
'condition': {
'string': 'string'
},
'createdAt': datetime(2015, 1, 1),
'error': 'string',
'id': 'string',
'isPublic': True|False,
'principal': {
'string': 'string'
},
'resource': 'string',
'resourceOwnerAccount': 'string',
'resourceType': 'AWS::S3::Bucket'|'AWS::IAM::Role'|'AWS::SQS::Queue'|'AWS::Lambda::Function'|'AWS::Lambda::LayerVersion'|'AWS::KMS::Key'|'AWS::SecretsManager::Secret',
'sources': [
{
'detail': {
'accessPointArn': 'string'
},
'type': 'POLICY'|'BUCKET_ACL'|'S3_ACCESS_POINT'
},
],
'status': 'ACTIVE'|'ARCHIVED'|'RESOLVED',
'updatedAt': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
The response to the request.
finding (dict) --
A finding object that contains finding details.
action (list) --
The action in the analyzed policy statement that an external principal has permission to use.
analyzedAt (datetime) --
The time at which the resource was analyzed.
condition (dict) --
The condition in the analyzed policy statement that resulted in a finding.
createdAt (datetime) --
The time at which the finding was generated.
error (string) --
An error.
id (string) --
The ID of the finding.
isPublic (boolean) --
Indicates whether the policy that generated the finding allows public access to the resource.
principal (dict) --
The external principal that access to a resource within the zone of trust.
resource (string) --
The resource that an external principal has access to.
resourceOwnerAccount (string) --
The Amazon Web Services account ID that owns the resource.
resourceType (string) --
The type of the resource identified in the finding.
sources (list) --
The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
(dict) --
The source of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
detail (dict) --
Includes details about how the access that generated the finding is granted. This is populated for Amazon S3 bucket findings.
accessPointArn (string) --
The ARN of the access point that generated the finding. The ARN format depends on whether the ARN represents an access point or a multi-region access point.
type (string) --
Indicates the type of access that generated the finding.
status (string) --
The current status of the finding.
updatedAt (datetime) --
The time at which the finding was updated.
Exceptions
Retrieves the policy that was generated using StartPolicyGeneration .
See also: AWS API Documentation
Request Syntax
response = client.get_generated_policy(
includeResourcePlaceholders=True|False,
includeServiceLevelTemplate=True|False,
jobId='string'
)
The level of detail that you want to generate. You can specify whether to generate policies with placeholders for resource ARNs for actions that support resource level granularity in policies.
For example, in the resource section of a policy, you can receive a placeholder such as "Resource":"arn:aws:s3:::${BucketName}" instead of "*" .
The level of detail that you want to generate. You can specify whether to generate service-level policies.
IAM Access Analyzer uses iam:servicelastaccessed to identify services that have been used recently to create this service-level template.
[REQUIRED]
The JobId that is returned by the StartPolicyGeneration operation. The JobId can be used with GetGeneratedPolicy to retrieve the generated policies or used with CancelPolicyGeneration to cancel the policy generation request.
dict
Response Syntax
{
'generatedPolicyResult': {
'generatedPolicies': [
{
'policy': 'string'
},
],
'properties': {
'cloudTrailProperties': {
'endTime': datetime(2015, 1, 1),
'startTime': datetime(2015, 1, 1),
'trailProperties': [
{
'allRegions': True|False,
'cloudTrailArn': 'string',
'regions': [
'string',
]
},
]
},
'isComplete': True|False,
'principalArn': 'string'
}
},
'jobDetails': {
'completedOn': datetime(2015, 1, 1),
'jobError': {
'code': 'AUTHORIZATION_ERROR'|'RESOURCE_NOT_FOUND_ERROR'|'SERVICE_QUOTA_EXCEEDED_ERROR'|'SERVICE_ERROR',
'message': 'string'
},
'jobId': 'string',
'startedOn': datetime(2015, 1, 1),
'status': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED'|'CANCELED'
}
}
Response Structure
(dict) --
generatedPolicyResult (dict) --
A GeneratedPolicyResult object that contains the generated policies and associated details.
generatedPolicies (list) --
The text to use as the content for the new policy. The policy is created using the CreatePolicy action.
(dict) --
Contains the text for the generated policy.
policy (string) --
The text to use as the content for the new policy. The policy is created using the CreatePolicy action.
properties (dict) --
A GeneratedPolicyProperties object that contains properties of the generated policy.
cloudTrailProperties (dict) --
Lists details about the Trail used to generated policy.
endTime (datetime) --
The end of the time range for which IAM Access Analyzer reviews your CloudTrail events. Events with a timestamp after this time are not considered to generate a policy. If this is not included in the request, the default value is the current time.
startTime (datetime) --
The start of the time range for which IAM Access Analyzer reviews your CloudTrail events. Events with a timestamp before this time are not considered to generate a policy.
trailProperties (list) --
A TrailProperties object that contains settings for trail properties.
(dict) --
Contains details about the CloudTrail trail being analyzed to generate a policy.
allRegions (boolean) --
Possible values are true or false . If set to true , IAM Access Analyzer retrieves CloudTrail data from all regions to analyze and generate a policy.
cloudTrailArn (string) --
Specifies the ARN of the trail. The format of a trail ARN is arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail .
regions (list) --
A list of regions to get CloudTrail data from and analyze to generate a policy.
isComplete (boolean) --
This value is set to true if the generated policy contains all possible actions for a service that IAM Access Analyzer identified from the CloudTrail trail that you specified, and false otherwise.
principalArn (string) --
The ARN of the IAM entity (user or role) for which you are generating a policy.
jobDetails (dict) --
A GeneratedPolicyDetails object that contains details about the generated policy.
completedOn (datetime) --
A timestamp of when the job was completed.
jobError (dict) --
The job error for the policy generation request.
code (string) --
The job error code.
message (string) --
Specific information about the error. For example, which service quota was exceeded or which resource was not found.
jobId (string) --
The JobId that is returned by the StartPolicyGeneration operation. The JobId can be used with GetGeneratedPolicy to retrieve the generated policies or used with CancelPolicyGeneration to cancel the policy generation request.
startedOn (datetime) --
A timestamp of when the job was started.
status (string) --
The status of the job request.
Exceptions
Create a paginator for an operation.
Returns an object that can wait for some condition.
Retrieves a list of access preview findings generated by the specified access preview.
See also: AWS API Documentation
Request Syntax
response = client.list_access_preview_findings(
accessPreviewId='string',
analyzerArn='string',
filter={
'string': {
'contains': [
'string',
],
'eq': [
'string',
],
'exists': True|False,
'neq': [
'string',
]
}
},
maxResults=123,
nextToken='string'
)
[REQUIRED]
The unique ID for the access preview.
[REQUIRED]
The ARN of the analyzer used to generate the access.
Criteria to filter the returned findings.
The criteria to use in the filter that defines the archive rule.
A "contains" operator to match for the filter used to create the rule.
An "equals" operator to match for the filter used to create the rule.
An "exists" operator to match for the filter used to create the rule.
A "not equals" operator to match for the filter used to create the rule.
dict
Response Syntax
{
'findings': [
{
'action': [
'string',
],
'changeType': 'CHANGED'|'NEW'|'UNCHANGED',
'condition': {
'string': 'string'
},
'createdAt': datetime(2015, 1, 1),
'error': 'string',
'existingFindingId': 'string',
'existingFindingStatus': 'ACTIVE'|'ARCHIVED'|'RESOLVED',
'id': 'string',
'isPublic': True|False,
'principal': {
'string': 'string'
},
'resource': 'string',
'resourceOwnerAccount': 'string',
'resourceType': 'AWS::S3::Bucket'|'AWS::IAM::Role'|'AWS::SQS::Queue'|'AWS::Lambda::Function'|'AWS::Lambda::LayerVersion'|'AWS::KMS::Key'|'AWS::SecretsManager::Secret',
'sources': [
{
'detail': {
'accessPointArn': 'string'
},
'type': 'POLICY'|'BUCKET_ACL'|'S3_ACCESS_POINT'
},
],
'status': 'ACTIVE'|'ARCHIVED'|'RESOLVED'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
findings (list) --
A list of access preview findings that match the specified filter criteria.
(dict) --
An access preview finding generated by the access preview.
action (list) --
The action in the analyzed policy statement that an external principal has permission to perform.
changeType (string) --
Provides context on how the access preview finding compares to existing access identified in IAM Access Analyzer.
For example, a Changed finding with preview status Resolved and existing status Active indicates the existing Active finding would become Resolved as a result of the proposed permissions change.
condition (dict) --
The condition in the analyzed policy statement that resulted in a finding.
createdAt (datetime) --
The time at which the access preview finding was created.
error (string) --
An error.
existingFindingId (string) --
The existing ID of the finding in IAM Access Analyzer, provided only for existing findings.
existingFindingStatus (string) --
The existing status of the finding, provided only for existing findings.
id (string) --
The ID of the access preview finding. This ID uniquely identifies the element in the list of access preview findings and is not related to the finding ID in Access Analyzer.
isPublic (boolean) --
Indicates whether the policy that generated the finding allows public access to the resource.
principal (dict) --
The external principal that has access to a resource within the zone of trust.
resource (string) --
The resource that an external principal has access to. This is the resource associated with the access preview.
resourceOwnerAccount (string) --
The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the owning account is the account in which the resource was created.
resourceType (string) --
The type of the resource that can be accessed in the finding.
sources (list) --
The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
(dict) --
The source of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
detail (dict) --
Includes details about how the access that generated the finding is granted. This is populated for Amazon S3 bucket findings.
accessPointArn (string) --
The ARN of the access point that generated the finding. The ARN format depends on whether the ARN represents an access point or a multi-region access point.
type (string) --
Indicates the type of access that generated the finding.
status (string) --
The preview status of the finding. This is what the status of the finding would be after permissions deployment. For example, a Changed finding with preview status Resolved and existing status Active indicates the existing Active finding would become Resolved as a result of the proposed permissions change.
nextToken (string) --
A token used for pagination of results returned.
Exceptions
Retrieves a list of access previews for the specified analyzer.
See also: AWS API Documentation
Request Syntax
response = client.list_access_previews(
analyzerArn='string',
maxResults=123,
nextToken='string'
)
[REQUIRED]
The ARN of the analyzer used to generate the access preview.
dict
Response Syntax
{
'accessPreviews': [
{
'analyzerArn': 'string',
'createdAt': datetime(2015, 1, 1),
'id': 'string',
'status': 'COMPLETED'|'CREATING'|'FAILED',
'statusReason': {
'code': 'INTERNAL_ERROR'|'INVALID_CONFIGURATION'
}
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
accessPreviews (list) --
A list of access previews retrieved for the analyzer.
(dict) --
Contains a summary of information about an access preview.
analyzerArn (string) --
The ARN of the analyzer used to generate the access preview.
createdAt (datetime) --
The time at which the access preview was created.
id (string) --
The unique ID for the access preview.
status (string) --
The status of the access preview.
statusReason (dict) --
Provides more details about the current status of the access preview. For example, if the creation of the access preview fails, a Failed status is returned. This failure can be due to an internal issue with the analysis or due to an invalid proposed resource configuration.
code (string) --
The reason code for the current status of the access preview.
nextToken (string) --
A token used for pagination of results returned.
Exceptions
Retrieves a list of resources of the specified type that have been analyzed by the specified analyzer..
See also: AWS API Documentation
Request Syntax
response = client.list_analyzed_resources(
analyzerArn='string',
maxResults=123,
nextToken='string',
resourceType='AWS::S3::Bucket'|'AWS::IAM::Role'|'AWS::SQS::Queue'|'AWS::Lambda::Function'|'AWS::Lambda::LayerVersion'|'AWS::KMS::Key'|'AWS::SecretsManager::Secret'
)
[REQUIRED]
The ARN of the analyzer to retrieve a list of analyzed resources from.
dict
Response Syntax
{
'analyzedResources': [
{
'resourceArn': 'string',
'resourceOwnerAccount': 'string',
'resourceType': 'AWS::S3::Bucket'|'AWS::IAM::Role'|'AWS::SQS::Queue'|'AWS::Lambda::Function'|'AWS::Lambda::LayerVersion'|'AWS::KMS::Key'|'AWS::SecretsManager::Secret'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
The response to the request.
analyzedResources (list) --
A list of resources that were analyzed.
(dict) --
Contains the ARN of the analyzed resource.
resourceArn (string) --
The ARN of the analyzed resource.
resourceOwnerAccount (string) --
The Amazon Web Services account ID that owns the resource.
resourceType (string) --
The type of resource that was analyzed.
nextToken (string) --
A token used for pagination of results returned.
Exceptions
Retrieves a list of analyzers.
See also: AWS API Documentation
Request Syntax
response = client.list_analyzers(
maxResults=123,
nextToken='string',
type='ACCOUNT'|'ORGANIZATION'
)
dict
Response Syntax
{
'analyzers': [
{
'arn': 'string',
'createdAt': datetime(2015, 1, 1),
'lastResourceAnalyzed': 'string',
'lastResourceAnalyzedAt': datetime(2015, 1, 1),
'name': 'string',
'status': 'ACTIVE'|'CREATING'|'DISABLED'|'FAILED',
'statusReason': {
'code': 'AWS_SERVICE_ACCESS_DISABLED'|'DELEGATED_ADMINISTRATOR_DEREGISTERED'|'ORGANIZATION_DELETED'|'SERVICE_LINKED_ROLE_CREATION_FAILED'
},
'tags': {
'string': 'string'
},
'type': 'ACCOUNT'|'ORGANIZATION'
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
The response to the request.
analyzers (list) --
The analyzers retrieved.
(dict) --
Contains information about the analyzer.
arn (string) --
The ARN of the analyzer.
createdAt (datetime) --
A timestamp for the time at which the analyzer was created.
lastResourceAnalyzed (string) --
The resource that was most recently analyzed by the analyzer.
lastResourceAnalyzedAt (datetime) --
The time at which the most recently analyzed resource was analyzed.
name (string) --
The name of the analyzer.
status (string) --
The status of the analyzer. An Active analyzer successfully monitors supported resources and generates new findings. The analyzer is Disabled when a user action, such as removing trusted access for Identity and Access Management Access Analyzer from Organizations, causes the analyzer to stop generating new findings. The status is Creating when the analyzer creation is in progress and Failed when the analyzer creation has failed.
statusReason (dict) --
The statusReason provides more details about the current status of the analyzer. For example, if the creation for the analyzer fails, a Failed status is returned. For an analyzer with organization as the type, this failure can be due to an issue with creating the service-linked roles required in the member accounts of the Amazon Web Services organization.
code (string) --
The reason code for the current status of the analyzer.
tags (dict) --
The tags added to the analyzer.
type (string) --
The type of analyzer, which corresponds to the zone of trust chosen for the analyzer.
nextToken (string) --
A token used for pagination of results returned.
Exceptions
Retrieves a list of archive rules created for the specified analyzer.
See also: AWS API Documentation
Request Syntax
response = client.list_archive_rules(
analyzerName='string',
maxResults=123,
nextToken='string'
)
[REQUIRED]
The name of the analyzer to retrieve rules from.
dict
Response Syntax
{
'archiveRules': [
{
'createdAt': datetime(2015, 1, 1),
'filter': {
'string': {
'contains': [
'string',
],
'eq': [
'string',
],
'exists': True|False,
'neq': [
'string',
]
}
},
'ruleName': 'string',
'updatedAt': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
The response to the request.
archiveRules (list) --
A list of archive rules created for the specified analyzer.
(dict) --
Contains information about an archive rule.
createdAt (datetime) --
The time at which the archive rule was created.
filter (dict) --
A filter used to define the archive rule.
(string) --
(dict) --
The criteria to use in the filter that defines the archive rule.
contains (list) --
A "contains" operator to match for the filter used to create the rule.
eq (list) --
An "equals" operator to match for the filter used to create the rule.
exists (boolean) --
An "exists" operator to match for the filter used to create the rule.
neq (list) --
A "not equals" operator to match for the filter used to create the rule.
ruleName (string) --
The name of the archive rule.
updatedAt (datetime) --
The time at which the archive rule was last updated.
nextToken (string) --
A token used for pagination of results returned.
Exceptions
Retrieves a list of findings generated by the specified analyzer.
To learn about filter keys that you can use to retrieve a list of findings, see IAM Access Analyzer filter keys in the IAM User Guide .
See also: AWS API Documentation
Request Syntax
response = client.list_findings(
analyzerArn='string',
filter={
'string': {
'contains': [
'string',
],
'eq': [
'string',
],
'exists': True|False,
'neq': [
'string',
]
}
},
maxResults=123,
nextToken='string',
sort={
'attributeName': 'string',
'orderBy': 'ASC'|'DESC'
}
)
[REQUIRED]
The ARN of the analyzer to retrieve findings from.
A filter to match for the findings to return.
The criteria to use in the filter that defines the archive rule.
A "contains" operator to match for the filter used to create the rule.
An "equals" operator to match for the filter used to create the rule.
An "exists" operator to match for the filter used to create the rule.
A "not equals" operator to match for the filter used to create the rule.
The sort order for the findings returned.
The name of the attribute to sort on.
The sort order, ascending or descending.
dict
Response Syntax
{
'findings': [
{
'action': [
'string',
],
'analyzedAt': datetime(2015, 1, 1),
'condition': {
'string': 'string'
},
'createdAt': datetime(2015, 1, 1),
'error': 'string',
'id': 'string',
'isPublic': True|False,
'principal': {
'string': 'string'
},
'resource': 'string',
'resourceOwnerAccount': 'string',
'resourceType': 'AWS::S3::Bucket'|'AWS::IAM::Role'|'AWS::SQS::Queue'|'AWS::Lambda::Function'|'AWS::Lambda::LayerVersion'|'AWS::KMS::Key'|'AWS::SecretsManager::Secret',
'sources': [
{
'detail': {
'accessPointArn': 'string'
},
'type': 'POLICY'|'BUCKET_ACL'|'S3_ACCESS_POINT'
},
],
'status': 'ACTIVE'|'ARCHIVED'|'RESOLVED',
'updatedAt': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
The response to the request.
findings (list) --
A list of findings retrieved from the analyzer that match the filter criteria specified, if any.
(dict) --
Contains information about a finding.
action (list) --
The action in the analyzed policy statement that an external principal has permission to use.
analyzedAt (datetime) --
The time at which the resource-based policy that generated the finding was analyzed.
condition (dict) --
The condition in the analyzed policy statement that resulted in a finding.
createdAt (datetime) --
The time at which the finding was created.
error (string) --
The error that resulted in an Error finding.
id (string) --
The ID of the finding.
isPublic (boolean) --
Indicates whether the finding reports a resource that has a policy that allows public access.
principal (dict) --
The external principal that has access to a resource within the zone of trust.
resource (string) --
The resource that the external principal has access to.
resourceOwnerAccount (string) --
The Amazon Web Services account ID that owns the resource.
resourceType (string) --
The type of the resource that the external principal has access to.
sources (list) --
The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
(dict) --
The source of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
detail (dict) --
Includes details about how the access that generated the finding is granted. This is populated for Amazon S3 bucket findings.
accessPointArn (string) --
The ARN of the access point that generated the finding. The ARN format depends on whether the ARN represents an access point or a multi-region access point.
type (string) --
Indicates the type of access that generated the finding.
status (string) --
The status of the finding.
updatedAt (datetime) --
The time at which the finding was most recently updated.
nextToken (string) --
A token used for pagination of results returned.
Exceptions
Lists all of the policy generations requested in the last seven days.
See also: AWS API Documentation
Request Syntax
response = client.list_policy_generations(
maxResults=123,
nextToken='string',
principalArn='string'
)
dict
Response Syntax
{
'nextToken': 'string',
'policyGenerations': [
{
'completedOn': datetime(2015, 1, 1),
'jobId': 'string',
'principalArn': 'string',
'startedOn': datetime(2015, 1, 1),
'status': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED'|'CANCELED'
},
]
}
Response Structure
(dict) --
nextToken (string) --
A token used for pagination of results returned.
policyGenerations (list) --
A PolicyGeneration object that contains details about the generated policy.
(dict) --
Contains details about the policy generation status and properties.
completedOn (datetime) --
A timestamp of when the policy generation was completed.
jobId (string) --
The JobId that is returned by the StartPolicyGeneration operation. The JobId can be used with GetGeneratedPolicy to retrieve the generated policies or used with CancelPolicyGeneration to cancel the policy generation request.
principalArn (string) --
The ARN of the IAM entity (user or role) for which you are generating a policy.
startedOn (datetime) --
A timestamp of when the policy generation started.
status (string) --
The status of the policy generation request.
Exceptions
Retrieves a list of tags applied to the specified resource.
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
resourceArn='string'
)
[REQUIRED]
The ARN of the resource to retrieve tags from.
{
'tags': {
'string': 'string'
}
}
Response Structure
The response to the request.
The tags that are applied to the specified resource.
Exceptions
Starts the policy generation request.
See also: AWS API Documentation
Request Syntax
response = client.start_policy_generation(
clientToken='string',
cloudTrailDetails={
'accessRole': 'string',
'endTime': datetime(2015, 1, 1),
'startTime': datetime(2015, 1, 1),
'trails': [
{
'allRegions': True|False,
'cloudTrailArn': 'string',
'regions': [
'string',
]
},
]
},
policyGenerationDetails={
'principalArn': 'string'
}
)
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.
If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.
This field is autopopulated if not provided.
A CloudTrailDetails object that contains details about a Trail that you want to analyze to generate policies.
The ARN of the service role that IAM Access Analyzer uses to access your CloudTrail trail and service last accessed information.
The end of the time range for which IAM Access Analyzer reviews your CloudTrail events. Events with a timestamp after this time are not considered to generate a policy. If this is not included in the request, the default value is the current time.
The start of the time range for which IAM Access Analyzer reviews your CloudTrail events. Events with a timestamp before this time are not considered to generate a policy.
A Trail object that contains settings for a trail.
Contains details about the CloudTrail trail being analyzed to generate a policy.
Possible values are true or false . If set to true , IAM Access Analyzer retrieves CloudTrail data from all regions to analyze and generate a policy.
Specifies the ARN of the trail. The format of a trail ARN is arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail .
A list of regions to get CloudTrail data from and analyze to generate a policy.
[REQUIRED]
Contains the ARN of the IAM entity (user or role) for which you are generating a policy.
The ARN of the IAM entity (user or role) for which you are generating a policy.
dict
Response Syntax
{
'jobId': 'string'
}
Response Structure
(dict) --
jobId (string) --
The JobId that is returned by the StartPolicyGeneration operation. The JobId can be used with GetGeneratedPolicy to retrieve the generated policies or used with CancelPolicyGeneration to cancel the policy generation request.
Exceptions
Immediately starts a scan of the policies applied to the specified resource.
See also: AWS API Documentation
Request Syntax
response = client.start_resource_scan(
analyzerArn='string',
resourceArn='string'
)
[REQUIRED]
The ARN of the analyzer to use to scan the policies applied to the specified resource.
[REQUIRED]
The ARN of the resource to scan.
None
Exceptions
Adds a tag to the specified resource.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
resourceArn='string',
tags={
'string': 'string'
}
)
[REQUIRED]
The ARN of the resource to add the tag to.
[REQUIRED]
The tags to add to the resource.
dict
Response Syntax
{}
Response Structure
(dict) --
The response to the request.
Exceptions
Removes a tag from the specified resource.
See also: AWS API Documentation
Request Syntax
response = client.untag_resource(
resourceArn='string',
tagKeys=[
'string',
]
)
[REQUIRED]
The ARN of the resource to remove the tag from.
[REQUIRED]
The key for the tag to add.
dict
Response Syntax
{}
Response Structure
(dict) --
The response to the request.
Exceptions
Updates the criteria and values for the specified archive rule.
See also: AWS API Documentation
Request Syntax
response = client.update_archive_rule(
analyzerName='string',
clientToken='string',
filter={
'string': {
'contains': [
'string',
],
'eq': [
'string',
],
'exists': True|False,
'neq': [
'string',
]
}
},
ruleName='string'
)
[REQUIRED]
The name of the analyzer to update the archive rules for.
A client token.
This field is autopopulated if not provided.
[REQUIRED]
A filter to match for the rules to update. Only rules that match the filter are updated.
The criteria to use in the filter that defines the archive rule.
A "contains" operator to match for the filter used to create the rule.
An "equals" operator to match for the filter used to create the rule.
An "exists" operator to match for the filter used to create the rule.
A "not equals" operator to match for the filter used to create the rule.
[REQUIRED]
The name of the rule to update.
None
Exceptions
Updates the status for the specified findings.
See also: AWS API Documentation
Request Syntax
response = client.update_findings(
analyzerArn='string',
clientToken='string',
ids=[
'string',
],
resourceArn='string',
status='ACTIVE'|'ARCHIVED'
)
[REQUIRED]
The ARN of the analyzer that generated the findings to update.
A client token.
This field is autopopulated if not provided.
The IDs of the findings to update.
[REQUIRED]
The state represents the action to take to update the finding Status. Use ARCHIVE to change an Active finding to an Archived finding. Use ACTIVE to change an Archived finding to an Active finding.
None
Exceptions
Requests the validation of a policy and returns a list of findings. The findings help you identify issues and provide actionable recommendations to resolve the issue and enable you to author functional policies that meet security best practices.
See also: AWS API Documentation
Request Syntax
response = client.validate_policy(
locale='DE'|'EN'|'ES'|'FR'|'IT'|'JA'|'KO'|'PT_BR'|'ZH_CN'|'ZH_TW',
maxResults=123,
nextToken='string',
policyDocument='string',
policyType='IDENTITY_POLICY'|'RESOURCE_POLICY'|'SERVICE_CONTROL_POLICY'
)
[REQUIRED]
The JSON policy document to use as the content for the policy.
[REQUIRED]
The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups. They also include service-control policies (SCPs) that are attached to an Amazon Web Services organization, organizational unit (OU), or an account.
Resource policies grant permissions on Amazon Web Services resources. Resource policies include trust policies for IAM roles and bucket policies for Amazon S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or Amazon S3 bucket policy.
dict
Response Syntax
{
'findings': [
{
'findingDetails': 'string',
'findingType': 'ERROR'|'SECURITY_WARNING'|'SUGGESTION'|'WARNING',
'issueCode': 'string',
'learnMoreLink': 'string',
'locations': [
{
'path': [
{
'index': 123,
'key': 'string',
'substring': {
'length': 123,
'start': 123
},
'value': 'string'
},
],
'span': {
'end': {
'column': 123,
'line': 123,
'offset': 123
},
'start': {
'column': 123,
'line': 123,
'offset': 123
}
}
},
]
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
findings (list) --
The list of findings in a policy returned by IAM Access Analyzer based on its suite of policy checks.
(dict) --
A finding in a policy. Each finding is an actionable recommendation that can be used to improve the policy.
findingDetails (string) --
A localized message that explains the finding and provides guidance on how to address it.
findingType (string) --
The impact of the finding.
Security warnings report when the policy allows access that we consider overly permissive.
Errors report when a part of the policy is not functional.
Warnings report non-security issues when a policy does not conform to policy writing best practices.
Suggestions recommend stylistic improvements in the policy that do not impact access.
issueCode (string) --
The issue code provides an identifier of the issue associated with this finding.
learnMoreLink (string) --
A link to additional documentation about the type of finding.
locations (list) --
The list of locations in the policy document that are related to the finding. The issue code provides a summary of an issue identified by the finding.
(dict) --
A location in a policy that is represented as a path through the JSON representation and a corresponding span.
path (list) --
A path in a policy, represented as a sequence of path elements.
(dict) --
A single element in a path through the JSON representation of a policy.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: index, key, substring, value. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
index (integer) --
Refers to an index in a JSON array.
key (string) --
Refers to a key in a JSON object.
substring (dict) --
Refers to a substring of a literal string in a JSON object.
length (integer) --
The length of the substring.
start (integer) --
The start index of the substring, starting from 0.
value (string) --
Refers to the value associated with a given key in a JSON object.
span (dict) --
A span in a policy.
end (dict) --
The end position of the span (exclusive).
column (integer) --
The column of the position, starting from 0.
line (integer) --
The line of the position, starting from 1.
offset (integer) --
The offset within the policy that corresponds to the position, starting from 0.
start (dict) --
The start position of the span (inclusive).
column (integer) --
The column of the position, starting from 0.
line (integer) --
The line of the position, starting from 1.
offset (integer) --
The offset within the policy that corresponds to the position, starting from 0.
nextToken (string) --
A token used for pagination of results returned.
Exceptions
The available paginators are:
paginator = client.get_paginator('list_access_preview_findings')
Creates an iterator that will paginate through responses from AccessAnalyzer.Client.list_access_preview_findings().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
accessPreviewId='string',
analyzerArn='string',
filter={
'string': {
'contains': [
'string',
],
'eq': [
'string',
],
'exists': True|False,
'neq': [
'string',
]
}
},
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The unique ID for the access preview.
[REQUIRED]
The ARN of the analyzer used to generate the access.
Criteria to filter the returned findings.
The criteria to use in the filter that defines the archive rule.
A "contains" operator to match for the filter used to create the rule.
An "equals" operator to match for the filter used to create the rule.
An "exists" operator to match for the filter used to create the rule.
A "not equals" operator to match for the filter used to create the rule.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'findings': [
{
'action': [
'string',
],
'changeType': 'CHANGED'|'NEW'|'UNCHANGED',
'condition': {
'string': 'string'
},
'createdAt': datetime(2015, 1, 1),
'error': 'string',
'existingFindingId': 'string',
'existingFindingStatus': 'ACTIVE'|'ARCHIVED'|'RESOLVED',
'id': 'string',
'isPublic': True|False,
'principal': {
'string': 'string'
},
'resource': 'string',
'resourceOwnerAccount': 'string',
'resourceType': 'AWS::S3::Bucket'|'AWS::IAM::Role'|'AWS::SQS::Queue'|'AWS::Lambda::Function'|'AWS::Lambda::LayerVersion'|'AWS::KMS::Key'|'AWS::SecretsManager::Secret',
'sources': [
{
'detail': {
'accessPointArn': 'string'
},
'type': 'POLICY'|'BUCKET_ACL'|'S3_ACCESS_POINT'
},
],
'status': 'ACTIVE'|'ARCHIVED'|'RESOLVED'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
findings (list) --
A list of access preview findings that match the specified filter criteria.
(dict) --
An access preview finding generated by the access preview.
action (list) --
The action in the analyzed policy statement that an external principal has permission to perform.
changeType (string) --
Provides context on how the access preview finding compares to existing access identified in IAM Access Analyzer.
For example, a Changed finding with preview status Resolved and existing status Active indicates the existing Active finding would become Resolved as a result of the proposed permissions change.
condition (dict) --
The condition in the analyzed policy statement that resulted in a finding.
createdAt (datetime) --
The time at which the access preview finding was created.
error (string) --
An error.
existingFindingId (string) --
The existing ID of the finding in IAM Access Analyzer, provided only for existing findings.
existingFindingStatus (string) --
The existing status of the finding, provided only for existing findings.
id (string) --
The ID of the access preview finding. This ID uniquely identifies the element in the list of access preview findings and is not related to the finding ID in Access Analyzer.
isPublic (boolean) --
Indicates whether the policy that generated the finding allows public access to the resource.
principal (dict) --
The external principal that has access to a resource within the zone of trust.
resource (string) --
The resource that an external principal has access to. This is the resource associated with the access preview.
resourceOwnerAccount (string) --
The Amazon Web Services account ID that owns the resource. For most Amazon Web Services resources, the owning account is the account in which the resource was created.
resourceType (string) --
The type of the resource that can be accessed in the finding.
sources (list) --
The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
(dict) --
The source of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
detail (dict) --
Includes details about how the access that generated the finding is granted. This is populated for Amazon S3 bucket findings.
accessPointArn (string) --
The ARN of the access point that generated the finding. The ARN format depends on whether the ARN represents an access point or a multi-region access point.
type (string) --
Indicates the type of access that generated the finding.
status (string) --
The preview status of the finding. This is what the status of the finding would be after permissions deployment. For example, a Changed finding with preview status Resolved and existing status Active indicates the existing Active finding would become Resolved as a result of the proposed permissions change.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_access_previews')
Creates an iterator that will paginate through responses from AccessAnalyzer.Client.list_access_previews().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
analyzerArn='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ARN of the analyzer used to generate the access preview.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'accessPreviews': [
{
'analyzerArn': 'string',
'createdAt': datetime(2015, 1, 1),
'id': 'string',
'status': 'COMPLETED'|'CREATING'|'FAILED',
'statusReason': {
'code': 'INTERNAL_ERROR'|'INVALID_CONFIGURATION'
}
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
accessPreviews (list) --
A list of access previews retrieved for the analyzer.
(dict) --
Contains a summary of information about an access preview.
analyzerArn (string) --
The ARN of the analyzer used to generate the access preview.
createdAt (datetime) --
The time at which the access preview was created.
id (string) --
The unique ID for the access preview.
status (string) --
The status of the access preview.
statusReason (dict) --
Provides more details about the current status of the access preview. For example, if the creation of the access preview fails, a Failed status is returned. This failure can be due to an internal issue with the analysis or due to an invalid proposed resource configuration.
code (string) --
The reason code for the current status of the access preview.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_analyzed_resources')
Creates an iterator that will paginate through responses from AccessAnalyzer.Client.list_analyzed_resources().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
analyzerArn='string',
resourceType='AWS::S3::Bucket'|'AWS::IAM::Role'|'AWS::SQS::Queue'|'AWS::Lambda::Function'|'AWS::Lambda::LayerVersion'|'AWS::KMS::Key'|'AWS::SecretsManager::Secret',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ARN of the analyzer to retrieve a list of analyzed resources from.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'analyzedResources': [
{
'resourceArn': 'string',
'resourceOwnerAccount': 'string',
'resourceType': 'AWS::S3::Bucket'|'AWS::IAM::Role'|'AWS::SQS::Queue'|'AWS::Lambda::Function'|'AWS::Lambda::LayerVersion'|'AWS::KMS::Key'|'AWS::SecretsManager::Secret'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
The response to the request.
analyzedResources (list) --
A list of resources that were analyzed.
(dict) --
Contains the ARN of the analyzed resource.
resourceArn (string) --
The ARN of the analyzed resource.
resourceOwnerAccount (string) --
The Amazon Web Services account ID that owns the resource.
resourceType (string) --
The type of resource that was analyzed.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_analyzers')
Creates an iterator that will paginate through responses from AccessAnalyzer.Client.list_analyzers().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
type='ACCOUNT'|'ORGANIZATION',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'analyzers': [
{
'arn': 'string',
'createdAt': datetime(2015, 1, 1),
'lastResourceAnalyzed': 'string',
'lastResourceAnalyzedAt': datetime(2015, 1, 1),
'name': 'string',
'status': 'ACTIVE'|'CREATING'|'DISABLED'|'FAILED',
'statusReason': {
'code': 'AWS_SERVICE_ACCESS_DISABLED'|'DELEGATED_ADMINISTRATOR_DEREGISTERED'|'ORGANIZATION_DELETED'|'SERVICE_LINKED_ROLE_CREATION_FAILED'
},
'tags': {
'string': 'string'
},
'type': 'ACCOUNT'|'ORGANIZATION'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
The response to the request.
analyzers (list) --
The analyzers retrieved.
(dict) --
Contains information about the analyzer.
arn (string) --
The ARN of the analyzer.
createdAt (datetime) --
A timestamp for the time at which the analyzer was created.
lastResourceAnalyzed (string) --
The resource that was most recently analyzed by the analyzer.
lastResourceAnalyzedAt (datetime) --
The time at which the most recently analyzed resource was analyzed.
name (string) --
The name of the analyzer.
status (string) --
The status of the analyzer. An Active analyzer successfully monitors supported resources and generates new findings. The analyzer is Disabled when a user action, such as removing trusted access for Identity and Access Management Access Analyzer from Organizations, causes the analyzer to stop generating new findings. The status is Creating when the analyzer creation is in progress and Failed when the analyzer creation has failed.
statusReason (dict) --
The statusReason provides more details about the current status of the analyzer. For example, if the creation for the analyzer fails, a Failed status is returned. For an analyzer with organization as the type, this failure can be due to an issue with creating the service-linked roles required in the member accounts of the Amazon Web Services organization.
code (string) --
The reason code for the current status of the analyzer.
tags (dict) --
The tags added to the analyzer.
type (string) --
The type of analyzer, which corresponds to the zone of trust chosen for the analyzer.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_archive_rules')
Creates an iterator that will paginate through responses from AccessAnalyzer.Client.list_archive_rules().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
analyzerName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The name of the analyzer to retrieve rules from.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'archiveRules': [
{
'createdAt': datetime(2015, 1, 1),
'filter': {
'string': {
'contains': [
'string',
],
'eq': [
'string',
],
'exists': True|False,
'neq': [
'string',
]
}
},
'ruleName': 'string',
'updatedAt': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
The response to the request.
archiveRules (list) --
A list of archive rules created for the specified analyzer.
(dict) --
Contains information about an archive rule.
createdAt (datetime) --
The time at which the archive rule was created.
filter (dict) --
A filter used to define the archive rule.
(string) --
(dict) --
The criteria to use in the filter that defines the archive rule.
contains (list) --
A "contains" operator to match for the filter used to create the rule.
eq (list) --
An "equals" operator to match for the filter used to create the rule.
exists (boolean) --
An "exists" operator to match for the filter used to create the rule.
neq (list) --
A "not equals" operator to match for the filter used to create the rule.
ruleName (string) --
The name of the archive rule.
updatedAt (datetime) --
The time at which the archive rule was last updated.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_findings')
Creates an iterator that will paginate through responses from AccessAnalyzer.Client.list_findings().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
analyzerArn='string',
filter={
'string': {
'contains': [
'string',
],
'eq': [
'string',
],
'exists': True|False,
'neq': [
'string',
]
}
},
sort={
'attributeName': 'string',
'orderBy': 'ASC'|'DESC'
},
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The ARN of the analyzer to retrieve findings from.
A filter to match for the findings to return.
The criteria to use in the filter that defines the archive rule.
A "contains" operator to match for the filter used to create the rule.
An "equals" operator to match for the filter used to create the rule.
An "exists" operator to match for the filter used to create the rule.
A "not equals" operator to match for the filter used to create the rule.
The sort order for the findings returned.
The name of the attribute to sort on.
The sort order, ascending or descending.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'findings': [
{
'action': [
'string',
],
'analyzedAt': datetime(2015, 1, 1),
'condition': {
'string': 'string'
},
'createdAt': datetime(2015, 1, 1),
'error': 'string',
'id': 'string',
'isPublic': True|False,
'principal': {
'string': 'string'
},
'resource': 'string',
'resourceOwnerAccount': 'string',
'resourceType': 'AWS::S3::Bucket'|'AWS::IAM::Role'|'AWS::SQS::Queue'|'AWS::Lambda::Function'|'AWS::Lambda::LayerVersion'|'AWS::KMS::Key'|'AWS::SecretsManager::Secret',
'sources': [
{
'detail': {
'accessPointArn': 'string'
},
'type': 'POLICY'|'BUCKET_ACL'|'S3_ACCESS_POINT'
},
],
'status': 'ACTIVE'|'ARCHIVED'|'RESOLVED',
'updatedAt': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
The response to the request.
findings (list) --
A list of findings retrieved from the analyzer that match the filter criteria specified, if any.
(dict) --
Contains information about a finding.
action (list) --
The action in the analyzed policy statement that an external principal has permission to use.
analyzedAt (datetime) --
The time at which the resource-based policy that generated the finding was analyzed.
condition (dict) --
The condition in the analyzed policy statement that resulted in a finding.
createdAt (datetime) --
The time at which the finding was created.
error (string) --
The error that resulted in an Error finding.
id (string) --
The ID of the finding.
isPublic (boolean) --
Indicates whether the finding reports a resource that has a policy that allows public access.
principal (dict) --
The external principal that has access to a resource within the zone of trust.
resource (string) --
The resource that the external principal has access to.
resourceOwnerAccount (string) --
The Amazon Web Services account ID that owns the resource.
resourceType (string) --
The type of the resource that the external principal has access to.
sources (list) --
The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
(dict) --
The source of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
detail (dict) --
Includes details about how the access that generated the finding is granted. This is populated for Amazon S3 bucket findings.
accessPointArn (string) --
The ARN of the access point that generated the finding. The ARN format depends on whether the ARN represents an access point or a multi-region access point.
type (string) --
Indicates the type of access that generated the finding.
status (string) --
The status of the finding.
updatedAt (datetime) --
The time at which the finding was most recently updated.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('list_policy_generations')
Creates an iterator that will paginate through responses from AccessAnalyzer.Client.list_policy_generations().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
principalArn='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'policyGenerations': [
{
'completedOn': datetime(2015, 1, 1),
'jobId': 'string',
'principalArn': 'string',
'startedOn': datetime(2015, 1, 1),
'status': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED'|'CANCELED'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
policyGenerations (list) --
A PolicyGeneration object that contains details about the generated policy.
(dict) --
Contains details about the policy generation status and properties.
completedOn (datetime) --
A timestamp of when the policy generation was completed.
jobId (string) --
The JobId that is returned by the StartPolicyGeneration operation. The JobId can be used with GetGeneratedPolicy to retrieve the generated policies or used with CancelPolicyGeneration to cancel the policy generation request.
principalArn (string) --
The ARN of the IAM entity (user or role) for which you are generating a policy.
startedOn (datetime) --
A timestamp of when the policy generation started.
status (string) --
The status of the policy generation request.
NextToken (string) --
A token to resume pagination.
paginator = client.get_paginator('validate_policy')
Creates an iterator that will paginate through responses from AccessAnalyzer.Client.validate_policy().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
locale='DE'|'EN'|'ES'|'FR'|'IT'|'JA'|'KO'|'PT_BR'|'ZH_CN'|'ZH_TW',
policyDocument='string',
policyType='IDENTITY_POLICY'|'RESOURCE_POLICY'|'SERVICE_CONTROL_POLICY',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
[REQUIRED]
The JSON policy document to use as the content for the policy.
[REQUIRED]
The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups. They also include service-control policies (SCPs) that are attached to an Amazon Web Services organization, organizational unit (OU), or an account.
Resource policies grant permissions on Amazon Web Services resources. Resource policies include trust policies for IAM roles and bucket policies for Amazon S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or Amazon S3 bucket policy.
A dictionary that provides parameters to control pagination.
The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.
The size of each page.
A token to specify where to start paginating. This is the NextToken from a previous response.
dict
Response Syntax
{
'findings': [
{
'findingDetails': 'string',
'findingType': 'ERROR'|'SECURITY_WARNING'|'SUGGESTION'|'WARNING',
'issueCode': 'string',
'learnMoreLink': 'string',
'locations': [
{
'path': [
{
'index': 123,
'key': 'string',
'substring': {
'length': 123,
'start': 123
},
'value': 'string'
},
],
'span': {
'end': {
'column': 123,
'line': 123,
'offset': 123
},
'start': {
'column': 123,
'line': 123,
'offset': 123
}
}
},
]
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
findings (list) --
The list of findings in a policy returned by IAM Access Analyzer based on its suite of policy checks.
(dict) --
A finding in a policy. Each finding is an actionable recommendation that can be used to improve the policy.
findingDetails (string) --
A localized message that explains the finding and provides guidance on how to address it.
findingType (string) --
The impact of the finding.
Security warnings report when the policy allows access that we consider overly permissive.
Errors report when a part of the policy is not functional.
Warnings report non-security issues when a policy does not conform to policy writing best practices.
Suggestions recommend stylistic improvements in the policy that do not impact access.
issueCode (string) --
The issue code provides an identifier of the issue associated with this finding.
learnMoreLink (string) --
A link to additional documentation about the type of finding.
locations (list) --
The list of locations in the policy document that are related to the finding. The issue code provides a summary of an issue identified by the finding.
(dict) --
A location in a policy that is represented as a path through the JSON representation and a corresponding span.
path (list) --
A path in a policy, represented as a sequence of path elements.
(dict) --
A single element in a path through the JSON representation of a policy.
Note
This is a Tagged Union structure. Only one of the following top level keys will be set: index, key, substring, value. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:
'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
index (integer) --
Refers to an index in a JSON array.
key (string) --
Refers to a key in a JSON object.
substring (dict) --
Refers to a substring of a literal string in a JSON object.
length (integer) --
The length of the substring.
start (integer) --
The start index of the substring, starting from 0.
value (string) --
Refers to the value associated with a given key in a JSON object.
span (dict) --
A span in a policy.
end (dict) --
The end position of the span (exclusive).
column (integer) --
The column of the position, starting from 0.
line (integer) --
The line of the position, starting from 1.
offset (integer) --
The offset within the policy that corresponds to the position, starting from 0.
start (dict) --
The start position of the span (inclusive).
column (integer) --
The column of the position, starting from 0.
line (integer) --
The line of the position, starting from 1.
offset (integer) --
The offset within the policy that corresponds to the position, starting from 0.
NextToken (string) --
A token to resume pagination.