Skip to content

Commit 5c88b5f

Browse files
authored
Allow scanning volumes with customer-managed-key (#139)
We need to be able to read and copy from snapshots originating from CreateSnapshot. When reaching for these snapshots the kms:EncryptionContext for key aws:ebs:id is the originating volume. reference: https://github.com/awsdocs/aws-kms-developer-guide/blob/master/doc_source/services-ebs.md#amazon-ebs-encryption-context
1 parent 8704184 commit 5c88b5f

File tree

1 file changed

+2
-14
lines changed
  • modules/scanning-delegate-role

1 file changed

+2
-14
lines changed

modules/scanning-delegate-role/main.tf

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -205,19 +205,13 @@ data "aws_iam_policy_document" "scanning_orchestrator_policy_document" {
205205
resources = ["arn:${data.aws_partition.current.partition}:kms:*:*:key/*"]
206206

207207
// The following conditions enforce that decrypt action
208-
// can only be performed on snapshots from calls by ebs API.
208+
// can only be performed from calls by ebs API.
209209
condition {
210210
test = "ForAnyValue:StringEquals"
211211
variable = "kms:EncryptionContextKeys"
212212
values = ["aws:ebs:id"]
213213
}
214214

215-
condition {
216-
test = "StringLike"
217-
variable = "kms:EncryptionContext:aws:ebs:id"
218-
values = ["snap-*"]
219-
}
220-
221215
condition {
222216
test = "StringLike"
223217
variable = "kms:ViaService"
@@ -378,19 +372,13 @@ data "aws_iam_policy_document" "scanning_worker_policy_document" {
378372
resources = ["arn:${data.aws_partition.current.partition}:kms:*:*:key/*"]
379373

380374
// The following conditions enforce that decrypt action
381-
// can only be performed on snapshots from calls by ebs API.
375+
// can only be performed from calls by ebs API.
382376
condition {
383377
test = "ForAnyValue:StringEquals"
384378
variable = "kms:EncryptionContextKeys"
385379
values = ["aws:ebs:id"]
386380
}
387381

388-
condition {
389-
test = "StringLike"
390-
variable = "kms:EncryptionContext:aws:ebs:id"
391-
values = ["snap-*"]
392-
}
393-
394382
condition {
395383
test = "StringLike"
396384
variable = "kms:ViaService"

0 commit comments

Comments
 (0)