fix(security): bind primary admin and monitoring ports to the tailnet address #75

Open
Muse wants to merge 2 commits from security/primary-service-binds into main
Owner

From the 2026-11-03 security audit: Prometheus (9090) and Node Exporter (9102) answer on primary's public IP with no authentication, and the Grafana (3002) and Nginx Proxy Manager admin (81) login pages are public as well. Verified still exposed on 2026-11-14.

This change binds those published ports to the tailnet address only, using the same ${PRIMARY_TAILSCALE_IP} pattern already in use for Loki (primary-tools) and Technitium (primary-networking-security):

  • primary-tools: grafana 3002, prometheus 9090, node-exporter 9102
  • primary-networking-security: npm admin 81 (80/443 stay public — that is the reverse proxy; 25565 stays public — Minecraft)
  • primary-networking-security: pocket-id 1411 (see below)
  • master: same monitoring binds, kept in sync as in earlier changes

Access after the change: the UIs stay reachable at their corebot.ca domains (the reverse proxy reaches the containers over mystic-net, not via the host ports) and directly over Tailscale. Prometheus scraping is unaffected — it targets node-exporter, cadvisor and docker-exporter by service name on the internal network.

Pocket ID note: the SSO sign-in itself stays public at sso.corebot.ca through the reverse proxy, by design — browsers have to reach it to sign in. Only the redundant direct port publish (1411 on the public IP) closes; nothing in the sign-in flow uses it, since the OIDC issuer and all app integrations use the domain.

Deliberately out of scope: Uptime Kuma 3001 (public status is intended), docker-exporter 8082 (separate decision), and Komodo Core 9120 — Core is not defined in this repo (it runs from a standalone compose file outside the stacks) and is handled separately.

Deploy after merge, one service at a time via Komodo DeployStackService: primary-tools (grafana, prometheus, node-exporter only — do not deploy the whole stack) and primary-networking-security (npm and pocket-id only; recreating npm briefly interrupts the reverse proxy). Verify after each: the port stops answering on the public IP and still answers on the tailnet address.

From the 2026-11-03 security audit: Prometheus (9090) and Node Exporter (9102) answer on primary's public IP with no authentication, and the Grafana (3002) and Nginx Proxy Manager admin (81) login pages are public as well. Verified still exposed on 2026-11-14. This change binds those published ports to the tailnet address only, using the same ${PRIMARY_TAILSCALE_IP} pattern already in use for Loki (primary-tools) and Technitium (primary-networking-security): - primary-tools: grafana 3002, prometheus 9090, node-exporter 9102 - primary-networking-security: npm admin 81 (80/443 stay public — that is the reverse proxy; 25565 stays public — Minecraft) - primary-networking-security: pocket-id 1411 (see below) - master: same monitoring binds, kept in sync as in earlier changes Access after the change: the UIs stay reachable at their corebot.ca domains (the reverse proxy reaches the containers over mystic-net, not via the host ports) and directly over Tailscale. Prometheus scraping is unaffected — it targets node-exporter, cadvisor and docker-exporter by service name on the internal network. Pocket ID note: the SSO sign-in itself stays public at sso.corebot.ca through the reverse proxy, by design — browsers have to reach it to sign in. Only the redundant direct port publish (1411 on the public IP) closes; nothing in the sign-in flow uses it, since the OIDC issuer and all app integrations use the domain. Deliberately out of scope: Uptime Kuma 3001 (public status is intended), docker-exporter 8082 (separate decision), and Komodo Core 9120 — Core is not defined in this repo (it runs from a standalone compose file outside the stacks) and is handled separately. Deploy after merge, one service at a time via Komodo DeployStackService: primary-tools (grafana, prometheus, node-exporter only — do not deploy the whole stack) and primary-networking-security (npm and pocket-id only; recreating npm briefly interrupts the reverse proxy). Verify after each: the port stops answering on the public IP and still answers on the tailnet address.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'security/primary-service-binds:security/primary-service-binds'
git switch 'security/primary-service-binds'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'security/primary-service-binds'
git switch 'security/primary-service-binds'
git rebase 'main'
git switch 'main'
git merge --ff-only 'security/primary-service-binds'
git switch 'security/primary-service-binds'
git rebase 'main'
git switch 'main'
git merge --no-ff 'security/primary-service-binds'
git switch 'main'
git merge --squash 'security/primary-service-binds'
git switch 'main'
git merge --ff-only 'security/primary-service-binds'
git switch 'main'
git merge 'security/primary-service-binds'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
CoreBotLabs/infra!75
No description provided.