AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Implementation for accessing AccessAnalyzer

Identity and Access Management Access Analyzer helps you to set, verify, and refine your IAM policies by providing a suite of capabilities. Its features include findings for external and unused access, basic and custom policy checks for validating policies, and policy generation to generate fine-grained policies. To start using IAM Access Analyzer to identify external or unused access, you first need to create an analyzer.

External access analyzers help identify potential risks of accessing resources by enabling you to identify any resource 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 public and cross-account access to your resources before deploying permissions changes.

Unused access analyzers help identify potential identity access risks by enabling you to identify unused IAM roles, unused access keys, unused console passwords, and IAM principals with unused service and action-level permissions.

Beyond findings, IAM Access Analyzer provides basic and custom policy checks to validate IAM policies before deploying permissions changes. You can use policy generation to refine permissions by attaching a policy generated using access activity logged in CloudTrail logs.

This guide describes the IAM 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.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.AmazonServiceClient
    Amazon.AccessAnalyzer.AmazonAccessAnalyzerClient

Namespace: Amazon.AccessAnalyzer
Assembly: AWSSDK.AccessAnalyzer.dll
Version: 3.x.y.z

Syntax

C#
public class AmazonAccessAnalyzerClient : AmazonServiceClient
         IAmazonAccessAnalyzer, IAmazonService, IDisposable

The AmazonAccessAnalyzerClient type exposes the following members

Constructors

NameDescription
Public Method AmazonAccessAnalyzerClient()

Constructs AmazonAccessAnalyzerClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonAccessAnalyzerClient(RegionEndpoint)

Constructs AmazonAccessAnalyzerClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonAccessAnalyzerClient(AmazonAccessAnalyzerConfig)

Constructs AmazonAccessAnalyzerClient with the credentials loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. Example App.config with credentials set.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSProfileName" value="AWS Default"/>
    </appSettings>
</configuration>
             

Public Method AmazonAccessAnalyzerClient(AWSCredentials)

Constructs AmazonAccessAnalyzerClient with AWS Credentials

Public Method AmazonAccessAnalyzerClient(AWSCredentials, RegionEndpoint)

Constructs AmazonAccessAnalyzerClient with AWS Credentials

Public Method AmazonAccessAnalyzerClient(AWSCredentials, AmazonAccessAnalyzerConfig)

Constructs AmazonAccessAnalyzerClient with AWS Credentials and an AmazonAccessAnalyzerClient Configuration object.

Public Method AmazonAccessAnalyzerClient(string, string)

Constructs AmazonAccessAnalyzerClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonAccessAnalyzerClient(string, string, RegionEndpoint)

Constructs AmazonAccessAnalyzerClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonAccessAnalyzerClient(string, string, AmazonAccessAnalyzerConfig)

Constructs AmazonAccessAnalyzerClient with AWS Access Key ID, AWS Secret Key and an AmazonAccessAnalyzerClient Configuration object.

Public Method AmazonAccessAnalyzerClient(string, string, string)

Constructs AmazonAccessAnalyzerClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonAccessAnalyzerClient(string, string, string, RegionEndpoint)

Constructs AmazonAccessAnalyzerClient with AWS Access Key ID and AWS Secret Key

Public Method AmazonAccessAnalyzerClient(string, string, string, AmazonAccessAnalyzerConfig)

Constructs AmazonAccessAnalyzerClient with AWS Access Key ID, AWS Secret Key and an AmazonAccessAnalyzerClient Configuration object.

Properties

NameTypeDescription
Public Property Config Amazon.Runtime.IClientConfig Inherited from Amazon.Runtime.AmazonServiceClient.
Public Property Paginators Amazon.AccessAnalyzer.Model.IAccessAnalyzerPaginatorFactory

Paginators for the service

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method ApplyArchiveRule(ApplyArchiveRuleRequest)

Retroactively applies the archive rule to existing findings that meet the archive rule criteria.

Public Method ApplyArchiveRuleAsync(ApplyArchiveRuleRequest, CancellationToken)

Retroactively applies the archive rule to existing findings that meet the archive rule criteria.

Public Method CancelPolicyGeneration(CancelPolicyGenerationRequest)

Cancels the requested policy generation.

Public Method CancelPolicyGenerationAsync(CancelPolicyGenerationRequest, CancellationToken)

Cancels the requested policy generation.

Public Method CheckAccessNotGranted(CheckAccessNotGrantedRequest)

Checks whether the specified access isn't allowed by a policy.

Public Method CheckAccessNotGrantedAsync(CheckAccessNotGrantedRequest, CancellationToken)

Checks whether the specified access isn't allowed by a policy.

Public Method CheckNoNewAccess(CheckNoNewAccessRequest)

Checks whether new access is allowed for an updated policy when compared to the existing policy.

