Skip to content

Instantly share code, notes, and snippets.

@ystoneman
Created February 12, 2022 02:13
Show Gist options
  • Save ystoneman/b11327f1508dfdac51224f030ccc6be3 to your computer and use it in GitHub Desktop.
Save ystoneman/b11327f1508dfdac51224f030ccc6be3 to your computer and use it in GitHub Desktop.
KMS Policy WIth Permissions for CloudWatch Logs
{
"Id": "only-cloudwatch-logs",
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789012:root"
},
"Action": "kms:*",
"Resource": "*"
},
{
"Effect": "Allow",
"Principal": {
"Service": "logs.us-east-1.amazonaws.com"
},
"Action": [
"kms:Encrypt*",
"kms:Decrypt*",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:Describe*"
],
"Resource": "*",
"Condition": {
"ArnEquals": {
"kms:EncryptionContext:aws:logs:arn": "arn:aws:logs:us-east-1:123456789012:log-group:awesome-logs"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment