fix(security): stop publishing the API to the internet in cleartext - #49
Merged
Merged
Conversation
The server published 14372 on 0.0.0.0 and the VCN allowed it from 0.0.0.0/0, so http://<public ip>:14372 reached the API directly: no TLS, no Cloudflare, and a login sent that way travelled in the clear. Nothing needs it. The tunnel connector dials out and reaches the container over the cloudflare network by name; the only other users of the port are runbook curls on 127.0.0.1, which still work. Publish on loopback, and drop the ingress rule. SSH and the ICMP rules are untouched — the provider rewrites the whole list, so the plan shows four rules removed and three added back. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
compose.prod.ymlpublished14372:8080on all interfaces, and the VCN's default security list allowed TCP 14372 from0.0.0.0/0. Sohttp://<public ip>:14372reached the production API directly — no TLS, no Cloudflare in front of it. Anything sent over that path, including a login, travelled in cleartext.The host firewall allowed it too.
Why nothing needs it
The tunnel connector dials out to Cloudflare and reaches the server over the
cloudflaredocker network by name — the live ingress rule isapi.voltius.app -> http://voltius-server:8080. The admin dashboard talks tohttps://api.voltius.app. The only other users of the port are the runbookcurls against127.0.0.1, which keep working.The change
127.0.0.1:14372instead of0.0.0.0.14372ingress rule from the security list.SSH and the two ICMP rules are untouched. The provider rewrites the rule list as a unit, so the plan reads
0 to add, 1 to change, 0 to destroywith four rules removed and three added back — verified rule by rule before applying.Applying this needs a container recreate (a few seconds of downtime) and the host firewall rule dropped separately.
🤖 Generated with Claude Code