You can find examples for reference policies and learn how to set up and run a custom policy check for new access in the IAM Access Analyzer custom policy checks samples repository on GitHub. The reference policies in this repository are meant to be passed to the existingPolicyDocument request parameter.

Public Method CheckNoNewAccessAsync(CheckNoNewAccessRequest, CancellationToken)

Checks whether new access is allowed for an updated policy when compared to the existing policy.

You can find examples for reference policies and learn how to set up and run a custom policy check for new access in the IAM Access Analyzer custom policy checks samples repository on GitHub. The reference policies in this repository are meant to be passed to the existingPolicyDocument request parameter.

Public Method CreateAccessPreview(CreateAccessPreviewRequest)

Creates an access preview that allows you to preview IAM Access Analyzer findings for your resource before deploying resource permissions.

Public Method CreateAccessPreviewAsync(CreateAccessPreviewRequest, CancellationToken)

Creates an access preview that allows you to preview IAM Access Analyzer findings for your resource before deploying resource permissions.

Public Method CreateAnalyzer(CreateAnalyzerRequest)

Creates an analyzer for your account.

Public Method CreateAnalyzerAsync(CreateAnalyzerRequest, CancellationToken)

Creates an analyzer for your account.

Public Method CreateArchiveRule(CreateArchiveRuleRequest)

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.

Public Method CreateArchiveRuleAsync(CreateArchiveRuleRequest, CancellationToken)

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.

Public Method DeleteAnalyzer(DeleteAnalyzerRequest)

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.

Public Method DeleteAnalyzerAsync(DeleteAnalyzerRequest, CancellationToken)

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.

Public Method DeleteArchiveRule(DeleteArchiveRuleRequest)

Deletes the specified archive rule.

Public Method DeleteArchiveRuleAsync(DeleteArchiveRuleRequest, CancellationToken)

Deletes the specified archive rule.

Public Method DetermineServiceOperationEndpoint(AmazonWebServiceRequest)

Returns the endpoint that will be used for a particular request.

Public Method Dispose() Inherited from Amazon.Runtime.AmazonServiceClient.
Public Method GetAccessPreview(GetAccessPreviewRequest)

Retrieves information about an access preview for the specified analyzer.

Public Method GetAccessPreviewAsync(GetAccessPreviewRequest, CancellationToken)

Retrieves information about an access preview for the specified analyzer.

Public Method GetAnalyzedResource(GetAnalyzedResourceRequest)

Retrieves information about a resource that was analyzed.

Public Method GetAnalyzedResourceAsync(GetAnalyzedResourceRequest, CancellationToken)

Retrieves information about a resource that was analyzed.

Public Method GetAnalyzer(GetAnalyzerRequest)

Retrieves information about the specified analyzer.

Public Method GetAnalyzerAsync(GetAnalyzerRequest, CancellationToken)

Retrieves information about the specified analyzer.

Public Method GetArchiveRule(GetArchiveRuleRequest)

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.

Public Method GetArchiveRuleAsync(GetArchiveRuleRequest, CancellationToken)

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.

Public Method GetFinding(GetFindingRequest)

Retrieves information about the specified finding. GetFinding and GetFindingV2 both use access-analyzer:GetFinding in the Action element of an IAM policy statement. You must have permission to perform the access-analyzer:GetFinding action.

Public Method GetFindingAsync(GetFindingRequest, CancellationToken)

Retrieves information about the specified finding. GetFinding and GetFindingV2 both use access-analyzer:GetFinding in the Action element of an IAM policy statement. You must have permission to perform the access-analyzer:GetFinding action.

Public Method GetFindingV2(GetFindingV2Request)

Retrieves information about the specified finding. GetFinding and GetFindingV2 both use access-analyzer:GetFinding in the Action element of an IAM policy statement. You must have permission to perform the access-analyzer:GetFinding action.

Public Method GetFindingV2Async(GetFindingV2Request, CancellationToken)

Retrieves information about the specified finding. GetFinding and GetFindingV2 both use access-analyzer:GetFinding in the Action element of an IAM policy statement. You must have permission to perform the access-analyzer:GetFinding action.

Public Method GetGeneratedPolicy(GetGeneratedPolicyRequest)

Retrieves the policy that was generated using StartPolicyGeneration.

Public Method GetGeneratedPolicyAsync(GetGeneratedPolicyRequest, CancellationToken)

Retrieves the policy that was generated using StartPolicyGeneration.

Public Method ListAccessPreviewFindings(ListAccessPreviewFindingsRequest)

Retrieves a list of access preview findings generated by the specified access preview.

Public Method ListAccessPreviewFindingsAsync(ListAccessPreviewFindingsRequest, CancellationToken)

Retrieves a list of access preview findings generated by the specified access preview.

