Repository navigation
fix(security): bind postgres to loopback - #1715
Starling-spell wants to merge 3 commits into
Conversation
|
This PR targeted I retargeted it to |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches
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 |
Redis runs without auth and the official image disables protected-mode, so publishing it on all interfaces has the same exposure as postgres. Services reach both over the compose network, not the host port.
|
Thanks! I refreshed the branch onto current |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
danieljrc888
left a comment
There was a problem hiding this comment.
Reviewed for the v0.123 release candidate; unit suite and CI green.
|
/run-e2e all Frozen landing cut: #1715 alone, head |
Lands four reviewed fork PRs together after a full E2E run on this exact head: - #1765: redact validator private keys from call receipts and explorer payloads - #1715: bind postgres, redis and ollama host ports to loopback - #1773: normalize addresses in raw-SQL balance operations - #1789: normalize the address in sim_fundAccount Co-authored-by: Kanan <93033289+kriss39@users.noreply.github.com> Co-authored-by: Starling <82058629+Starling-spell@users.noreply.github.com> Co-authored-by: Alicepoltora <Alicepoltora@users.noreply.github.com>
Refs #1603 (the
genlayerCLI compose is fixed separately in genlayer-cli#423)What
127.0.0.1DBHOSTPORTconfigurable for local toolingdocker-compose.ymland enforces the loopback-only mapping${REDISPORT:-6379}, no auth) and Ollama (11434) to127.0.0.1; services reach both over the compose networkWhy
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: 3 passedtests/unit/overv0.123-dev@c489e7c2: 1675 passed, 7 skippeddocker compose configvalidatesgit 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, Redis and Ollama started by GenLayer Studio's Docker Compose now listen on the local machine only by default, preventing accidental public exposure on VPS and cloud hosts.