Skip to content

build(docker): default dev service port bindings to loopback - #1168

Open
DevipriyaS17 wants to merge 2 commits into
mainfrom
docker_fix
Open

build(docker): default dev service port bindings to loopback#1168
DevipriyaS17 wants to merge 2 commits into
mainfrom
docker_fix

Conversation

@DevipriyaS17

@DevipriyaS17 DevipriyaS17 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR fixes the Docker Compose port bindings to localhost by default.

Problem

Previously, dev services were exposed on all interfaces (0.0.0.0) by default:

  • Vault: 8200
  • Postgres: 5432
  • Console App: 8181

This increased host attack surface in local dev environments and enabled unintended network access.

Validation

Executed:

  • docker compose up -d
  • docker compose ps

Observed bindings:

  • 127.0.0.1:8181->8181/tcp
  • 127.0.0.1:8200->8200/tcp
  • 127.0.0.1:5432->5432/tcp

Services are healthy and app routes initialize successfully.

To run locally

docker compose"
CONSOLE_HOST=0.0.0.0 POSTGRES_HOST=0.0.0.0 VAULT_HOST=0.0.0.0 docker compose up

go run directly
HTTP_HOST=0.0.0.0 go run ./cmd/app/ --config "./config/config.yml"

@DevipriyaS17
DevipriyaS17 requested a review from a team as a code owner July 30, 2026 13:59
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 44.45%. Comparing base (861e864) to head (c2748e8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1168   +/-   ##
=======================================
  Coverage   44.45%   44.45%           
=======================================
  Files         144      144           
  Lines       13732    13732           
=======================================
  Hits         6105     6105           
  Misses       7054     7054           
  Partials      573      573           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces local development attack surface by binding Docker Compose-published service ports to loopback (127.0.0.1) by default, while still allowing opt-out via environment variables.

Changes:

  • Updated Vault port publishing to default-bind to 127.0.0.1 via VAULT_HOST.
  • Updated Postgres port publishing to default-bind to 127.0.0.1 via POSTGRES_HOST.
  • Updated Console app port publishing to default-bind to 127.0.0.1 via CONSOLE_HOST.

@madhavilosetty-intel

Copy link
Copy Markdown
Contributor

@DevipriyaS17 change the commit message to build(docker), it is not a fix.

@DevipriyaS17 DevipriyaS17 changed the title fix(security): default dev service port bindings to loopback build(docker): default dev service port bindings to loopback Aug 4, 2026
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.

3 participants