Skip to content

Commit

Permalink
Merge pull request #511 from ministryofjustice/enforce_tls_12_or_higher
Browse files Browse the repository at this point in the history
Revise bucket policy to enforce tls v1.2 or higher connections
  • Loading branch information
dms1981 authored Aug 15, 2024
2 parents f95c656 + eb12580 commit 6c10893
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,21 @@ data "aws_iam_policy_document" "default" {
override_policy_documents = concat(var.bucket_policy, [data.aws_iam_policy_document.bucket_policy_v2.json])

statement {
sid = "EnforceTLSv12orHigher"
effect = "Deny"
actions = ["s3:*"]
resources = [
aws_s3_bucket.default.arn,
"${aws_s3_bucket.default.arn}/*"
]

principals {
identifiers = ["*"]
type = "AWS"
}

condition {
test = "Bool"
variable = "aws:SecureTransport"
values = ["false"]
test = "NumericLessThan"
variable = "s3:TlsVersion"
values = [1.2]
}
}
}
Expand Down

0 comments on commit 6c10893

Please sign in to comment.