Skip to content

Commit

Permalink
Merge branch 'master' of github.e.it.census.gov:terraform-modules/aws…
Browse files Browse the repository at this point in the history
…-t26-s3 into initial
  • Loading branch information
Don Badrak committed Jun 22, 2020
2 parents aa0c90b + 21fa43b commit 237be6d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,38 @@ resource "aws_s3_bucket" "this" {
prevent_destroy = true
}

data "aws_iam_policy_document" "t26_s3" {
statement {
sid = "DenyIncorrectEncryptionHeader"
effect = "Deny"
actions = ["s3:PutObject"]
principals {
type = "AWS"
identifiers = ["*"]
}
resources = ["${aws_s3_bucket.t26.arn}/*"]
condition {
test = "StringNotEquals"
variable = "s3:x-amz-server-side-encryption"
values = ["aws:kms"]
}
}
statement {
sid = "DenyUnEncryptedObjectUploads"
effect = "Deny"
actions = ["s3:PutObject"]
principals {
type = "AWS"
identifiers = ["*"]
}
resources = ["${aws_s3_bucket.t26.arn}/*"]
condition {
test = "Null"
variable = "s3:x-amz-server-side-encryption"
values = ["true"]
}
}

tags = merge(
var.tags,
local.enforced_tags,
Expand Down

0 comments on commit 237be6d

Please sign in to comment.