AWS CloudTrail
用户指南 (版本 1.0)
AWS 文档中描述的 AWS 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 Amazon AWS 入门

在 CloudTrail 控制台中创建的默认密钥策略

如果您在 CloudTrail 控制台中创建客户主密钥 (CMK),则会自动为您创建以下策略。该策略允许以下权限:

  • 允许 AWS 账户(根账户)对 CMK 的权限

  • 允许 CloudTrail 在 CMK 下加密日志文件和描述 CMK

  • 允许指定账户中的所有用户解密日志文件

  • 允许指定账户中的所有用户为 CMK 创建 KMS 别名

{ "Version": "2012-10-17", "Id": "Key policy created by CloudTrail", "Statement": [ { "Sid": "Enable IAM User Permissions", "Effect": "Allow", "Principal": {"AWS": [ "arn:aws-cn:iam::aws-account-id:root", "arn:aws-cn:iam::aws-account-id:user/username" ]}, "Action": "kms:*", "Resource": "*" }, { "Sid": "Allow CloudTrail to encrypt logs", "Effect": "Allow", "Principal": {"Service": ["cloudtrail.amazonaws.com.cn"]}, "Action": "kms:GenerateDataKey*", "Resource": "*", "Condition": {"StringLike": {"kms:EncryptionContext:aws:cloudtrail:arn": "arn:aws-cn:cloudtrail:*:aws-account-id:trail/*"}} }, { "Sid": "Allow CloudTrail to describe key", "Effect": "Allow", "Principal": {"Service": ["cloudtrail.amazonaws.com.cn"]}, "Action": "kms:DescribeKey", "Resource": "*" }, { "Sid": "Allow principals in the account to decrypt log files", "Effect": "Allow", "Principal": {"AWS": "*"}, "Action": [ "kms:Decrypt", "kms:ReEncryptFrom" ], "Resource": "*", "Condition": { "StringEquals": {"kms:CallerAccount": "aws-account-id"}, "StringLike": {"kms:EncryptionContext:aws:cloudtrail:arn": "arn:aws-cn:cloudtrail:*:aws-account-id:trail/*"} } }, { "Sid": "Allow alias creation during setup", "Effect": "Allow", "Principal": {"AWS": "*"}, "Action": "kms:CreateAlias", "Resource": "*", "Condition": {"StringEquals": { "kms:ViaService": "ec2.region.amazonaws.com.cn", "kms:CallerAccount": "aws-account-id" }} }, { "Sid": "Enable cross account log decryption", "Effect": "Allow", "Principal": {"AWS": "*"}, "Action": [ "kms:Decrypt", "kms:ReEncryptFrom" ], "Resource": "*", "Condition": { "StringEquals": {"kms:CallerAccount": "aws-account-id"}, "StringLike": {"kms:EncryptionContext:aws:cloudtrail:arn": "arn:aws-cn:cloudtrail:*:aws-account-id:trail/*"} } } ] }

注意

该策略的最后一条语句允许使用 CMK 跨账户解密日志文件。