Skip to content

Commit

Permalink
Merge pull request #1564 from ministryofjustice/MLPAB-2567-sqs-kms-ch…
Browse files Browse the repository at this point in the history
…ange

MLPAB-2567 Add decrypt kms permissions for sqs
  • Loading branch information
hawx authored Oct 22, 2024
2 parents d82c2bb + adf42b0 commit 9fbac76
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion terraform/account/kms_key_sqs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,26 @@ data "aws_iam_policy_document" "sqs_kms" {
]
}
}

statement {
sid = "Allow Breakglass to Decrypt"
effect = "Allow"
resources = [
"arn:aws:kms:*:${data.aws_caller_identity.global.account_id}:key/*"
]
actions = [
"kms:Decrypt",
"kms:GenerateDataKey*",
"kms:DescribeKey",
]

principals {
type = "AWS"
identifiers = [
"arn:aws:iam::${data.aws_caller_identity.global.account_id}:role/breakglass",
]
}
}
}

data "aws_iam_policy_document" "sqs_kms_development_account_operator_admin" {
Expand All @@ -143,7 +163,10 @@ data "aws_iam_policy_document" "sqs_kms_development_account_operator_admin" {
"kms:TagResource",
"kms:UntagResource",
"kms:ScheduleKeyDeletion",
"kms:CancelKeyDeletion"
"kms:CancelKeyDeletion",
"kms:Decrypt",
"kms:GenerateDataKey*",
"kms:DescribeKey",
]

principals {
Expand Down

0 comments on commit 9fbac76

Please sign in to comment.