Skip to content

Commit

Permalink
Merge pull request #32 from liranbenabu1/main
Browse files Browse the repository at this point in the history
add s3:DeleteObject permission while av_delete_infected_files equals true
  • Loading branch information
esacteksab authored Nov 4, 2022
2 parents 4cfb1fd + 3f95ca4 commit 20b0df8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions anti-virus-scan.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ data "aws_iam_policy_document" "main_scan" {
actions = [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:PutLogEvents"
]

resources = ["arn:${data.aws_partition.current.partition}:logs:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:log-group:/aws/lambda/${var.name_scan}:*"]
Expand All @@ -40,13 +40,13 @@ data "aws_iam_policy_document" "main_scan" {

effect = "Allow"

actions = [
actions = concat([
"s3:GetObject",
"s3:GetObjectTagging",
"s3:GetObjectVersion",
"s3:PutObjectTagging",
"s3:PutObjectVersionTagging",
]
"s3:PutObjectVersionTagging"
],var.av_delete_infected_files ? ["s3:DeleteObject"] : [])

resources = formatlist("%s/*", data.aws_s3_bucket.main_scan.*.arn)
}
Expand Down

0 comments on commit 20b0df8

Please sign in to comment.