Identity-based policy examples for AWS Audit Manager - AWS Audit Manager

Identity-based policy examples for AWS Audit Manager

By default, IAM users and roles don't have permission to create or modify AWS Audit Manager resources. They also can't perform tasks using the AWS Management Console, AWS CLI, or AWS API. An IAM administrator must create IAM policies that grant users and roles permission to perform actions on the resources that they need. The administrator must then attach those policies to the IAM users or groups that require those permissions.

To learn how to create an IAM identity-based policy using these example JSON policy documents, see Creating policies on the JSON tab in the IAM User Guide.

Policy best practices

Identity-based policies are very powerful. They determine whether someone can create, access, or delete AWS 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 using AWS managed policies – To start using AWS Audit Manager quickly, use AWS managed policies to give your employees the permissions they need. These policies are already available in your account and are maintained and updated by AWS. For more information, see Get started using permissions with AWS managed policies in the IAM User Guide.

  • Grant least privilege – When you create custom policies, grant only the permissions required to perform a task. Start with a minimum set of permissions and grant additional permissions as necessary. Doing so is more secure than starting with permissions that are too lenient and then trying to tighten them later. For more information, see Grant least privilege in the IAM User Guide.

  • Enable MFA for sensitive operations – For extra security, require IAM users to use multi-factor authentication (MFA) to access sensitive resources or API operations. For more information, see Using multi-factor authentication (MFA) in AWS in the IAM User Guide.

  • Use policy conditions for extra security – To the extent that it's practical, define the conditions under which your identity-based policies allow access to a resource. For example, you can write conditions to specify a range of allowable IP addresses that a request must come from. You can also write conditions to allow requests only within a specified date or time range, or to require the use of SSL or MFA. For more information, see IAM JSON policy elements: Condition in the IAM User Guide.

Example 1: Minimum permissions required to enable AWS Audit Manager

This example shows how you might allow accounts without an administrator role to enable AWS Audit Manager. This is a basic policy that grants the minimum permissions needed to enable Audit Manager.

To grant the minimum permissions required to use Audit Manager, attach the following policy to an IAM identity. For more information about how to attach a policy to an IAM identity, see Adding Permissions to a User and Adding and removing IAM identity permissions in the IAM User Guide.

