Class: AWS.AccessAnalyzer
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.AccessAnalyzer
- Identifier:
- accessanalyzer
- API Version:
- 2019-11-01
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
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.
Sending a Request Using AccessAnalyzer
var accessanalyzer = new AWS.AccessAnalyzer();
accessanalyzer.applyArchiveRule(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the AccessAnalyzer object uses this specific API, you can
construct the object by passing the apiVersion
option to the constructor:
var accessanalyzer = new AWS.AccessAnalyzer({apiVersion: '2019-11-01'});
You can also set the API version globally in AWS.config.apiVersions
using
the accessanalyzer service identifier:
AWS.config.apiVersions = {
accessanalyzer: '2019-11-01',
// other service API versions
};
var accessanalyzer = new AWS.AccessAnalyzer();
Version:
-
2019-11-01
Constructor Summary collapse
-
new AWS.AccessAnalyzer(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary collapse
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary collapse
-
applyArchiveRule(params = {}, callback) ⇒ AWS.Request
Retroactively applies the archive rule to existing findings that meet the archive rule criteria.
.
-
cancelPolicyGeneration(params = {}, callback) ⇒ AWS.Request
Cancels the requested policy generation.
.
-
createAccessPreview(params = {}, callback) ⇒ AWS.Request
Creates an access preview that allows you to preview IAM Access Analyzer findings for your resource before deploying resource permissions.
.
-
createAnalyzer(params = {}, callback) ⇒ AWS.Request
Creates an analyzer for your account.
.
-
createArchiveRule(params = {}, callback) ⇒ AWS.Request
Creates an archive rule for the specified analyzer.
-
deleteAnalyzer(params = {}, callback) ⇒ AWS.Request
Deletes the specified analyzer.
-
deleteArchiveRule(params = {}, callback) ⇒ AWS.Request
Deletes the specified archive rule.
.
-
getAccessPreview(params = {}, callback) ⇒ AWS.Request
Retrieves information about an access preview for the specified analyzer.
.
-
getAnalyzedResource(params = {}, callback) ⇒ AWS.Request
Retrieves information about a resource that was analyzed.
.
-
getAnalyzer(params = {}, callback) ⇒ AWS.Request
Retrieves information about the specified analyzer.
.
-
getArchiveRule(params = {}, callback) ⇒ AWS.Request
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.
. -
getFinding(params = {}, callback) ⇒ AWS.Request
Retrieves information about the specified finding.
.
-
getGeneratedPolicy(params = {}, callback) ⇒ AWS.Request
Retrieves the policy that was generated using
StartPolicyGeneration
. -
listAccessPreviewFindings(params = {}, callback) ⇒ AWS.Request
Retrieves a list of access preview findings generated by the specified access preview.
.
-
listAccessPreviews(params = {}, callback) ⇒ AWS.Request
Retrieves a list of access previews for the specified analyzer.
.
-
listAnalyzedResources(params = {}, callback) ⇒ AWS.Request
Retrieves a list of resources of the specified type that have been analyzed by the specified analyzer..
.
-
listAnalyzers(params = {}, callback) ⇒ AWS.Request
Retrieves a list of analyzers.
.
-
listArchiveRules(params = {}, callback) ⇒ AWS.Request
Retrieves a list of archive rules created for the specified analyzer.
.
-
listFindings(params = {}, callback) ⇒ AWS.Request
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.
. -
listPolicyGenerations(params = {}, callback) ⇒ AWS.Request
Lists all of the policy generations requested in the last seven days.
.
-
listTagsForResource(params = {}, callback) ⇒ AWS.Request
Retrieves a list of tags applied to the specified resource.
.
-
startPolicyGeneration(params = {}, callback) ⇒ AWS.Request
Starts the policy generation request.
.
-
startResourceScan(params = {}, callback) ⇒ AWS.Request
Immediately starts a scan of the policies applied to the specified resource.
.
-
tagResource(params = {}, callback) ⇒ AWS.Request
Adds a tag to the specified resource.
.
-
untagResource(params = {}, callback) ⇒ AWS.Request
Removes a tag from the specified resource.
.
-
updateArchiveRule(params = {}, callback) ⇒ AWS.Request
Updates the criteria and values for the specified archive rule.
.
-
updateFindings(params = {}, callback) ⇒ AWS.Request
Updates the status for the specified findings.
.
-
validatePolicy(params = {}, callback) ⇒ AWS.Request
Requests the validation of a policy and returns a list of findings.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService
Constructor Details
new AWS.AccessAnalyzer(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Examples:
Constructing a AccessAnalyzer object
var accessanalyzer = new AWS.AccessAnalyzer({apiVersion: '2019-11-01'});
Options Hash (options):
-
params
(map)
—
An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.
-
endpoint
(String|AWS.Endpoint)
—
The endpoint URI to send requests to. The default endpoint is built from the configured
region
. The endpoint should be a string like'https://{service}.{region}.amazonaws.com'
or an Endpoint object. -
accessKeyId
(String)
—
your AWS access key ID.
-
secretAccessKey
(String)
—
your AWS secret access key.
-
sessionToken
(AWS.Credentials)
—
the optional AWS session token to sign requests with.
-
credentials
(AWS.Credentials)
—
the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.
-
credentialProvider
(AWS.CredentialProviderChain)
—
the provider chain used to resolve credentials if no static
credentials
property is set. -
region
(String)
—
the region to send service requests to. See AWS.AccessAnalyzer.region for more information.
-
maxRetries
(Integer)
—
the maximum amount of retries to attempt with a request. See AWS.AccessAnalyzer.maxRetries for more information.
-
maxRedirects
(Integer)
—
the maximum amount of redirects to follow with a request. See AWS.AccessAnalyzer.maxRedirects for more information.
-
sslEnabled
(Boolean)
—
whether to enable SSL for requests.
-
paramValidation
(Boolean|map)
—
whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
true
. - max [Boolean] — Validates that a value meets the max constraint.
- pattern [Boolean] — Validates that a string value matches a regular expression.
- enum [Boolean] — Validates that a string value matches one of the allowable enum values.
- min [Boolean] — Validates that a value meets the min
constraint. This is enabled by default when paramValidation is set
to
-
computeChecksums
(Boolean)
—
whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)
-
convertResponseTypes
(Boolean)
—
whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to
true
. -
correctClockSkew
(Boolean)
—
whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to
false
. -
s3ForcePathStyle
(Boolean)
—
whether to force path style URLs for S3 objects.
-
s3BucketEndpoint
(Boolean)
—
whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an
endpoint
to be provided explicitly to the service constructor. -
s3DisableBodySigning
(Boolean)
—
whether S3 body signing should be disabled when using signature version
v4
. Body signing can only be disabled when using https. Defaults totrue
. -
s3UsEast1RegionalEndpoint
('legacy'|'regional')
—
when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to
legacy
-
s3UseArnRegion
(Boolean)
—
whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to
true
-
retryDelayOptions
(map)
—
A set of options to configure the retry delay on retryable errors. Currently supported options are:
- base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
- customBackoff [function] — A custom function that accepts a
retry count and error and returns the amount of time to delay in
milliseconds. If the result is a non-zero negative value, no further
retry attempts will be made. The
base
option will be ignored if this option is supplied. The function is only called for retryable errors.
-
httpOptions
(map)
—
A set of options to pass to the low-level HTTP request. Currently supported options are:
- proxy [String] — the URL to proxy requests through
- agent [http.Agent, https.Agent] — the Agent object to perform
HTTP requests with. Used for connection pooling. Defaults to the global
agent (
http.globalAgent
) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment. - connectTimeout [Integer] — Sets the socket to timeout after
failing to establish a connection with the server after
connectTimeout
milliseconds. This timeout has no effect once a socket connection has been established. - timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
- xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
- xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
-
apiVersion
(String, Date)
—
a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by
apiVersions
). Specify 'latest' to use the latest possible version. -
apiVersions
(map<String, String|Date>)
—
a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.
-
logger
(#write, #log)
—
an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests
-
systemClockOffset
(Number)
—
an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global
AWS.config
object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds. -
signatureVersion
(String)
—
the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.
-
signatureCache
(Boolean)
—
whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to
true
. -
dynamoDbCrc32
(Boolean)
—
whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default:
true
. -
useAccelerateEndpoint
(Boolean)
—
Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default:
false
. -
clientSideMonitoring
(Boolean)
—
whether to collect and publish this client's performance metrics of all its API requests.
-
endpointDiscoveryEnabled
(Boolean|undefined)
—
whether to call operations with endpoints given by service dynamically. Setting this
-
endpointCacheSize
(Number)
—
the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000
-
hostPrefixEnabled
(Boolean)
—
whether to marshal request parameters to the prefix of hostname. Defaults to
true
. -
stsRegionalEndpoints
('legacy'|'regional')
—
whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.
Property Details
Method Details
applyArchiveRule(params = {}, callback) ⇒ AWS.Request
Retroactively applies the archive rule to existing findings that meet the archive rule criteria.
Service Reference:
Examples:
Calling the applyArchiveRule operation
var params = {
analyzerArn: 'STRING_VALUE', /* required */
ruleName: 'STRING_VALUE', /* required */
clientToken: 'STRING_VALUE'
};
accessanalyzer.applyArchiveRule(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerArn
— (String
)The Amazon resource name (ARN) of the analyzer.
clientToken
— (String
)A client token.
If a token is not provided, the SDK will use a version 4 UUID.ruleName
— (String
)The name of the rule to apply.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
cancelPolicyGeneration(params = {}, callback) ⇒ AWS.Request
Cancels the requested policy generation.
Service Reference:
Examples:
Calling the cancelPolicyGeneration operation
var params = {
jobId: 'STRING_VALUE' /* required */
};
accessanalyzer.cancelPolicyGeneration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
jobId
— (String
)The
JobId
that is returned by theStartPolicyGeneration
operation. TheJobId
can be used withGetGeneratedPolicy
to retrieve the generated policies or used withCancelPolicyGeneration
to cancel the policy generation request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
createAccessPreview(params = {}, callback) ⇒ AWS.Request
Creates an access preview that allows you to preview IAM Access Analyzer findings for your resource before deploying resource permissions.
Service Reference:
Examples:
Calling the createAccessPreview operation
var params = {
analyzerArn: 'STRING_VALUE', /* required */
configurations: { /* required */
'<ConfigurationsMapKey>': {
iamRole: {
trustPolicy: 'STRING_VALUE'
},
kmsKey: {
grants: [
{
granteePrincipal: 'STRING_VALUE', /* required */
issuingAccount: 'STRING_VALUE', /* required */
operations: [ /* required */
CreateGrant | Decrypt | DescribeKey | Encrypt | GenerateDataKey | GenerateDataKeyPair | GenerateDataKeyPairWithoutPlaintext | GenerateDataKeyWithoutPlaintext | GetPublicKey | ReEncryptFrom | ReEncryptTo | RetireGrant | Sign | Verify,
/* more items */
],
constraints: {
encryptionContextEquals: {
'<KmsConstraintsKey>': 'STRING_VALUE',
/* '<KmsConstraintsKey>': ... */
},
encryptionContextSubset: {
'<KmsConstraintsKey>': 'STRING_VALUE',
/* '<KmsConstraintsKey>': ... */
}
},
retiringPrincipal: 'STRING_VALUE'
},
/* more items */
],
keyPolicies: {
'<PolicyName>': 'STRING_VALUE',
/* '<PolicyName>': ... */
}
},
s3Bucket: {
accessPoints: {
'<AccessPointArn>': {
accessPointPolicy: 'STRING_VALUE',
networkOrigin: {
internetConfiguration: {
},
vpcConfiguration: {
vpcId: 'STRING_VALUE' /* required */
}
},
publicAccessBlock: {
ignorePublicAcls: true || false, /* required */
restrictPublicBuckets: true || false /* required */
}
},
/* '<AccessPointArn>': ... */
},
bucketAclGrants: [
{
grantee: { /* required */
id: 'STRING_VALUE',
uri: 'STRING_VALUE'
},
permission: READ | WRITE | READ_ACP | WRITE_ACP | FULL_CONTROL /* required */
},
/* more items */
],
bucketPolicy: 'STRING_VALUE',
bucketPublicAccessBlock: {
ignorePublicAcls: true || false, /* required */
restrictPublicBuckets: true || false /* required */
}
},
secretsManagerSecret: {
kmsKeyId: 'STRING_VALUE',
secretPolicy: 'STRING_VALUE'
},
sqsQueue: {
queuePolicy: 'STRING_VALUE'
}
},
/* '<ConfigurationsMapKey>': ... */
},
clientToken: 'STRING_VALUE'
};
accessanalyzer.createAccessPreview(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerArn
— (String
)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 andActive
status.clientToken
— (String
)A client token.
If a token is not provided, the SDK will use a version 4 UUID.configurations
— (map<map>
)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.
iamRole
— (map
)The access control configuration is for an IAM role.
trustPolicy
— (String
)The proposed trust policy for the IAM role.
kmsKey
— (map
)The access control configuration is for a KMS key.
grants
— (Array<map>
)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.
constraints
— (map
)Use this structure to propose allowing cryptographic operations in the grant only when the operation request includes the specified encryption context.
encryptionContextEquals
— (map<String>
)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
— (map<String>
)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
— required — (String
)The principal that is given permission to perform the operations that the grant permits.
issuingAccount
— required — (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
— required — (Array<String>
)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
— (map<String>
)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
— (map
)The access control configuration is for an Amazon S3 Bucket.
accessPoints
— (map<map>
)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.
accessPointPolicy
— (String
)The access point or multi-region access point policy.
networkOrigin
— (map
)The proposed
Internet
andVpcConfiguration
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 usesInternet
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.internetConfiguration
— (map
)The configuration for the Amazon S3 access point or multi-region access point with an
Internet
origin.vpcConfiguration
— (map
)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
— required — (String
)If this field is specified, this access point will only allow connections from the specified VPC ID.
publicAccessBlock
— (map
)The proposed
S3PublicAccessBlock
configuration to apply to this Amazon S3 access point or multi-region access point.ignorePublicAcls
— required — (Boolean
)Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
restrictPublicBuckets
— required — (Boolean
)Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
bucketAclGrants
— (Array<map>
)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.
grantee
— required — (map
)The grantee to whom you’re assigning access rights.
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
— required — (String
)The permissions being granted.
Possible values include:"READ"
"WRITE"
"READ_ACP"
"WRITE_ACP"
"FULL_CONTROL"
bucketPolicy
— (String
)The proposed bucket policy for the Amazon S3 bucket.
bucketPublicAccessBlock
— (map
)The proposed block public access configuration for the Amazon S3 bucket.
ignorePublicAcls
— required — (Boolean
)Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
restrictPublicBuckets
— required — (Boolean
)Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
secretsManagerSecret
— (map
)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
— (map
)The access control configuration is for an Amazon SQS queue.
queuePolicy
— (String
)The proposed resource policy for the Amazon SQS queue.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:id
— (String
)The unique ID for the access preview.
-
(AWS.Response)
—
Returns:
createAnalyzer(params = {}, callback) ⇒ AWS.Request
Creates an analyzer for your account.
Service Reference:
Examples:
Calling the createAnalyzer operation
var params = {
analyzerName: 'STRING_VALUE', /* required */
type: ACCOUNT | ORGANIZATION, /* required */
archiveRules: [
{
filter: { /* required */
'<String>': {
contains: [
'STRING_VALUE',
/* more items */
],
eq: [
'STRING_VALUE',
/* more items */
],
exists: true || false,
neq: [
'STRING_VALUE',
/* more items */
]
},
/* '<String>': ... */
},
ruleName: 'STRING_VALUE' /* required */
},
/* more items */
],
clientToken: 'STRING_VALUE',
tags: {
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
accessanalyzer.createAnalyzer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerName
— (String
)The name of the analyzer to create.
archiveRules
— (Array<map>
)Specifies the archive rules to add for the analyzer. Archive rules automatically archive findings that meet the criteria you define for the rule.
filter
— required — (map<map>
)The condition and values for a criterion.
contains
— (Array<String>
)A "contains" operator to match for the filter used to create the rule.
eq
— (Array<String>
)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
— (Array<String>
)A "not equals" operator to match for the filter used to create the rule.
ruleName
— required — (String
)The name of the rule.
clientToken
— (String
)A client token.
If a token is not provided, the SDK will use a version 4 UUID.tags
— (map<String>
)The tags to apply to the analyzer.
type
— (String
)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.
Possible values include:"ACCOUNT"
"ORGANIZATION"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:arn
— (String
)The ARN of the analyzer that was created by the request.
-
(AWS.Response)
—
Returns:
createArchiveRule(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the createArchiveRule operation
var params = {
analyzerName: 'STRING_VALUE', /* required */
filter: { /* required */
'<String>': {
contains: [
'STRING_VALUE',
/* more items */
],
eq: [
'STRING_VALUE',
/* more items */
],
exists: true || false,
neq: [
'STRING_VALUE',
/* more items */
]
},
/* '<String>': ... */
},
ruleName: 'STRING_VALUE', /* required */
clientToken: 'STRING_VALUE'
};
accessanalyzer.createArchiveRule(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerName
— (String
)The name of the created analyzer.
clientToken
— (String
)A client token.
If a token is not provided, the SDK will use a version 4 UUID.filter
— (map<map>
)The criteria for the rule.
contains
— (Array<String>
)A "contains" operator to match for the filter used to create the rule.
eq
— (Array<String>
)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
— (Array<String>
)A "not equals" operator to match for the filter used to create the rule.
ruleName
— (String
)The name of the rule to create.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteAnalyzer(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the deleteAnalyzer operation
var params = {
analyzerName: 'STRING_VALUE', /* required */
clientToken: 'STRING_VALUE'
};
accessanalyzer.deleteAnalyzer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerName
— (String
)The name of the analyzer to delete.
clientToken
— (String
)A client token.
If a token is not provided, the SDK will use a version 4 UUID.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
deleteArchiveRule(params = {}, callback) ⇒ AWS.Request
Deletes the specified archive rule.
Service Reference:
Examples:
Calling the deleteArchiveRule operation
var params = {
analyzerName: 'STRING_VALUE', /* required */
ruleName: 'STRING_VALUE', /* required */
clientToken: 'STRING_VALUE'
};
accessanalyzer.deleteArchiveRule(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerName
— (String
)The name of the analyzer that associated with the archive rule to delete.
clientToken
— (String
)A client token.
If a token is not provided, the SDK will use a version 4 UUID.ruleName
— (String
)The name of the rule to delete.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
getAccessPreview(params = {}, callback) ⇒ AWS.Request
Retrieves information about an access preview for the specified analyzer.
Service Reference:
Examples:
Calling the getAccessPreview operation
var params = {
accessPreviewId: 'STRING_VALUE', /* required */
analyzerArn: 'STRING_VALUE' /* required */
};
accessanalyzer.getAccessPreview(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
accessPreviewId
— (String
)The unique ID for the access preview.
analyzerArn
— (String
)The ARN of the analyzer used to generate the access preview.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:accessPreview
— (map
)An object that contains information about the access preview.
analyzerArn
— required — (String
)The ARN of the analyzer used to generate the access preview.
configurations
— required — (map<map>
)A map of resource ARNs for the proposed resource configuration.
iamRole
— (map
)The access control configuration is for an IAM role.
trustPolicy
— (String
)The proposed trust policy for the IAM role.
kmsKey
— (map
)The access control configuration is for a KMS key.
grants
— (Array<map>
)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.
constraints
— (map
)Use this structure to propose allowing cryptographic operations in the grant only when the operation request includes the specified encryption context.
encryptionContextEquals
— (map<String>
)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
— (map<String>
)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
— required — (String
)The principal that is given permission to perform the operations that the grant permits.
issuingAccount
— required — (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
— required — (Array<String>
)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
— (map<String>
)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
— (map
)The access control configuration is for an Amazon S3 Bucket.
accessPoints
— (map<map>
)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.
accessPointPolicy
— (String
)The access point or multi-region access point policy.
networkOrigin
— (map
)The proposed
Internet
andVpcConfiguration
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 usesInternet
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.internetConfiguration
— (map
)The configuration for the Amazon S3 access point or multi-region access point with an
Internet
origin.vpcConfiguration
— (map
)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
— required — (String
)If this field is specified, this access point will only allow connections from the specified VPC ID.
publicAccessBlock
— (map
)The proposed
S3PublicAccessBlock
configuration to apply to this Amazon S3 access point or multi-region access point.ignorePublicAcls
— required — (Boolean
)Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
restrictPublicBuckets
— required — (Boolean
)Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
bucketAclGrants
— (Array<map>
)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.
grantee
— required — (map
)The grantee to whom you’re assigning access rights.
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
— required — (String
)The permissions being granted.
Possible values include:"READ"
"WRITE"
"READ_ACP"
"WRITE_ACP"
"FULL_CONTROL"
bucketPolicy
— (String
)The proposed bucket policy for the Amazon S3 bucket.
bucketPublicAccessBlock
— (map
)The proposed block public access configuration for the Amazon S3 bucket.
ignorePublicAcls
— required — (Boolean
)Specifies whether Amazon S3 should ignore public ACLs for this bucket and objects in this bucket.
restrictPublicBuckets
— required — (Boolean
)Specifies whether Amazon S3 should restrict public bucket policies for this bucket.
secretsManagerSecret
— (map
)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
— (map
)The access control configuration is for an Amazon SQS queue.
queuePolicy
— (String
)The proposed resource policy for the Amazon SQS queue.
createdAt
— required — (Date
)The time at which the access preview was created.
id
— required — (String
)The unique ID for the access preview.
status
— required — (String
)The status of the access preview.
-
Creating
- The access preview creation is in progress. -
Completed
- The access preview is complete. You can preview findings for external access to the resource. -
Failed
- The access preview creation has failed.
"COMPLETED"
"CREATING"
"FAILED"
-
statusReason
— (map
)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
— required — (String
)The reason code for the current status of the access preview.
Possible values include:"INTERNAL_ERROR"
"INVALID_CONFIGURATION"
-
(AWS.Response)
—
Returns:
getAnalyzedResource(params = {}, callback) ⇒ AWS.Request
Retrieves information about a resource that was analyzed.
Service Reference:
Examples:
Calling the getAnalyzedResource operation
var params = {
analyzerArn: 'STRING_VALUE', /* required */
resourceArn: 'STRING_VALUE' /* required */
};
accessanalyzer.getAnalyzedResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerArn
— (String
)The ARN of the analyzer to retrieve information from.
resourceArn
— (String
)The ARN of the resource to retrieve information about.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:resource
— (map
)An
AnalyzedResource
object that contains information that IAM Access Analyzer found when it analyzed the resource.actions
— (Array<String>
)The actions that an external principal is granted permission to use by the policy that generated the finding.
analyzedAt
— required — (Date
)The time at which the resource was analyzed.
createdAt
— required — (Date
)The time at which the finding was created.
error
— (String
)An error message.
isPublic
— required — (Boolean
)Indicates whether the policy that generated the finding grants public access to the resource.
resourceArn
— required — (String
)The ARN of the resource that was analyzed.
resourceOwnerAccount
— required — (String
)The Amazon Web Services account ID that owns the resource.
resourceType
— required — (String
)The type of the resource that was analyzed.
Possible values include:"AWS::S3::Bucket"
"AWS::IAM::Role"
"AWS::SQS::Queue"
"AWS::Lambda::Function"
"AWS::Lambda::LayerVersion"
"AWS::KMS::Key"
"AWS::SecretsManager::Secret"
sharedVia
— (Array<String>
)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.
Possible values include:"ACTIVE"
"ARCHIVED"
"RESOLVED"
updatedAt
— required — (Date
)The time at which the finding was updated.
-
(AWS.Response)
—
Returns:
getAnalyzer(params = {}, callback) ⇒ AWS.Request
Retrieves information about the specified analyzer.
Service Reference:
Examples:
Calling the getAnalyzer operation
var params = {
analyzerName: 'STRING_VALUE' /* required */
};
accessanalyzer.getAnalyzer(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerName
— (String
)The name of the analyzer retrieved.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:analyzer
— (map
)An
AnalyzerSummary
object that contains information about the analyzer.arn
— required — (String
)The ARN of the analyzer.
createdAt
— required — (Date
)A timestamp for the time at which the analyzer was created.
lastResourceAnalyzed
— (String
)The resource that was most recently analyzed by the analyzer.
lastResourceAnalyzedAt
— (Date
)The time at which the most recently analyzed resource was analyzed.
name
— required — (String
)The name of the analyzer.
status
— required — (String
)The status of the analyzer. An
Possible values include:Active
analyzer successfully monitors supported resources and generates new findings. The analyzer isDisabled
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 isCreating
when the analyzer creation is in progress andFailed
when the analyzer creation has failed."ACTIVE"
"CREATING"
"DISABLED"
"FAILED"
statusReason
— (map
)The
statusReason
provides more details about the current status of the analyzer. For example, if the creation for the analyzer fails, aFailed
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
— required — (String
)The reason code for the current status of the analyzer.
Possible values include:"AWS_SERVICE_ACCESS_DISABLED"
"DELEGATED_ADMINISTRATOR_DEREGISTERED"
"ORGANIZATION_DELETED"
"SERVICE_LINKED_ROLE_CREATION_FAILED"
tags
— (map<String>
)The tags added to the analyzer.
type
— required — (String
)The type of analyzer, which corresponds to the zone of trust chosen for the analyzer.
Possible values include:"ACCOUNT"
"ORGANIZATION"
-
(AWS.Response)
—
Returns:
getArchiveRule(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the getArchiveRule operation
var params = {
analyzerName: 'STRING_VALUE', /* required */
ruleName: 'STRING_VALUE' /* required */
};
accessanalyzer.getArchiveRule(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerName
— (String
)The name of the analyzer to retrieve rules from.
ruleName
— (String
)The name of the rule to retrieve.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:archiveRule
— (map
)Contains information about an archive rule.
createdAt
— required — (Date
)The time at which the archive rule was created.
filter
— required — (map<map>
)A filter used to define the archive rule.
contains
— (Array<String>
)A "contains" operator to match for the filter used to create the rule.
eq
— (Array<String>
)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
— (Array<String>
)A "not equals" operator to match for the filter used to create the rule.
ruleName
— required — (String
)The name of the archive rule.
updatedAt
— required — (Date
)The time at which the archive rule was last updated.
-
(AWS.Response)
—
Returns:
getFinding(params = {}, callback) ⇒ AWS.Request
Retrieves information about the specified finding.
Service Reference:
Examples:
Calling the getFinding operation
var params = {
analyzerArn: 'STRING_VALUE', /* required */
id: 'STRING_VALUE' /* required */
};
accessanalyzer.getFinding(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerArn
— (String
)The ARN of the analyzer that generated the finding.
id
— (String
)The ID of the finding to retrieve.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:finding
— (map
)A
finding
object that contains finding details.action
— (Array<String>
)The action in the analyzed policy statement that an external principal has permission to use.
analyzedAt
— required — (Date
)The time at which the resource was analyzed.
condition
— required — (map<String>
)The condition in the analyzed policy statement that resulted in a finding.
createdAt
— required — (Date
)The time at which the finding was generated.
error
— (String
)An error.
id
— required — (String
)The ID of the finding.
isPublic
— (Boolean
)Indicates whether the policy that generated the finding allows public access to the resource.
principal
— (map<String>
)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
— required — (String
)The Amazon Web Services account ID that owns the resource.
resourceType
— required — (String
)The type of the resource identified in the finding.
Possible values include:"AWS::S3::Bucket"
"AWS::IAM::Role"
"AWS::SQS::Queue"
"AWS::Lambda::Function"
"AWS::Lambda::LayerVersion"
"AWS::KMS::Key"
"AWS::SecretsManager::Secret"
sources
— (Array<map>
)The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
detail
— (map
)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
— required — (String
)Indicates the type of access that generated the finding.
Possible values include:"POLICY"
"BUCKET_ACL"
"S3_ACCESS_POINT"
status
— required — (String
)The current status of the finding.
Possible values include:"ACTIVE"
"ARCHIVED"
"RESOLVED"
updatedAt
— required — (Date
)The time at which the finding was updated.
-
(AWS.Response)
—
Returns:
getGeneratedPolicy(params = {}, callback) ⇒ AWS.Request
Retrieves the policy that was generated using StartPolicyGeneration
.
Service Reference:
Examples:
Calling the getGeneratedPolicy operation
var params = {
jobId: 'STRING_VALUE', /* required */
includeResourcePlaceholders: true || false,
includeServiceLevelTemplate: true || false
};
accessanalyzer.getGeneratedPolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
includeResourcePlaceholders
— (Boolean
)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"*"
.includeServiceLevelTemplate
— (Boolean
)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.jobId
— (String
)The
JobId
that is returned by theStartPolicyGeneration
operation. TheJobId
can be used withGetGeneratedPolicy
to retrieve the generated policies or used withCancelPolicyGeneration
to cancel the policy generation request.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:generatedPolicyResult
— (map
)A
GeneratedPolicyResult
object that contains the generated policies and associated details.generatedPolicies
— (Array<map>
)The text to use as the content for the new policy. The policy is created using the CreatePolicy action.
policy
— required — (String
)The text to use as the content for the new policy. The policy is created using the CreatePolicy action.
properties
— required — (map
)A
GeneratedPolicyProperties
object that contains properties of the generated policy.cloudTrailProperties
— (map
)Lists details about the
Trail
used to generated policy.endTime
— required — (Date
)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
— required — (Date
)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
— required — (Array<map>
)A
TrailProperties
object that contains settings for trail properties.allRegions
— (Boolean
)Possible values are
true
orfalse
. If set totrue
, IAM Access Analyzer retrieves CloudTrail data from all regions to analyze and generate a policy.cloudTrailArn
— required — (String
)Specifies the ARN of the trail. The format of a trail ARN is
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
.regions
— (Array<String>
)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, andfalse
otherwise.principalArn
— required — (String
)The ARN of the IAM entity (user or role) for which you are generating a policy.
jobDetails
— (map
)A
GeneratedPolicyDetails
object that contains details about the generated policy.completedOn
— (Date
)A timestamp of when the job was completed.
jobError
— (map
)The job error for the policy generation request.
code
— required — (String
)The job error code.
Possible values include:"AUTHORIZATION_ERROR"
"RESOURCE_NOT_FOUND_ERROR"
"SERVICE_QUOTA_EXCEEDED_ERROR"
"SERVICE_ERROR"
message
— required — (String
)Specific information about the error. For example, which service quota was exceeded or which resource was not found.
jobId
— required — (String
)The
JobId
that is returned by theStartPolicyGeneration
operation. TheJobId
can be used withGetGeneratedPolicy
to retrieve the generated policies or used withCancelPolicyGeneration
to cancel the policy generation request.startedOn
— required — (Date
)A timestamp of when the job was started.
status
— required — (String
)The status of the job request.
Possible values include:"IN_PROGRESS"
"SUCCEEDED"
"FAILED"
"CANCELED"
-
(AWS.Response)
—
Returns:
listAccessPreviewFindings(params = {}, callback) ⇒ AWS.Request
Retrieves a list of access preview findings generated by the specified access preview.
Service Reference:
Examples:
Calling the listAccessPreviewFindings operation
var params = {
accessPreviewId: 'STRING_VALUE', /* required */
analyzerArn: 'STRING_VALUE', /* required */
filter: {
'<String>': {
contains: [
'STRING_VALUE',
/* more items */
],
eq: [
'STRING_VALUE',
/* more items */
],
exists: true || false,
neq: [
'STRING_VALUE',
/* more items */
]
},
/* '<String>': ... */
},
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE'
};
accessanalyzer.listAccessPreviewFindings(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
accessPreviewId
— (String
)The unique ID for the access preview.
analyzerArn
— (String
)The ARN of the analyzer used to generate the access.
filter
— (map<map>
)Criteria to filter the returned findings.
contains
— (Array<String>
)A "contains" operator to match for the filter used to create the rule.
eq
— (Array<String>
)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
— (Array<String>
)A "not equals" operator to match for the filter used to create the rule.
maxResults
— (Integer
)The maximum number of results to return in the response.
nextToken
— (String
)A token used for pagination of results returned.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:findings
— (Array<map>
)A list of access preview findings that match the specified filter criteria.
action
— (Array<String>
)The action in the analyzed policy statement that an external principal has permission to perform.
changeType
— required — (String
)Provides context on how the access preview finding compares to existing access identified in IAM Access Analyzer.
-
New
- The finding is for newly-introduced access. -
Unchanged
- The preview finding is an existing finding that would remain unchanged. -
Changed
- The preview finding is an existing finding with a change in status.
For example, a
Possible values include:Changed
finding with preview statusResolved
and existing statusActive
indicates the existingActive
finding would becomeResolved
as a result of the proposed permissions change."CHANGED"
"NEW"
"UNCHANGED"
-
condition
— (map<String>
)The condition in the analyzed policy statement that resulted in a finding.
createdAt
— required — (Date
)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.
Possible values include:"ACTIVE"
"ARCHIVED"
"RESOLVED"
id
— required — (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
— (map<String>
)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
— required — (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
— required — (String
)The type of the resource that can be accessed in the finding.
Possible values include:"AWS::S3::Bucket"
"AWS::IAM::Role"
"AWS::SQS::Queue"
"AWS::Lambda::Function"
"AWS::Lambda::LayerVersion"
"AWS::KMS::Key"
"AWS::SecretsManager::Secret"
sources
— (Array<map>
)The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
detail
— (map
)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
— required — (String
)Indicates the type of access that generated the finding.
Possible values include:"POLICY"
"BUCKET_ACL"
"S3_ACCESS_POINT"
status
— required — (String
)The preview status of the finding. This is what the status of the finding would be after permissions deployment. For example, a
Possible values include:Changed
finding with preview statusResolved
and existing statusActive
indicates the existingActive
finding would becomeResolved
as a result of the proposed permissions change."ACTIVE"
"ARCHIVED"
"RESOLVED"
nextToken
— (String
)A token used for pagination of results returned.
-
(AWS.Response)
—
Returns:
listAccessPreviews(params = {}, callback) ⇒ AWS.Request
Retrieves a list of access previews for the specified analyzer.
Service Reference:
Examples:
Calling the listAccessPreviews operation
var params = {
analyzerArn: 'STRING_VALUE', /* required */
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE'
};
accessanalyzer.listAccessPreviews(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerArn
— (String
)The ARN of the analyzer used to generate the access preview.
maxResults
— (Integer
)The maximum number of results to return in the response.
nextToken
— (String
)A token used for pagination of results returned.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:accessPreviews
— (Array<map>
)A list of access previews retrieved for the analyzer.
analyzerArn
— required — (String
)The ARN of the analyzer used to generate the access preview.
createdAt
— required — (Date
)The time at which the access preview was created.
id
— required — (String
)The unique ID for the access preview.
status
— required — (String
)The status of the access preview.
-
Creating
- The access preview creation is in progress. -
Completed
- The access preview is complete and previews the findings for external access to the resource. -
Failed
- The access preview creation has failed.
"COMPLETED"
"CREATING"
"FAILED"
-
statusReason
— (map
)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
— required — (String
)The reason code for the current status of the access preview.
Possible values include:"INTERNAL_ERROR"
"INVALID_CONFIGURATION"
nextToken
— (String
)A token used for pagination of results returned.
-
(AWS.Response)
—
Returns:
listAnalyzedResources(params = {}, callback) ⇒ AWS.Request
Retrieves a list of resources of the specified type that have been analyzed by the specified analyzer..
Service Reference:
Examples:
Calling the listAnalyzedResources operation
var params = {
analyzerArn: 'STRING_VALUE', /* required */
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE',
resourceType: AWS::S3::Bucket | AWS::IAM::Role | AWS::SQS::Queue | AWS::Lambda::Function | AWS::Lambda::LayerVersion | AWS::KMS::Key | AWS::SecretsManager::Secret
};
accessanalyzer.listAnalyzedResources(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerArn
— (String
)The ARN of the analyzer to retrieve a list of analyzed resources from.
maxResults
— (Integer
)The maximum number of results to return in the response.
nextToken
— (String
)A token used for pagination of results returned.
resourceType
— (String
)The type of resource.
Possible values include:"AWS::S3::Bucket"
"AWS::IAM::Role"
"AWS::SQS::Queue"
"AWS::Lambda::Function"
"AWS::Lambda::LayerVersion"
"AWS::KMS::Key"
"AWS::SecretsManager::Secret"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:analyzedResources
— (Array<map>
)A list of resources that were analyzed.
resourceArn
— required — (String
)The ARN of the analyzed resource.
resourceOwnerAccount
— required — (String
)The Amazon Web Services account ID that owns the resource.
resourceType
— required — (String
)The type of resource that was analyzed.
Possible values include:"AWS::S3::Bucket"
"AWS::IAM::Role"
"AWS::SQS::Queue"
"AWS::Lambda::Function"
"AWS::Lambda::LayerVersion"
"AWS::KMS::Key"
"AWS::SecretsManager::Secret"
nextToken
— (String
)A token used for pagination of results returned.
-
(AWS.Response)
—
Returns:
listAnalyzers(params = {}, callback) ⇒ AWS.Request
Retrieves a list of analyzers.
Service Reference:
Examples:
Calling the listAnalyzers operation
var params = {
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE',
type: ACCOUNT | ORGANIZATION
};
accessanalyzer.listAnalyzers(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
maxResults
— (Integer
)The maximum number of results to return in the response.
nextToken
— (String
)A token used for pagination of results returned.
type
— (String
)The type of analyzer.
Possible values include:"ACCOUNT"
"ORGANIZATION"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:analyzers
— (Array<map>
)The analyzers retrieved.
arn
— required — (String
)The ARN of the analyzer.
createdAt
— required — (Date
)A timestamp for the time at which the analyzer was created.
lastResourceAnalyzed
— (String
)The resource that was most recently analyzed by the analyzer.
lastResourceAnalyzedAt
— (Date
)The time at which the most recently analyzed resource was analyzed.
name
— required — (String
)The name of the analyzer.
status
— required — (String
)The status of the analyzer. An
Possible values include:Active
analyzer successfully monitors supported resources and generates new findings. The analyzer isDisabled
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 isCreating
when the analyzer creation is in progress andFailed
when the analyzer creation has failed."ACTIVE"
"CREATING"
"DISABLED"
"FAILED"
statusReason
— (map
)The
statusReason
provides more details about the current status of the analyzer. For example, if the creation for the analyzer fails, aFailed
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
— required — (String
)The reason code for the current status of the analyzer.
Possible values include:"AWS_SERVICE_ACCESS_DISABLED"
"DELEGATED_ADMINISTRATOR_DEREGISTERED"
"ORGANIZATION_DELETED"
"SERVICE_LINKED_ROLE_CREATION_FAILED"
tags
— (map<String>
)The tags added to the analyzer.
type
— required — (String
)The type of analyzer, which corresponds to the zone of trust chosen for the analyzer.
Possible values include:"ACCOUNT"
"ORGANIZATION"
nextToken
— (String
)A token used for pagination of results returned.
-
(AWS.Response)
—
Returns:
listArchiveRules(params = {}, callback) ⇒ AWS.Request
Retrieves a list of archive rules created for the specified analyzer.
Service Reference:
Examples:
Calling the listArchiveRules operation
var params = {
analyzerName: 'STRING_VALUE', /* required */
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE'
};
accessanalyzer.listArchiveRules(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerName
— (String
)The name of the analyzer to retrieve rules from.
maxResults
— (Integer
)The maximum number of results to return in the request.
nextToken
— (String
)A token used for pagination of results returned.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:archiveRules
— (Array<map>
)A list of archive rules created for the specified analyzer.
createdAt
— required — (Date
)The time at which the archive rule was created.
filter
— required — (map<map>
)A filter used to define the archive rule.
contains
— (Array<String>
)A "contains" operator to match for the filter used to create the rule.
eq
— (Array<String>
)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
— (Array<String>
)A "not equals" operator to match for the filter used to create the rule.
ruleName
— required — (String
)The name of the archive rule.
updatedAt
— required — (Date
)The time at which the archive rule was last updated.
nextToken
— (String
)A token used for pagination of results returned.
-
(AWS.Response)
—
Returns:
listFindings(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the listFindings operation
var params = {
analyzerArn: 'STRING_VALUE', /* required */
filter: {
'<String>': {
contains: [
'STRING_VALUE',
/* more items */
],
eq: [
'STRING_VALUE',
/* more items */
],
exists: true || false,
neq: [
'STRING_VALUE',
/* more items */
]
},
/* '<String>': ... */
},
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE',
sort: {
attributeName: 'STRING_VALUE',
orderBy: ASC | DESC
}
};
accessanalyzer.listFindings(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerArn
— (String
)The ARN of the analyzer to retrieve findings from.
filter
— (map<map>
)A filter to match for the findings to return.
contains
— (Array<String>
)A "contains" operator to match for the filter used to create the rule.
eq
— (Array<String>
)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
— (Array<String>
)A "not equals" operator to match for the filter used to create the rule.
maxResults
— (Integer
)The maximum number of results to return in the response.
nextToken
— (String
)A token used for pagination of results returned.
sort
— (map
)The sort order for the findings returned.
attributeName
— (String
)The name of the attribute to sort on.
orderBy
— (String
)The sort order, ascending or descending.
Possible values include:"ASC"
"DESC"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:findings
— (Array<map>
)A list of findings retrieved from the analyzer that match the filter criteria specified, if any.
action
— (Array<String>
)The action in the analyzed policy statement that an external principal has permission to use.
analyzedAt
— required — (Date
)The time at which the resource-based policy that generated the finding was analyzed.
condition
— required — (map<String>
)The condition in the analyzed policy statement that resulted in a finding.
createdAt
— required — (Date
)The time at which the finding was created.
error
— (String
)The error that resulted in an Error finding.
id
— required — (String
)The ID of the finding.
isPublic
— (Boolean
)Indicates whether the finding reports a resource that has a policy that allows public access.
principal
— (map<String>
)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
— required — (String
)The Amazon Web Services account ID that owns the resource.
resourceType
— required — (String
)The type of the resource that the external principal has access to.
Possible values include:"AWS::S3::Bucket"
"AWS::IAM::Role"
"AWS::SQS::Queue"
"AWS::Lambda::Function"
"AWS::Lambda::LayerVersion"
"AWS::KMS::Key"
"AWS::SecretsManager::Secret"
sources
— (Array<map>
)The sources of the finding. This indicates how the access that generated the finding is granted. It is populated for Amazon S3 bucket findings.
detail
— (map
)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
— required — (String
)Indicates the type of access that generated the finding.
Possible values include:"POLICY"
"BUCKET_ACL"
"S3_ACCESS_POINT"
status
— required — (String
)The status of the finding.
Possible values include:"ACTIVE"
"ARCHIVED"
"RESOLVED"
updatedAt
— required — (Date
)The time at which the finding was most recently updated.
nextToken
— (String
)A token used for pagination of results returned.
-
(AWS.Response)
—
Returns:
listPolicyGenerations(params = {}, callback) ⇒ AWS.Request
Lists all of the policy generations requested in the last seven days.
Service Reference:
Examples:
Calling the listPolicyGenerations operation
var params = {
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE',
principalArn: 'STRING_VALUE'
};
accessanalyzer.listPolicyGenerations(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
maxResults
— (Integer
)The maximum number of results to return in the response.
nextToken
— (String
)A token used for pagination of results returned.
principalArn
— (String
)The ARN of the IAM entity (user or role) for which you are generating a policy. Use this with
ListGeneratedPolicies
to filter the results to only include results for a specific principal.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:nextToken
— (String
)A token used for pagination of results returned.
policyGenerations
— (Array<map>
)A
PolicyGeneration
object that contains details about the generated policy.completedOn
— (Date
)A timestamp of when the policy generation was completed.
jobId
— required — (String
)The
JobId
that is returned by theStartPolicyGeneration
operation. TheJobId
can be used withGetGeneratedPolicy
to retrieve the generated policies or used withCancelPolicyGeneration
to cancel the policy generation request.principalArn
— required — (String
)The ARN of the IAM entity (user or role) for which you are generating a policy.
startedOn
— required — (Date
)A timestamp of when the policy generation started.
status
— required — (String
)The status of the policy generation request.
Possible values include:"IN_PROGRESS"
"SUCCEEDED"
"FAILED"
"CANCELED"
-
(AWS.Response)
—
Returns:
listTagsForResource(params = {}, callback) ⇒ AWS.Request
Retrieves a list of tags applied to the specified resource.
Service Reference:
Examples:
Calling the listTagsForResource operation
var params = {
resourceArn: 'STRING_VALUE' /* required */
};
accessanalyzer.listTagsForResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceArn
— (String
)The ARN of the resource to retrieve tags from.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:tags
— (map<String>
)The tags that are applied to the specified resource.
-
(AWS.Response)
—
Returns:
startPolicyGeneration(params = {}, callback) ⇒ AWS.Request
Starts the policy generation request.
Service Reference:
Examples:
Calling the startPolicyGeneration operation
var params = {
policyGenerationDetails: { /* required */
principalArn: 'STRING_VALUE' /* required */
},
clientToken: 'STRING_VALUE',
cloudTrailDetails: {
accessRole: 'STRING_VALUE', /* required */
startTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789, /* required */
trails: [ /* required */
{
cloudTrailArn: 'STRING_VALUE', /* required */
allRegions: true || false,
regions: [
'STRING_VALUE',
/* more items */
]
},
/* more items */
],
endTime: new Date || 'Wed Dec 31 1969 16:00:00 GMT-0800 (PST)' || 123456789
}
};
accessanalyzer.startPolicyGeneration(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
clientToken
— (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.
If a token is not provided, the SDK will use a version 4 UUID.cloudTrailDetails
— (map
)A
CloudTrailDetails
object that contains details about aTrail
that you want to analyze to generate policies.accessRole
— required — (String
)The ARN of the service role that IAM Access Analyzer uses to access your CloudTrail trail and service last accessed information.
endTime
— (Date
)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
— required — (Date
)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.
trails
— required — (Array<map>
)A
Trail
object that contains settings for a trail.allRegions
— (Boolean
)Possible values are
true
orfalse
. If set totrue
, IAM Access Analyzer retrieves CloudTrail data from all regions to analyze and generate a policy.cloudTrailArn
— required — (String
)Specifies the ARN of the trail. The format of a trail ARN is
arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail
.regions
— (Array<String>
)A list of regions to get CloudTrail data from and analyze to generate a policy.
policyGenerationDetails
— (map
)Contains the ARN of the IAM entity (user or role) for which you are generating a policy.
principalArn
— required — (String
)The ARN of the IAM entity (user or role) for which you are generating a policy.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:jobId
— (String
)The
JobId
that is returned by theStartPolicyGeneration
operation. TheJobId
can be used withGetGeneratedPolicy
to retrieve the generated policies or used withCancelPolicyGeneration
to cancel the policy generation request.
-
(AWS.Response)
—
Returns:
startResourceScan(params = {}, callback) ⇒ AWS.Request
Immediately starts a scan of the policies applied to the specified resource.
Service Reference:
Examples:
Calling the startResourceScan operation
var params = {
analyzerArn: 'STRING_VALUE', /* required */
resourceArn: 'STRING_VALUE' /* required */
};
accessanalyzer.startResourceScan(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerArn
— (String
)The ARN of the analyzer to use to scan the policies applied to the specified resource.
resourceArn
— (String
)The ARN of the resource to scan.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
tagResource(params = {}, callback) ⇒ AWS.Request
Adds a tag to the specified resource.
Service Reference:
Examples:
Calling the tagResource operation
var params = {
resourceArn: 'STRING_VALUE', /* required */
tags: { /* required */
'<String>': 'STRING_VALUE',
/* '<String>': ... */
}
};
accessanalyzer.tagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceArn
— (String
)The ARN of the resource to add the tag to.
tags
— (map<String>
)The tags to add to the resource.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
untagResource(params = {}, callback) ⇒ AWS.Request
Removes a tag from the specified resource.
Service Reference:
Examples:
Calling the untagResource operation
var params = {
resourceArn: 'STRING_VALUE', /* required */
tagKeys: [ /* required */
'STRING_VALUE',
/* more items */
]
};
accessanalyzer.untagResource(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
resourceArn
— (String
)The ARN of the resource to remove the tag from.
tagKeys
— (Array<String>
)The key for the tag to add.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
updateArchiveRule(params = {}, callback) ⇒ AWS.Request
Updates the criteria and values for the specified archive rule.
Service Reference:
Examples:
Calling the updateArchiveRule operation
var params = {
analyzerName: 'STRING_VALUE', /* required */
filter: { /* required */
'<String>': {
contains: [
'STRING_VALUE',
/* more items */
],
eq: [
'STRING_VALUE',
/* more items */
],
exists: true || false,
neq: [
'STRING_VALUE',
/* more items */
]
},
/* '<String>': ... */
},
ruleName: 'STRING_VALUE', /* required */
clientToken: 'STRING_VALUE'
};
accessanalyzer.updateArchiveRule(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerName
— (String
)The name of the analyzer to update the archive rules for.
clientToken
— (String
)A client token.
If a token is not provided, the SDK will use a version 4 UUID.filter
— (map<map>
)A filter to match for the rules to update. Only rules that match the filter are updated.
contains
— (Array<String>
)A "contains" operator to match for the filter used to create the rule.
eq
— (Array<String>
)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
— (Array<String>
)A "not equals" operator to match for the filter used to create the rule.
ruleName
— (String
)The name of the rule to update.
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
updateFindings(params = {}, callback) ⇒ AWS.Request
Updates the status for the specified findings.
Service Reference:
Examples:
Calling the updateFindings operation
var params = {
analyzerArn: 'STRING_VALUE', /* required */
status: ACTIVE | ARCHIVED, /* required */
clientToken: 'STRING_VALUE',
ids: [
'STRING_VALUE',
/* more items */
],
resourceArn: 'STRING_VALUE'
};
accessanalyzer.updateFindings(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
analyzerArn
— (String
)The ARN of the analyzer that generated the findings to update.
clientToken
— (String
)A client token.
If a token is not provided, the SDK will use a version 4 UUID.ids
— (Array<String>
)The IDs of the findings to update.
resourceArn
— (String
)The ARN of the resource identified in the finding.
status
— (String
)The state represents the action to take to update the finding Status. Use
Possible values include:ARCHIVE
to change an Active finding to an Archived finding. UseACTIVE
to change an Archived finding to an Active finding."ACTIVE"
"ARCHIVED"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs.
-
(AWS.Response)
—
Returns:
validatePolicy(params = {}, callback) ⇒ AWS.Request
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.
Service Reference:
Examples:
Calling the validatePolicy operation
var params = {
policyDocument: 'STRING_VALUE', /* required */
policyType: IDENTITY_POLICY | RESOURCE_POLICY | SERVICE_CONTROL_POLICY, /* required */
locale: DE | EN | ES | FR | IT | JA | KO | PT_BR | ZH_CN | ZH_TW,
maxResults: 'NUMBER_VALUE',
nextToken: 'STRING_VALUE'
};
accessanalyzer.validatePolicy(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Parameters:
-
params
(Object)
(defaults to: {})
—
locale
— (String
)The locale to use for localizing the findings.
Possible values include:"DE"
"EN"
"ES"
"FR"
"IT"
"JA"
"KO"
"PT_BR"
"ZH_CN"
"ZH_TW"
maxResults
— (Integer
)The maximum number of results to return in the response.
nextToken
— (String
)A token used for pagination of results returned.
policyDocument
— (String
)The JSON policy document to use as the content for the policy.
policyType
— (String
)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.
Possible values include:"IDENTITY_POLICY"
"RESOURCE_POLICY"
"SERVICE_CONTROL_POLICY"
Callback (callback):
-
function(err, data) { ... }
Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.
Context (this):
-
(AWS.Response)
—
the response object containing error, data properties, and the original request object.
Parameters:
-
err
(Error)
—
the error object returned from the request. Set to
null
if the request is successful. -
data
(Object)
—
the de-serialized data returned from the request. Set to
null
if a request error occurs. Thedata
object has the following properties:findings
— (Array<map>
)The list of findings in a policy returned by IAM Access Analyzer based on its suite of policy checks.
findingDetails
— required — (String
)A localized message that explains the finding and provides guidance on how to address it.
findingType
— required — (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.
Possible values include:"ERROR"
"SECURITY_WARNING"
"SUGGESTION"
"WARNING"
issueCode
— required — (String
)The issue code provides an identifier of the issue associated with this finding.
learnMoreLink
— required — (String
)A link to additional documentation about the type of finding.
locations
— required — (Array<map>
)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.
path
— required — (Array<map>
)A path in a policy, represented as a sequence of path elements.
index
— (Integer
)Refers to an index in a JSON array.
key
— (String
)Refers to a key in a JSON object.
substring
— (map
)Refers to a substring of a literal string in a JSON object.
length
— required — (Integer
)The length of the substring.
start
— required — (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
— required — (map
)A span in a policy.
end
— required — (map
)The end position of the span (exclusive).
column
— required — (Integer
)The column of the position, starting from 0.
line
— required — (Integer
)The line of the position, starting from 1.
offset
— required — (Integer
)The offset within the policy that corresponds to the position, starting from 0.
start
— required — (map
)The start position of the span (inclusive).
column
— required — (Integer
)The column of the position, starting from 0.
line
— required — (Integer
)The line of the position, starting from 1.
offset
— required — (Integer
)The offset within the policy that corresponds to the position, starting from 0.
nextToken
— (String
)A token used for pagination of results returned.
-
(AWS.Response)
—
Returns: