Skip to content

fix(security): force TLS on the RDS connection (parameter group + sslmode=require)#72

Open
Androz2091 wants to merge 1 commit intomainfrom
fix/rds-force-ssl
Open

fix(security): force TLS on the RDS connection (parameter group + sslmode=require)#72
Androz2091 wants to merge 1 commit intomainfrom
fix/rds-force-ssl

Conversation

@Androz2091
Copy link
Copy Markdown
Member

Two-sided fix from the security review:

  • New aws_db_parameter_group with rds.force_ssl=1 (server refuses plaintext).
  • ?sslmode=require appended to the POSTGRES_URL secret (client refuses plaintext).

Both together close the gap. Static parameter, so the change takes effect on next Postgres reboot (RDS handles it during the next maintenance window, or you can force a reboot from the console after applying).

Two-sided enforcement so there's no plaintext gap:

- New aws_db_parameter_group with rds.force_ssl=1. The server refuses
  any non-TLS connection. Static parameter; takes effect on next
  Postgres reboot (RDS does it during the maintenance window or you
  can force it via the console).
- Append ?sslmode=require to the POSTGRES_URL secret. SQLAlchemy /
  psycopg2 will refuse to negotiate plaintext on its end.

Without sslmode=require, psycopg2 will accept plaintext if the server
allows it; without rds.force_ssl, the server allows plaintext if the
client asks for it. Both flips together close the loop.
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.

1 participant