Skip to content

Commit 3ebc715

Browse files
bazbremnermaximmiactions-bot
authored
Extend S3 bucket policy to ensure encryption-in-transit (#43)
* Extend S3 bucket policy to ensure encryption-in-transit Whilst the current option policy ensures server-side encryption, encryption of the transport mechanism isn't enforced. This change extends the S3 bucket policy to enforce encryption in transit, which is necessary to satisfy the s3-bucket-ssl-requests-only AWS Config Rule[1] Given the option to prevent unencrypted uploads is already present, and this change fits in the spirit of that, I've not introduced a separate flag for this behaviour. [1] https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-ssl-requests-only.html * fix rebuild-readme issue * fix rebuild-readme issue * Updated README.md * revert actions workflow Co-authored-by: Maxim Mironenko <[email protected]> Co-authored-by: actions-bot <[email protected]>
1 parent 7a0f82a commit 3ebc715

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ We deliver 10x the value for a fraction of the cost of a full-time engineer. Our
258258

259259
Join our [Open Source Community][slack] on Slack. It's **FREE** for everyone! Our "SweetOps" community is where you get to talk with others who share a similar vision for how to rollout and manage infrastructure. This is the best place to talk shop, ask questions, solicit feedback, and work together as a community to build totally *sweet* infrastructure.
260260

261+
## Discourse Forums
262+
263+
Participate in our [Discourse Forums][discourse]. Here you'll find answers to commonly asked questions. Most questions will be related to the enormous number of projects we support on our GitHub. Come here to collaborate on answers, find solutions, and get ideas about the products and services we value. It only takes a minute to get started! Just sign in with SSO using your GitHub account.
264+
261265
## Newsletter
262266

263267
Sign up for [our newsletter][newsletter] that covers everything on our technology radar. Receive updates on what we're up to on GitHub as well as awesome new projects we discover.
@@ -373,6 +377,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
373377
[testimonial]: https://cpco.io/leave-testimonial?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-tfstate-backend&utm_content=testimonial
374378
[office_hours]: https://cloudposse.com/office-hours?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-tfstate-backend&utm_content=office_hours
375379
[newsletter]: https://cpco.io/newsletter?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-tfstate-backend&utm_content=newsletter
380+
[discourse]: https://ask.sweetops.com/?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-tfstate-backend&utm_content=discourse
376381
[email]: https://cpco.io/email?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-tfstate-backend&utm_content=email
377382
[commercial_support]: https://cpco.io/commercial-support?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-tfstate-backend&utm_content=commercial_support
378383
[we_love_open_source]: https://cpco.io/we-love-open-source?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-tfstate-backend&utm_content=we_love_open_source

main.tf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,30 @@ data "aws_iam_policy_document" "prevent_unencrypted_uploads" {
9595
]
9696
}
9797
}
98+
99+
statement {
100+
sid = "EnforceTlsRequestsOnly"
101+
102+
effect = "Deny"
103+
104+
principals {
105+
type = "AWS"
106+
identifiers = ["*"]
107+
}
108+
109+
actions = ["s3:*"]
110+
111+
resources = [
112+
"${var.arn_format}:s3:::${local.bucket_name}",
113+
"${var.arn_format}:s3:::${local.bucket_name}/*",
114+
]
115+
116+
condition {
117+
test = "Bool"
118+
variable = "aws:SecureTransport"
119+
values = ["false"]
120+
}
121+
}
98122
}
99123

100124
resource "aws_s3_bucket" "default" {

0 commit comments

Comments
 (0)