Skip to content

fix(infra): harden prod RDS instance — disable public access, encrypt at rest, remove hardcoded password - #123

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

fix(infra): harden prod RDS instance — disable public access, encrypt at rest, remove hardcoded password#123
hacktron-app-stg[bot] wants to merge 1 commit into
add-terraform-infrafrom
hacktron/fix-f8705a60

Conversation

@hacktron-app-stg

Copy link
Copy Markdown

Vulnerability

infra.tf defined the production RDS instance aws_db_instance.prod with:

  • publicly_accessible = true — the database is reachable from the public internet.
  • storage_encrypted = false — data at rest is unencrypted.
  • password = "SuperSecret123!" — a hardcoded master credential committed to source.

Together these let any internet-facing attacker connect to and compromise the database using credentials that are visible in version control.

Fix

  • publicly_accessible = false so the instance is no longer exposed to the internet.
  • storage_encrypted = true to encrypt data at rest.
  • Introduced a new sensitive input variable db_password and reference it via var.db_password, removing the literal secret from source. The value must be supplied out-of-band (e.g. TF_VAR_db_password or a secrets manager).

Verification

  • Reviewed the full infra.tf and confirmed the change is scoped to the prod RDS resource plus the supporting variable declaration.
  • terraform is not available in the sandbox, so terraform validate/fmt could not be run; the change is standard HCL and preserves the file's existing style.

Automated fix by Hacktron for finding: https://staging.hacktron.ai/testestesttest/findings/f8705a60-6184-4c64-8b1b-2dad7c4f4ea4

Disable public accessibility and enable storage encryption on
aws_db_instance.prod, and replace the hardcoded master password with a
sensitive db_password input variable so the secret is no longer stored
in source control.
@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