Public Method ListAccessPreviews(ListAccessPreviewsRequest)

Retrieves a list of access previews for the specified analyzer.

Public Method ListAccessPreviewsAsync(ListAccessPreviewsRequest, CancellationToken)

Retrieves a list of access previews for the specified analyzer.

Public Method ListAnalyzedResources(ListAnalyzedResourcesRequest)

Retrieves a list of resources of the specified type that have been analyzed by the specified external access analyzer. This action is not supported for unused access analyzers.

Public Method ListAnalyzedResourcesAsync(ListAnalyzedResourcesRequest, CancellationToken)

Retrieves a list of resources of the specified type that have been analyzed by the specified external access analyzer. This action is not supported for unused access analyzers.

Public Method ListAnalyzers(ListAnalyzersRequest)

Retrieves a list of analyzers.

Public Method ListAnalyzersAsync(ListAnalyzersRequest, CancellationToken)

Retrieves a list of analyzers.

Public Method ListArchiveRules(ListArchiveRulesRequest)

Retrieves a list of archive rules created for the specified analyzer.

Public Method ListArchiveRulesAsync(ListArchiveRulesRequest, CancellationToken)

Retrieves a list of archive rules created for the specified analyzer.

Public Method ListFindings(ListFindingsRequest)

Retrieves a list of findings generated by the specified analyzer. ListFindings and ListFindingsV2 both use access-analyzer:ListFindings in the Action element of an IAM policy statement. You must have permission to perform the access-analyzer:ListFindings action.

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.

Public Method ListFindingsAsync(ListFindingsRequest, CancellationToken)

Retrieves a list of findings generated by the specified analyzer. ListFindings and ListFindingsV2 both use access-analyzer:ListFindings in the Action element of an IAM policy statement. You must have permission to perform the access-analyzer:ListFindings action.

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.

Public Method ListFindingsV2(ListFindingsV2Request)

Retrieves a list of findings generated by the specified analyzer. ListFindings and ListFindingsV2 both use access-analyzer:ListFindings in the Action element of an IAM policy statement. You must have permission to perform the access-analyzer:ListFindings action.

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.

Public Method ListFindingsV2Async(ListFindingsV2Request, CancellationToken)

Retrieves a list of findings generated by the specified analyzer. ListFindings and ListFindingsV2 both use access-analyzer:ListFindings in the Action element of an IAM policy statement. You must have permission to perform the access-analyzer:ListFindings action.

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.

Public Method ListPolicyGenerations(ListPolicyGenerationsRequest)

Lists all of the policy generations requested in the last seven days.

Public Method ListPolicyGenerationsAsync(ListPolicyGenerationsRequest, CancellationToken)

Lists all of the policy generations requested in the last seven days.

Public Method ListTagsForResource(ListTagsForResourceRequest)

Retrieves a list of tags applied to the specified resource.

Public Method ListTagsForResourceAsync(ListTagsForResourceRequest, CancellationToken)

Retrieves a list of tags applied to the specified resource.

Public Method StartPolicyGeneration(StartPolicyGenerationRequest)

Starts the policy generation request.

Public Method StartPolicyGenerationAsync(StartPolicyGenerationRequest, CancellationToken)

Starts the policy generation request.

Public Method StartResourceScan(StartResourceScanRequest)

Immediately starts a scan of the policies applied to the specified resource.

Public Method StartResourceScanAsync(StartResourceScanRequest, CancellationToken)

Immediately starts a scan of the policies applied to the specified resource.

Public Method TagResource(TagResourceRequest)

Adds a tag to the specified resource.

Public Method TagResourceAsync(TagResourceRequest, CancellationToken)

Adds a tag to the specified resource.

Public Method UntagResource(UntagResourceRequest)

Removes a tag from the specified resource.

Public Method UntagResourceAsync(UntagResourceRequest, CancellationToken)

Removes a tag from the specified resource.

Public Method UpdateArchiveRule(UpdateArchiveRuleRequest)

Updates the criteria and values for the specified archive rule.

Public Method UpdateArchiveRuleAsync(UpdateArchiveRuleRequest, CancellationToken)

Updates the criteria and values for the specified archive rule.

Public Method UpdateFindings(UpdateFindingsRequest)

Updates the status for the specified findings.

Public Method UpdateFindingsAsync(UpdateFindingsRequest, CancellationToken)

Updates the status for the specified findings.

Public Method ValidatePolicy(ValidatePolicyRequest)

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.

Public Method ValidatePolicyAsync(ValidatePolicyRequest, CancellationToken)

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.

Events

NameDescription
Event AfterResponseEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event BeforeRequestEvent Inherited from Amazon.Runtime.AmazonServiceClient.
Event ExceptionEvent Inherited from Amazon.Runtime.AmazonServiceClient.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5