Skip to content

Commit

Permalink
give av scan lambda permission to decrypt objects (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpearce-digital authored Oct 19, 2023
1 parent 45e8b8d commit 05098d9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ data "aws_caller_identity" "current" {
data "aws_default_tags" "current" {
provider = aws.region
}

data "aws_kms_alias" "uploads_encryption_key" {
name = "alias/${data.aws_default_tags.current.tags.application}_reduced_fees_uploads_s3_encryption"
provider = aws.region
}
10 changes: 10 additions & 0 deletions terraform/environment/region/modules/s3_antivirus/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ data "aws_iam_policy_document" "lambda" {
]
}

statement {
sid = "allowS3ObjectDecryption"
effect = "Allow"
resources = [data.aws_kms_alias.uploads_encryption_key.target_key_arn]
actions = [
"kms:Decrypt",
"kms:DescribeKey"
]
}

statement {
sid = "allowVirusDefinitions"
effect = "Allow"
Expand Down

0 comments on commit 05098d9

Please sign in to comment.