Class: AWS.AccessAnalyzer

Inherits:
AWS.Service show all
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

AWS IAM 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 AWS environment. An external principal can be another AWS account, a root user, an IAM user or role, a federated user, an AWS service, or an anonymous user. This guide describes the AWS IAM Access Analyzer operations that you can call programmatically. For general information about Access Analyzer, see the AWS IAM Access Analyzer section of the IAM User Guide.

To start using Access Analyzer, you first need to create an analyzer.

Sending a Request Using AccessAnalyzer

var accessanalyzer = new AWS.AccessAnalyzer();
accessanalyzer.createAnalyzer(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

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

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)

    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'.

  • 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.
  • 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 to true.

  • 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.
  • 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

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

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.

      • filterrequired — (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.

      • ruleNamerequired — (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 analyzers are supported. You can create only one analyzer per account 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. The data object has the following properties:

      • arn — (String)

        The ARN of the analyzer that was created by the request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createArchiveRule(params = {}, callback) ⇒ AWS.Request

Creates an archive rule for the specified analyzer. Archive rules automatically archive findings that meet the criteria you define when you create the rule.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteAnalyzer(params = {}, callback) ⇒ AWS.Request

Deletes the specified analyzer. When you delete an analyzer, Access Analyzer is disabled for the account 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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data object has the following properties:

      • resource — (map)

        An AnalyedResource object that contains information that 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.

        • analyzedAtrequired — (Date)

          The time at which the resource was analyzed.

        • createdAtrequired — (Date)

          The time at which the finding was created.

        • error — (String)

          An error message.

        • isPublicrequired — (Boolean)

          Indicates whether the policy that generated the finding grants public access to the resource.

        • resourceArnrequired — (String)

          The ARN of the resource that was analyzed.

        • resourceOwnerAccountrequired — (String)

          The AWS account ID that owns the resource.

        • resourceTyperequired — (String)

          The type of the resource that was analyzed.

          Possible values include:
          • "AWS::IAM::Role"
          • "AWS::KMS::Key"
          • "AWS::Lambda::Function"
          • "AWS::Lambda::LayerVersion"
          • "AWS::S3::Bucket"
          • "AWS::SQS::Queue"
        • 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"
        • updatedAtrequired — (Date)

          The time at which the finding was updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data object has the following properties:

      • analyzer — (map)

        An AnalyzerSummary object that contains information about the analyzer.

        • arnrequired — (String)

          The ARN of the analyzer.

        • createdAtrequired — (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.

        • namerequired — (String)

          The name of the analyzer.

        • statusrequired — (String)

          The status of the analyzer. An Active analyzer successfully monitors supported resources and generates new findings. The analyzer is Disabled when a user action, such as removing trusted access for IAM Access Analyzer from AWS Organizations, causes the analyzer to stop generating new findings. The status is Creating when the analyzer creation is in progress and Failed when the analyzer creation has failed.

          Possible values include:
          • "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, a Failed status is displayed. 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 AWS organization.

          • coderequired — (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.

        • typerequired — (String)

          The type of analyzer, which corresponds to the zone of trust chosen for the analyzer.

          Possible values include:
          • "ACCOUNT"
          • "ORGANIZATION"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getArchiveRule(params = {}, callback) ⇒ AWS.Request

Retrieves information about an archive rule.

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. The data object has the following properties:

      • archiveRule — (map)

        Contains information about an archive rule.

        • createdAtrequired — (Date)

          The time at which the archive rule was created.

        • filterrequired — (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.

        • ruleNamerequired — (String)

          The name of the archive rule.

        • updatedAtrequired — (Date)

          The time at which the archive rule was last updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data 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.

        • analyzedAtrequired — (Date)

          The time at which the resource was analyzed.

        • conditionrequired — (map<String>)

          The condition in the analyzed policy statement that resulted in a finding.

        • createdAtrequired — (Date)

          The time at which the finding was generated.

        • error — (String)

          An error.

        • idrequired — (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.

        • resourceOwnerAccountrequired — (String)

          The AWS account ID that owns the resource.

        • resourceTyperequired — (String)

          The type of the resource reported in the finding.

          Possible values include:
          • "AWS::IAM::Role"
          • "AWS::KMS::Key"
          • "AWS::Lambda::Function"
          • "AWS::Lambda::LayerVersion"
          • "AWS::S3::Bucket"
          • "AWS::SQS::Queue"
        • 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.

          • typerequired — (String)

            Indicates the type of access that generated the finding.

            Possible values include:
            • "BUCKET_ACL"
            • "POLICY"
            • "S3_ACCESS_POINT"
        • statusrequired — (String)

          The current status of the finding.

          Possible values include:
          • "ACTIVE"
          • "ARCHIVED"
          • "RESOLVED"
        • updatedAtrequired — (Date)

          The time at which the finding was updated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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::IAM::Role | AWS::KMS::Key | AWS::Lambda::Function | AWS::Lambda::LayerVersion | AWS::S3::Bucket | AWS::SQS::Queue
};
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::IAM::Role"
      • "AWS::KMS::Key"
      • "AWS::Lambda::Function"
      • "AWS::Lambda::LayerVersion"
      • "AWS::S3::Bucket"
      • "AWS::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. The data object has the following properties:

      • analyzedResources — (Array<map>)

        A list of resources that were analyzed.

        • resourceArnrequired — (String)

          The ARN of the analyzed resource.

        • resourceOwnerAccountrequired — (String)

          The AWS account ID that owns the resource.

        • resourceTyperequired — (String)

          The type of resource that was analyzed.

          Possible values include:
          • "AWS::IAM::Role"
          • "AWS::KMS::Key"
          • "AWS::Lambda::Function"
          • "AWS::Lambda::LayerVersion"
          • "AWS::S3::Bucket"
          • "AWS::SQS::Queue"
      • nextToken — (String)

        A token used for pagination of results returned.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data object has the following properties:

      • analyzers — (Array<map>)

        The analyzers retrieved.

        • arnrequired — (String)

          The ARN of the analyzer.

        • createdAtrequired — (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.

        • namerequired — (String)

          The name of the analyzer.

        • statusrequired — (String)

          The status of the analyzer. An Active analyzer successfully monitors supported resources and generates new findings. The analyzer is Disabled when a user action, such as removing trusted access for IAM Access Analyzer from AWS Organizations, causes the analyzer to stop generating new findings. The status is Creating when the analyzer creation is in progress and Failed when the analyzer creation has failed.

          Possible values include:
          • "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, a Failed status is displayed. 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 AWS organization.

          • coderequired — (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.

        • typerequired — (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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data object has the following properties:

      • archiveRules — (Array<map>)

        A list of archive rules created for the specified analyzer.

        • createdAtrequired — (Date)

          The time at which the archive rule was created.

        • filterrequired — (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.

        • ruleNamerequired — (String)

          The name of the archive rule.

        • updatedAtrequired — (Date)

          The time at which the archive rule was last updated.

      • nextToken — (String)

        A token used for pagination of results returned.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listFindings(params = {}, callback) ⇒ AWS.Request

Retrieves a list of findings generated by the specified analyzer.

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. The data 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.

        • analyzedAtrequired — (Date)

          The time at which the resource-based policy that generated the finding was analyzed.

        • conditionrequired — (map<String>)

          The condition in the analyzed policy statement that resulted in a finding.

        • createdAtrequired — (Date)

          The time at which the finding was created.

        • error — (String)

          The error that resulted in an Error finding.

        • idrequired — (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.

        • resourceOwnerAccountrequired — (String)

          The AWS account ID that owns the resource.

        • resourceTyperequired — (String)

          The type of the resource that the external principal has access to.

          Possible values include:
          • "AWS::IAM::Role"
          • "AWS::KMS::Key"
          • "AWS::Lambda::Function"
          • "AWS::Lambda::LayerVersion"
          • "AWS::S3::Bucket"
          • "AWS::SQS::Queue"
        • 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.

          • typerequired — (String)

            Indicates the type of access that generated the finding.

            Possible values include:
            • "BUCKET_ACL"
            • "POLICY"
            • "S3_ACCESS_POINT"
        • statusrequired — (String)

          The status of the finding.

          Possible values include:
          • "ACTIVE"
          • "ARCHIVED"
          • "RESOLVED"
        • updatedAtrequired — (Date)

          The time at which the finding was most recently updated.

      • nextToken — (String)

        A token used for pagination of results returned.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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. The data object has the following properties:

      • tags — (map<String>)

        The tags that are applied to the specified resource.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

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 ARCHIVE to change an Active finding to an Archived finding. Use ACTIVE to change an Archived finding to an Active finding.

      Possible values include:
      • "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.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.