Identity-based policy examples for AWS Audit Manager
By default, users and roles don't have permission to create or modify Audit Manager resources. They also can't perform tasks by using the AWS Management Console, AWS Command Line Interface (AWS CLI), or AWS API. To grant users permission to perform actions on the resources that they need, an IAM administrator can create IAM policies. The administrator can then add the IAM policies to roles, and users can assume the roles.
To learn how to create an IAM identity-based policy by using these example JSON policy documents, see Create IAM policies (console) in the IAM User Guide.
For details about actions and resource types defined by AWS Audit Manager, including the format of the ARNs for each of the resource types, see Actions, resources, and condition keys for AWS Audit Manager in the Service Authorization Reference.
Contents
- Policy best practices
- Allow the minimum permissions required to enable Audit Manager
- Allow users full administrator access to AWS Audit Manager
- Allow users management access to AWS Audit Manager
- Allow users read-only access to AWS Audit Manager
- Allow users to view their own permissions
- Allow AWS Audit Manager to send notifications to Amazon SNS topics
- Allow users to run search queries in evidence finder
Policy best practices
Identity-based policies determine whether someone can create, access, or delete Audit Manager resources in your account. These actions can incur costs for your AWS account. When you create or edit identity-based policies, follow these guidelines and recommendations:
-
Get started with AWS managed policies and move toward least-privilege permissions – To get started granting permissions to your users and workloads, use the AWS managed policies that grant permissions for many common use cases. They are available in your AWS account. We recommend that you reduce permissions further by defining AWS customer managed policies that are specific to your use cases. For more information, see AWS managed policies or AWS managed policies for job functions in the IAM User Guide.
-
Apply least-privilege permissions – When you set permissions with IAM policies, grant only the permissions required to perform a task. You do this by defining the actions that can be taken on specific resources under specific conditions, also known as least-privilege permissions. For more information about using IAM to apply permissions, see Policies and permissions in IAM in the IAM User Guide.
-
Use conditions in IAM policies to further restrict access – You can add a condition to your policies to limit access to actions and resources. For example, you can write a policy condition to specify that all requests must be sent using SSL. You can also use conditions to grant access to service actions if they are used through a specific AWS service, such as AWS CloudFormation. For more information, see IAM JSON policy elements: Condition in the IAM User Guide.
-
Use IAM Access Analyzer to validate your IAM policies to ensure secure and functional permissions – IAM Access Analyzer validates new and existing policies so that the policies adhere to the IAM policy language (JSON) and IAM best practices. IAM Access Analyzer provides more than 100 policy checks and actionable recommendations to help you author secure and functional policies. For more information, see Validate policies with IAM Access Analyzer in the IAM User Guide.
-
Require multi-factor authentication (MFA) – If you have a scenario that requires IAM users or a root user in your AWS account, turn on MFA for additional security. To require MFA when API operations are called, add MFA conditions to your policies. For more information, see Secure API access with MFA in the IAM User Guide.
For more information about best practices in IAM, see Security best practices in IAM in the IAM User Guide.
Allow the minimum permissions required to enable Audit Manager
This example shows how you might allow accounts without an administrator role to enable AWS Audit Manager.
Note
What we provide here is a basic policy that grants the minimum permissions needed to enable Audit Manager. All of the permissions in the following policy are required. If you omit any part of this policy, you won't be able to enable Audit Manager.
We recommend that you take time to customize your permissions so they meet
your specific needs. If you need help, contact your administrator or AWS Support
To grant the minimum access required to enable Audit Manager, use the following permissions.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "auditmanager:*", "Resource": "*" }, { "Effect": "Allow", "Action": "iam:CreateServiceLinkedRole", "Resource": "*", "Condition": { "StringLike": { "iam:AWSServiceName": "auditmanager.amazonaws.com" } } }, { "Sid": "CreateEventsAccess", "Effect": "Allow", "Action": [ "events:PutRule" ], "Resource": "*", "Condition": { "ForAllValues:StringEquals": { "events:source": [ "aws.securityhub" ] } } }, { "Sid": "EventsAccess", "Effect": "Allow", "Action": [ "events:PutTargets" ], "Resource": "arn:aws:events:*:*:rule/AuditManagerSecurityHubFindingsReceiver" }, { "Effect": "Allow", "Action": "kms:ListAliases", "Resource": "*", "Condition": { "StringLike": { "iam:AWSServiceName": "auditmanager.amazonaws.com" } } } ] }
You don't need to allow minimum console permissions for users that are making calls only to the AWS CLI or the AWS API. Instead, allow access to only the actions that match the API operation that you're trying to perform.
Allow users full administrator access to AWS Audit Manager
The following example policies grant full administrator access to AWS Audit Manager.
Example 1 (Managed
policy, AWSAuditManagerAdministratorAccess
)
The AWSAuditManagerAdministratorAccess policy includes the ability to enable and disable Audit Manager, the ability to change Audit Manager settings, and the ability to manage all Audit Manager resources such as assessments, frameworks, controls, and assessment reports.
Example 2 (Assessment report destination permissions)
This policy grants you permission to access a specific S3 bucket, and to add files to and delete files from it. This allows you to use the specified bucket as an assessment report destination in Audit Manager.
Replace the placeholder text
with your own
information. Include the S3 bucket that you use as your assessment report
destination and the KMS key that you use to encrypt your assessment
reports.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject", "s3:ListBucket", "s3:DeleteObject", "s3:GetBucketLocation", "s3:PutObjectAcl" ], "Resource": "arn:aws:s3:::
amzn-s3-demo-destination-bucket
/*" } ] }, { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "kms:Decrypt", "kms:Encrypt", "kms:GenerateDataKey" ], "Resource": "arn:aws:kms:us-west-2
:111122223333
:key/1234abcd-12ab-34cd-56ef-1234567890ab
" } ] }
Example 3 (Export destination permissions)
The following policy allows CloudTrail to deliver evidence finder query results to
the specified S3 bucket. As a security best practice, the IAM global condition
key aws:SourceArn
helps ensure that CloudTrail writes to the S3 bucket
only for the event data store.
Replace the placeholder text
with your own
information, as follows:
-
Replace
amzn-s3-demo-destination-bucket
with the S3 bucket that you use as your export destination. -
Replace
myQueryRunningRegion
with the appropriate AWS Region for your configuration. -
Replace
myAccountID
with the AWS account ID that's used for CloudTrail. This might not be the same as the AWS account ID for the S3 bucket. If this is an organization event data store, you must use the AWS account for the management account.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "cloudtrail.amazonaws.com" }, "Action": [ "s3:PutObject*", "s3:Abort*" ], "Resource": [ "arn:aws:s3:::
amzn-s3-demo-destination-bucket
", "arn:aws:s3:::amzn-s3-demo-destination-bucket
/*" ], "Condition": { "StringEquals": { "AWS:SourceArn": "arn:aws:cloudtrail:myQueryRunningRegion
:myAccountID
:eventdatastore/*" } } }, { "Effect": "Allow", "Principal": { "Service": "cloudtrail.amazonaws.com" }, "Action": "s3:GetBucketAcl", "Resource": "arn:aws:s3:::amzn-s3-demo-destination-bucket
", "Condition": { "StringEquals": { "AWS:SourceArn": "arn:aws:cloudtrail:myQueryRunningRegion
:myAccountID
:eventdatastore/*" } } }, { "Effect": "Allow", "Principal": { "Service": "cloudtrail.amazonaws.com" }, "Action": [ "kms:Decrypt*", "kms:GenerateDataKey*" ], "Resource": "*" }, { "Effect": "Allow", "Principal": { "Service": "s3.amazonaws.com" }, "Action": [ "kms:Decrypt*", "kms:GenerateDataKey*" ], "Resource": "*" } ] }
Example 4 (Permissions to enable evidence finder)
The following permission policy is required if you want to enable and use the evidence finder feature. This policy statement allows Audit Manager to create a CloudTrail Lake event data store and run search queries.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ManageCloudTrailLakeQueryAccess", "Effect": "Allow", "Action": [ "cloudtrail:StartQuery", "cloudtrail:DescribeQuery", "cloudtrail:GetQueryResults", "cloudtrail:CancelQuery" ], "Resource": "arn:aws:cloudtrail:*:*:eventdatastore/*" }, { "Sid": "ManageCloudTrailLakeAccess", "Effect": "Allow", "Action": [ "cloudtrail:CreateEventDataStore" ], "Resource": "arn:aws:cloudtrail:*:*:eventdatastore/*" } ] }
Example 5 (Permissions to disable evidence finder)
This example policy grants permission to disable the evidence finder feature in Audit Manager. This involves deleting the event data store that was created when you first enabled the feature.
Before you use this policy, replace the placeholder
text
with your own information. You should specify the UUID of
the event data store that was created when you enabled evidence finder. You can
retrieve the ARN of the event data store from your Audit Manager settings. For more
information, see GetSettings in the AWS Audit Manager API
Reference.
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "cloudtrail:DeleteEventDataStore", "cloudtrail:UpdateEventDataStore" ], "Resource": "
arn:aws:cloudtrail:::event-data-store-UUID
" } ] }
Allow users management access to AWS Audit Manager
This example shows how you might allow non-administrator management access to AWS Audit Manager.
This policy grants the ability to manage all Audit Manager resources (assessments, frameworks, and controls), but does not grant the ability to enable or disable Audit Manager or to modify Audit Manager settings.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AuditManagerAccess", "Effect": "Allow", "Action": [ "auditmanager:AssociateAssessmentReportEvidenceFolder", "auditmanager:BatchAssociateAssessmentReportEvidence", "auditmanager:BatchCreateDelegationByAssessment", "auditmanager:BatchDeleteDelegationByAssessment", "auditmanager:BatchDisassociateAssessmentReportEvidence", "auditmanager:BatchImportEvidenceToAssessmentControl", "auditmanager:CreateAssessment", "auditmanager:CreateAssessmentFramework", "auditmanager:CreateAssessmentReport", "auditmanager:CreateControl", "auditmanager:DeleteControl", "auditmanager:DeleteAssessment", "auditmanager:DeleteAssessmentFramework", "auditmanager:DeleteAssessmentFrameworkShare", "auditmanager:DeleteAssessmentReport", "auditmanager:DisassociateAssessmentReportEvidenceFolder", "auditmanager:GetAccountStatus", "auditmanager:GetAssessment", "auditmanager:GetAssessmentFramework", "auditmanager:GetControl", "auditmanager:GetServicesInScope", "auditmanager:GetSettings", "auditmanager:GetAssessmentReportUrl", "auditmanager:GetChangeLogs", "auditmanager:GetDelegations", "auditmanager:GetEvidence", "auditmanager:GetEvidenceByEvidenceFolder", "auditmanager:GetEvidenceFileUploadUrl", "auditmanager:GetEvidenceFolder", "auditmanager:GetEvidenceFoldersByAssessment", "auditmanager:GetEvidenceFoldersByAssessmentControl", "auditmanager:GetInsights", "auditmanager:GetInsightsByAssessment", "auditmanager:GetOrganizationAdminAccount", "auditmanager:ListAssessments", "auditmanager:ListAssessmentReports", "auditmanager:ListControls", "auditmanager:ListKeywordsForDataSource", "auditmanager:ListNotifications", "auditmanager:ListAssessmentControlInsightsByControlDomain", "auditmanager:ListAssessmentFrameworks", "auditmanager:ListAssessmentFrameworkShareRequests", "auditmanager:ListControlDomainInsights", "auditmanager:ListControlDomainInsightsByAssessment", "auditmanager:ListControlInsightsByControlDomain", "auditmanager:ListTagsForResource", "auditmanager:StartAssessmentFrameworkShare", "auditmanager:TagResource", "auditmanager:UntagResource", "auditmanager:UpdateControl", "auditmanager:UpdateAssessment", "auditmanager:UpdateAssessmentControl", "auditmanager:UpdateAssessmentControlSetStatus", "auditmanager:UpdateAssessmentFramework", "auditmanager:UpdateAssessmentFrameworkShare", "auditmanager:UpdateAssessmentStatus", "auditmanager:ValidateAssessmentReportIntegrity" ], "Resource": "*" }, { "Sid": "ControlCatalogAccess", "Effect": "Allow", "Action": [ "controlcatalog:ListCommonControls", "controlcatalog:ListDomains", "controlcatalog:ListObjectives" ], "Resource": "*" }, { "Sid": "OrganizationsAccess", "Effect": "Allow", "Action": [ "organizations:ListAccountsForParent", "organizations:ListAccounts", "organizations:DescribeOrganization", "organizations:DescribeOrganizationalUnit", "organizations:DescribeAccount", "organizations:ListParents", "organizations:ListChildren" ], "Resource": "*" }, { "Sid": "IAMAccess", "Effect": "Allow", "Action": [ "iam:GetUser", "iam:ListUsers", "iam:ListRoles" ], "Resource": "*" }, { "Sid": "S3Access", "Effect": "Allow", "Action": [ "s3:ListAllMyBuckets" ], "Resource": "*" }, { "Sid": "KmsAccess", "Effect": "Allow", "Action": [ "kms:DescribeKey", "kms:ListKeys", "kms:ListAliases" ], "Resource": "*" }, { "Sid": "SNSAccess", "Effect": "Allow", "Action": [ "sns:ListTopics" ], "Resource": "*" }, { "Sid": "TagAccess", "Effect": "Allow", "Action": [ "tag:GetResources" ], "Resource": "*" } ] }
Allow users read-only access to AWS Audit Manager
This policy grants read-only access to AWS Audit Manager resources such as assessments, frameworks, and controls.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AuditManagerAccess", "Effect": "Allow", "Action": [ "auditmanager:Get*", "auditmanager:List*" ], "Resource": "*" } ] }
Allow users to view their own permissions
This example shows how you might create a policy that allows IAM users to view the inline and managed policies that are attached to their user identity. This policy includes permissions to complete this action on the console or programmatically using the AWS CLI or AWS API.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ViewOwnUserInfo", "Effect": "Allow", "Action": [ "iam:GetUserPolicy", "iam:ListGroupsForUser", "iam:ListAttachedUserPolicies", "iam:ListUserPolicies", "iam:GetUser" ], "Resource": ["arn:aws:iam::*:user/${aws:username}"] }, { "Sid": "NavigateInConsole", "Effect": "Allow", "Action": [ "iam:GetGroupPolicy", "iam:GetPolicyVersion", "iam:GetPolicy", "iam:ListAttachedGroupPolicies", "iam:ListGroupPolicies", "iam:ListPolicyVersions", "iam:ListPolicies", "iam:ListUsers" ], "Resource": "*" } ] }
Allow AWS Audit Manager to send notifications to Amazon SNS topics
The policies in this example grant Audit Manager permissions to send notifications to an existing Amazon SNS topic.
-
Example 1 – If you want to receive notifications from Audit Manager, use this example to add permissions to your SNS topic access policy.
-
Example 2 – If your SNS topic uses AWS Key Management Service (AWS KMS) for server-side encryption (SSE), use this example to add permissions to the KMS key access policy.
In the following policies, the principal who gets the permissions is the Audit Manager
service principal, which is auditmanager.amazonaws.com
. When the
principal in a policy statement is an AWS service principal, we strongly recommend that
you use the aws:SourceArn
or aws:SourceAccount
global condition
keys in the policy. You can use these global condition context keys to help prevent
the confused deputy scenario.
Example 1 (Permissions for the SNS topic)
This policy statement allows Audit Manager to publish events to the specified SNS topic. Any request to publish to the specified SNS topic must satisfy the policy conditions.
Before using this policy, replace the placeholder
text
with your own information. Take note of the
following:
-
If you use the
aws:SourceArn
condition key in this policy, the value must be the ARN of the Audit Manager resource that the notification comes from. In the example below,aws:SourceArn
uses a wildcard (*
) for the resource ID. This allows all requests that come from Audit Manager on all Audit Manager resources. With theaws:SourceArn
global condition key, you can use either theStringLike
or theArnLike
condition operator. As a best practice, we recommend that you useArnLike
. -
If you use the
aws:SourceAccount
condition key, you can use either theStringEquals
or theStringLike
condition operator. As a best practice, we recommend that you useStringEquals
to implement least privilege. -
If you use both
aws:SourceAccount
andaws:SourceArn
, the account values must show the same account ID.
{ "Version": "2012-10-17", "Statement": { "Sid": "AllowAuditManagerToUseSNSTopic", "Effect": "Allow", "Principal": { "Service": "auditmanager.amazonaws.com" }, "Action": "SNS:Publish", "Resource": "arn:aws:sns:
region
:accountID
:topicName
", "Condition": { "StringEquals": { "aws:SourceAccount": "accountID
" }, "ArnLike": { "aws:SourceArn": "arn:aws:auditmanager:region
:accountID
:*
" } } } }
The following alternative example uses just the aws:SourceArn
condition key, with the StringLike
condition operator:
"Condition": { "StringLike": { "aws:SourceArn": "arn:aws:auditmanager:
region
:accountID
:*" } }
The following alternative example uses just the aws:SourceAccount
condition key, with the StringLike
condition operator:
"Condition": { "StringLike": { "aws:SourceAccount": "
accountID
" } }
Example 2 (Permissions for the KMS key that's attached to the SNS topic)
This policy statement allows Audit Manager to use the KMS key to generate the data key that it uses to encrypt an SNS topic. Any request to use the KMS key for the specified operation must satisfy the policy conditions.
Before using this policy, replace the placeholder
text
with your own information. Take note of the
following:
-
If you use the
aws:SourceArn
condition key in this policy, the value must be the ARN of the resource that’s being encrypted. For example, in this case, it's the SNS topic in your account. Set the value to the ARN or an ARN pattern with wildcard characters (*
). You can use either theStringLike
or theArnLike
condition operator with theaws:SourceArn
condition key. As a best practice, we recommend that you useArnLike
. -
If you use the
aws:SourceAccount
condition key, you can use either theStringEquals
or theStringLike
condition operator. As a best practice, we recommend that you useStringEquals
to implement least privilege. You can useaws:SourceAccount
if you don't know the ARN of the SNS topic. -
If you use both
aws:SourceAccount
andaws:SourceArn
, the account values must show the same account ID.
{ "Version": "2012-10-17", "Statement": { "Sid": "AllowAuditManagerToUseKMSKey", "Effect": "Allow", "Principal": { "Service": "auditmanager.amazonaws.com" }, "Action": [ "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": "arn:aws:kms:
region
:accountID
:key/*", "Condition": { "StringEquals": { "aws:SourceAccount": "accountID
" } "ArnLike": { "aws:SourceArn": "arn:aws:sns:region
:accountID
:topicName
" } } } ] }
The following alternative example uses just the aws:SourceArn
condition key, with the StringLike
condition operator:
"Condition": { "StringLike": { "aws:SourceArn": "arn:aws:sns:
region
:accountID
:topicName" } }
The following alternative example uses just the aws:SourceAccount
condition key, with the StringLike
condition operator:
"Condition": { "StringLike": { "aws:SourceAccount": "
accountID
" } }
Allow users to run search queries in evidence finder
The following policy grants permissions to perform queries on a CloudTrail Lake event data store. This permission policy is required if you want to use the evidence finder feature.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "ManageCloudTrailLakeQueryAccess", "Effect": "Allow", "Action": [ "cloudtrail:StartQuery", "cloudtrail:DescribeQuery", "cloudtrail:GetQueryResults", "cloudtrail:CancelQuery" ], "Resource": "*" } ] }