{ "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": { "StringEquals": { "events:source": "aws.securityhub", "events:detail-type": "Security Hub Findings - Imported" } } }, { "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.

Example 2: Allow IAM users full administrator access to AWS Audit Manager

The policies in this example grant full administrator access to AWS Audit Manager. This includes the ability to enable and disable Audit Manager, the ability to change settings in Audit Manager, and the ability to manage all Audit Manager resources such as assessments, frameworks, controls, and assessment reports.

The first policy in this example is the managed policy, AWSAuditManagerAdministratorAccess. The second policy in this example provides permissions for the Amazon S3 bucket that you use as an assessment report destination in AWS Audit Manager.

Policy 1 (Managed policy, AWSAuditManagerAdministratorAccess)

{ "Version": "2012-10-17", "Statement": [ { "Sid": "AuditManagerAccess", "Effect": "Allow", "Action": [ "auditmanager:*" ], "Resource": "*" }, { "Sid": "OrganizationsAccess", "Effect": "Allow", "Action": [ "organizations:ListAccountsForParent", "organizations:ListAccounts", "organizations:DescribeOrganization", "organizations:DescribeOrganizationalUnit", "organizations:DescribeAccount", "organizations:ListParents", "organizations:ListChildren" ], "Resource": "*" }, { "Sid": "AllowOnlyAuditManagerIntegration", "Effect": "Allow", "Action": [ "organizations:RegisterDelegatedAdministrator", "organizations:DeregisterDelegatedAdministrator", "organizations:EnableAWSServiceAccess" ], "Resource": "*", "Condition": { "StringLikeIfExists": { "organizations:ServicePrincipal": [ "auditmanager.amazonaws.com" ] } } }, { "Sid": "IAMAccess", "Effect": "Allow", "Action": [ "iam:GetUser", "iam:ListUsers", "iam:ListRoles" ], "Resource": "*" }, { "Sid": "IAMAccessCreateSLR", "Effect": "Allow", "Action": "iam:CreateServiceLinkedRole", "Resource": "arn:aws:iam::*:role/aws-service-role/auditmanager.amazonaws.com/AWSServiceRoleForAuditManager*", "Condition": { "StringLike": { "iam:AWSServiceName": "auditmanager.amazonaws.com" } } }, { "Sid": "IAMAccessManageSLR", "Effect": "Allow", "Action": [ "iam:DeleteServiceLinkedRole", "iam:UpdateRoleDescription", "iam:GetServiceLinkedRoleDeletionStatus" ], "Resource": "arn:aws:iam::*:role/aws-service-role/auditmanager.amazonaws.com/AWSServiceRoleForAuditManager*" }, { "Sid": "S3Access", "Effect": "Allow", "Action": [ "s3:ListAllMyBuckets" ], "Resource": "*" }, { "Sid": "KmsAccess", "Effect": "Allow", "Action": [ "kms:DescribeKey", "kms:ListKeys", "kms:ListAliases" ], "Resource": "*" }, { "Sid": "KmsCreateGrantAccess", "Effect": "Allow", "Action": [ "kms:CreateGrant" ], "Resource": "*", "Condition": { "Bool": { "kms:GrantIsForAWSResource": "true" }, "StringLike": { "kms:ViaService": "auditmanager.*.amazonaws.com" } } }, { "Sid": "SNSAccess", "Effect": "Allow", "Action": [ "sns:ListTopics" ], "Resource": "*" }, { "Sid": "CreateEventsAccess", "Effect": "Allow", "Action": [ "events:PutRule" ], "Resource": "*", "Condition": { "StringEquals": { "events:source": "aws.securityhub", "events:detail-type": "Security Hub Findings - Imported" } } }, { "Sid": "EventsAccess", "Effect": "Allow", "Action": [ "events:DeleteRule", "events:DescribeRule", "events:EnableRule", "events:DisableRule", "events:ListTargetsByRule", "events:PutTargets", "events:RemoveTargets" ], "Resource": "arn:aws:events:*:*:rule/AuditManagerSecurityHubFindingsReceiver" }, { "Sid": "TagAccess", "Effect": "Allow", "Action": [ "tag:GetResources" ], "Resource": "*" } ] }

Policy 2 (Assessment report destination permissions)

Replace the placeholders with your own information. You should include the S3 bucket that you specified when you created an assessment report destination in AWS Audit Manager, and the key used 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:::assessment-reports-destination/*" } ] }, { "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: Allow IAM 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:GetAccountStatus", "auditmanager:ListAssessmentFrameworks", "auditmanager:CreateAssessmentFramework", "auditmanager:GetAssessmentFramework", "auditmanager:UpdateAssessmentFramework", "auditmanager:DeleteAssessmentFramework", "auditmanager:ListAssessmentReports", "auditmanager:ListAssessments", "auditmanager:CreateAssessment", "auditmanager:ListControls", "auditmanager:CreateControl", "auditmanager:GetControl", "auditmanager:UpdateControl", "auditmanager:DeleteControl", "auditmanager:ListKeywordsForDataSource", "auditmanager:GetDelegations", "auditmanager:ValidateAssessmentReportIntegrity", "auditmanager:ListNotifications", "auditmanager:GetServicesInScope", "auditmanager:GetSettings", "auditmanager:ListTagsForResource", "auditmanager:TagResource", "auditmanager:UntagResource" ], "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": "*" } ] }

Example 4: Allow IAM users read-only access to AWS Audit Manager

This example is for the managed policy AWSAuditManagerReadOnlyAccess.

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": "*" } ] }

Example 5: 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": "*" } ] }

Example 6: Allow AWS Audit Manager to send notifications to Amazon SNS topics

This policy grants AWS Audit Manager permissions to send notifications to an existing Amazon SNS topic. If you want to receive notifications from Audit Manager, attach the following permissions to the access policy of your Amazon SNS topic. You must substitute appropriate values for region, account-id, and myTopic.

{ "Version": "2008-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": "auditmanager.amazonaws.com" }, "Action": "SNS:Publish", "Resource": "arn:aws:sns:region:account-id:myTopic" } ] }