Skip to content

fix(providers): bind provisioned service ports to 127.0.0.1 instead of 0.0.0.0 - #190

Merged
dviejokfs merged 2 commits into
gotempsh:mainfrom
bherila:fix/soc2-provisioned-service-port-binding-upstream-pr
Jul 4, 2026
Merged

dviejokfs merged 2 commits into
gotempsh:mainfrom
bherila:fix/soc2-provisioned-service-port-binding-upstream-pr

Conversation

@bherila

@bherila bherila commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What

Managed services provisioned by Temps (Postgres, Redis, MongoDB, S3/RustFS) were binding their Docker-published ports to 0.0.0.0 — publicly reachable on any host without an external firewall in front of it — while docs/howto/set-up-managed-services already claims "All ports are bound to 127.0.0.1 only." This closes that gap so the code actually matches the documented behavior.

Factored the binding logic into a single crate::utils::local_port_binding helper (with tests asserting it never returns 0.0.0.0), used consistently by postgres.rs, redis.rs, s3.rs, rustfs.rs (both its data and console ports), and postgres_lifecycle.rs — a fifth call site the original audit had missed.

Also cleans up docs/advanced/security to remove references to a temps firewall CLI command and a config/settings.yml file, neither of which exists in this codebase (tracked as part of bherila#37).

Why

Self-hosting hardening pass (applies to anyone running Temps for a production workload, not specific to any one deployment) — tracked in bherila#29 and part of bherila#37.

Testing

  • cargo check --lib -p temps-providers: clean, zero warnings.
  • cargo test --lib -p temps-providers: 238 passed, 0 failed (includes 2 new tests for the port-binding helper).

@dviejokfs

Copy link
Copy Markdown
Contributor

@bherila could you fix the formatting for this PR and the others that are also failing?

@bherila

bherila commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

yes everything will be fixed up. sorry my codespace timed out and left unfinished work

…f 0.0.0.0

Managed Postgres/Redis/MongoDB/S3(RustFS) containers were publishing
their ports to 0.0.0.0 -- publicly reachable on any host without an
external firewall -- while docs/howto/set-up-managed-services already
claimed they were bound to 127.0.0.1 only. Factor the binding logic
into a single crate::utils::local_port_binding helper used by every
provider, so there's one place that can leak 0.0.0.0 instead of five.

Also removes/marks-aspirational the `temps firewall` CLI and
config/settings.yml claims in docs/advanced/security -- neither exists
in the codebase.
@bherila
bherila force-pushed the fix/soc2-provisioned-service-port-binding-upstream-pr branch from 5c14297 to 06d2883 Compare July 3, 2026 19:52
@dviejokfs
dviejokfs merged commit dc97c4d into gotempsh:main Jul 4, 2026
12 checks passed
@bherila
bherila deleted the fix/soc2-provisioned-service-port-binding-upstream-pr branch July 5, 2026 22:44
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.

2 participants