Skip to content

Commit

Permalink
add decrypt to cloudtrail policy
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Nov 26, 2021
1 parent 918785d commit 98eb072
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cloudtrail-key/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ data "aws_iam_policy_document" "key" {
sid = "CloudTrailKMSEncryptAccess"
effect = "Allow"
actions = [
"kms:Decrypt*",
"kms:Encrypt*",
"kms:ReEncrypt*",
"kms:GenerateDataKey",
Expand All @@ -266,19 +267,19 @@ data "aws_iam_policy_document" "key" {
type = "Service"
identifiers = ["cloudtrail.amazonaws.com"]
}
condition {
test = "StringLike"
variable = "kms:EncryptionContext:aws:cloudtrail:arn"
values = [format("arn:%v:cloudtrail:*:%v:trail/*", local.partition, local.account_id)]
}
# condition {
# test = "StringLike"
# variable = "kms:EncryptionContext:aws:cloudtrail:arn"
# values = [format("arn:%v:cloudtrail:*:%v:trail/*", local.partition, local.account_id)]
# }
}
# https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html
statement {
sid = "Cloudwatch"
effect = "Allow"
actions = [
"kms:Encrypt*",
"kms:Decrypt*",
"kms:Encrypt*",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:Describe*"
Expand Down

0 comments on commit 98eb072

Please sign in to comment.