Skip to content

fix(infra): make backups S3 bucket private and block public access#121

Open
hacktron-app-stg[bot] wants to merge 1 commit into
add-terraform-infrafrom
hacktron/fix-e5b5944b
Open

fix(infra): make backups S3 bucket private and block public access#121
hacktron-app-stg[bot] wants to merge 1 commit into
add-terraform-infrafrom
hacktron/fix-e5b5944b

Conversation

@hacktron-app-stg

Copy link
Copy Markdown

Vulnerability

infra.tf defined the aws_s3_bucket.backups bucket (corp-prod-backups) with acl = "public-read", and the associated aws_s3_bucket_public_access_block explicitly disabled all four public-access protections (block_public_acls, block_public_policy, ignore_public_acls, restrict_public_buckets were all false). This made any object stored in the bucket — including production backups — readable by unauthenticated users over the internet.

Fix

  • Removed the acl = "public-read" argument from aws_s3_bucket.backups.
  • Added an explicit aws_s3_bucket_acl resource set to private (the modern, non-deprecated way to manage bucket ACLs).
  • Set all four aws_s3_bucket_public_access_block flags to true, guaranteeing public ACLs/policies are blocked and ignored.

The change is scoped to the reported finding (lines 4–15); the other resources in the file are left untouched.

Verification

Reviewed the resulting configuration for correctness against AWS provider idioms. Terraform is not installed in the sandbox, so terraform validate/plan could not be run, but the change uses standard, current provider resources and arguments.


Automated fix by Hacktron for finding: https://staging.hacktron.ai/testestesttest/findings/e5b5944b-951d-4deb-9327-41ddf305cb86

Remove the public-read ACL from the corp-prod-backups bucket, set an
explicit private ACL, and enable all public access block protections so
backup objects are no longer exposed to the public internet.
@hacktron-app-stg
hacktron-app-stg Bot requested a review from maekuss July 23, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants