fix(security): bind postgres to loopback - #1715
Conversation
|
This PR targeted I retargeted it to |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #1603
What
127.0.0.1DBHOSTPORTconfigurable for local toolingdocker-compose.ymland enforces the loopback-only mappingWhy
The previous
${DBHOSTPORT:-5432}:5432mapping caused Docker to publish PostgreSQL on every host interface. Combined with the development credentials, this exposed the database to unauthenticated internet attacks on publicly reachable hosts. Issue #1603 reports a real compromise that used this path to deploy a cryptominer.The new mapping preserves host access for local development while preventing remote connections by default.
Testing done
python -m pytest tests/unit/test_docker_compose_security.py -q— 1 passedgit diff --checkDecisions made
Checks
Reviewing tips
The functional change is the single port mapping in
docker-compose.yml; the unit test protects that exact security invariant.User facing release notes
PostgreSQL exposed by GenLayer Studio now listens on the local machine only by default, preventing accidental public database exposure on VPS and cloud hosts.