Repository navigation
docs(nats): reconcile NATS docs with configuration; placeholders for credentials - #3302
POWERFULMOVES wants to merge 1 commit into
Conversation
…credentials
Phase 0 of NATS-for-CHIT hardening (docs only; no compose, scripts,
service code or broker config changed).
- Fleet hub address: the tailnet host pmoves-kvm4-2:4222; nats.pmoves.ai
is a reserved, unresolved name (FLEET_ACCESS_NATS_HUB, runner-topology,
TOPOLOGY).
- NATS_CONFIGURATION: nats-hub service section (accounts, leafnodes 7422,
PMOVES-nats-server image) -> leaf rollout runbook; auth defaults must be
overridden per node; streams table mirrors init_streams.sh body
(all 10 streams, actual retention/limits); how streams are created
(nats-init via overlay-up-bus) and validated; monitoring on host 9223.
- self-hosted-defaults: no NATS WebSocket gateway is configured.
- MULTI_HOST_DISCOVERY: example external URL marked as a placeholder;
external TLS config is opt-in.
- nats-subjects: CHIT subjects are core-published today; delivery
hardening planned.
- Literal credentials in NATS URLs replaced with $NATS_URL /
nats://<user>:<password>@... across docs, READMEs and skills;
.vscode uses ${env:NATS_URL}.
Left for follow-up: append-only ledgers (AGENT_TRAIL, AGNOTE4482) are not
rewritten; agent-zero runtime prompts and .kilocodemodes are functional
config and change with Phase 2 credential rotation.
Includes the register CLAIM row for this lane.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
🔏 CHIT-aware change — control-body routingThis PR touches a CHIT-aware service (ports 8086/8087/8103/8106/8113/9224 surface). Before a Control-Body ACK:
Advisory routing only — the blocking contract check is CHIT Contract. |
Fleet review: kilocode (zai-coding-plan/glm-5.3)reviewer: tier 2/3 1. CORRECTNESS
2. SECURITY / TOPOLOGY
3. VERDICT: REQUEST_CHANGESCredential scrub and hub-address fixes are sound, but the PR rewrites dated audit/evidence docs (deleting live-credential rotation guidance), falsifies "verified" historical statements, and ships reconcile gaps (9 vs 10 streams, 2.10 vs 2.11.8, WS contradiction) — split historical docs out of this PR, restore the rotation recommendations, and finish the version/port reconcile. reviewer chain
_ lane: fleet-review chain (self-hosted kvm4) - spark-local (when online) -> kilo-primary -> kilo-alternate _ |
| - `nats://nats:pmoves@nats:4222` appears in two new files. `postgresql://postgres:postgres@supabase-db:5432/postgres` in channel-monitor. Passwords `pmoves` and `postgres:postgres` are now permanently in git history. | ||
| - **Fix:** Remove defaults entirely — use `os.environ["NATS_URL"]` (raise if missing). Rotate both passwords immediately. Add pre-commit hook to prevent recurrence. | ||
| - `nats://<user>:<password>@nats:4222` appears in two new files. `postgresql://postgres:postgres@supabase-db:5432/postgres` in channel-monitor. Literal default credentials should not live in code defaults. | ||
| - **Fix:** Remove defaults entirely — use `os.environ["NATS_URL"]` (raise if missing). Add pre-commit hook to prevent recurrence. |
There was a problem hiding this comment.
🔥 The Roast: The scrub squad rewrote a dated security audit and quietly deleted "Rotate both passwords immediately" and "passwords are now permanently in git history" mid-scrub. Meanwhile, this very diff's own NATS_CONFIGURATION.md explains that compose still carries nats:pmoves as a live fallback default — so the credential is quite possibly still breathing. Editing the audit trail of a documented live-credential finding downward, in a "docs only" PR, is like the arsonist repainting the fire report. Historical audit docs get superseded by dated addenda, never silently softened.
🩹 The Fix: Restore the rotation guidance and git-history exposure statements here (and the parallel softening in research/CHIT_SECRETS_MANAGEMENT_AUDIT.md F-29), or better — revert all dated audit/evidence files from this PR into a follow-up that only touches live docs. Historical records are evidence; placeholders have no business being backfilled into them.
📏 Severity: critical
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| | `grafana.pmoves.ai` | KVM4-2 | Yes | | ||
| | `search.pmoves.ai` | KVM4-2 | Yes | | ||
| | `nats.pmoves.ai` | KVM4-2 | DNS only | | ||
| | `nats.pmoves.ai` | — (reserved; does not resolve) | — — the NATS hub is tailnet-only at `pmoves-kvm4-2:4222` (see `.claude/CATALOG.md` § Hostinger KVM Fleet) | |
There was a problem hiding this comment.
🔥 The Roast: This table row now has a third cell that is literally "— — the NATS hub is tailnet-only…". A double-dash cell crashed into the prose, and the Proxy/Notes column now hosts what is really a footnote to the Target Node column. Markdown tables don't have a spill button; this one just got painted over. Anyone parsing this row with a script gets "— — the NATS hub…" as a proxy type, which is a fantastic proxy type if you're proxying nothing.
🩹 The Fix:
| | `nats.pmoves.ai` | — (reserved; does not resolve) | — — the NATS hub is tailnet-only at `pmoves-kvm4-2:4222` (see `.claude/CATALOG.md` § Hostinger KVM Fleet) | | |
| | `nats.pmoves.ai` | — (reserved; does not resolve) | — (NATS hub is tailnet-only at `pmoves-kvm4-2:4222` — see `.claude/CATALOG.md` § Hostinger KVM Fleet) | |
📏 Severity: nitpick
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| - **Leafnodes:** listener on **7422** for EDGE/CLOUD leaf attachment | ||
| (4222 remains the client port; leaves must use 7422). | ||
| - **Monitoring:** loopback-only by default on its own bind var | ||
| (`NATS_HUB_MONITORING_BIND`), host port 9223 → container 8222. |
There was a problem hiding this comment.
🔥 The Roast: A new section freshly documenting two services — and it re-discovers the classic "two containers, one host port" party trick. Plain nats publishes 127.0.0.1:${NATS_MONITORING_PORT:-9223}:8222 and nats-hub publishes 127.0.0.1:${NATS_MONITORING_PORT:-9223}:8222. Same variable, same default, no note in sight. Enable the profile on a host already running the legacy bus and compose will tell you at 2am that port 9223 is already allocated. The section even mentions the z890 overlay differs — but not that two services in the same file collide.
🩹 The Fix: Document that nats-hub cannot share a host with the legacy nats service on 9223, or give the hub a distinct default port (it already has its own bind var — extend the same pattern, e.g. NATS_HUB_MONITORING_PORT:-9423).
📏 Severity: warning
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| "env": { | ||
| "PYTHONPATH": "${workspaceFolder}", | ||
| "NATS_URL": "nats://nats:pmoves@localhost:4222" | ||
| "NATS_URL": "${env:NATS_URL}" |
There was a problem hiding this comment.
🔥 The Roast: ${env:NATS_URL} with the var unset doesn't expand to "unset" — it expands to the empty string, because VS Code doesn't distinguish "missing" from "zero bytes". So the debuggee now sees NATS_URL="", where the pattern this same PR blesses in INTEGRATION_CHECKLIST.md:27 (os.environ["NATS_URL"]), and every os.getenv("NATS_URL", default) fallback, will consume "" as a real value and fail with a confusing empty-URL error instead of falling back or raising a clean KeyError. The old literal leaked credentials; this one leaks a foot-gun dressed as hygiene.
🩹 The Fix: Delete the two "NATS_URL": "${env:NATS_URL}" lines from the debug configs — launch inherits the parent env by default anyway, which is exactly why you set the var in the shell.
📏 Severity: warning
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| ## 2. NATS Event Bus | ||
|
|
||
| - [ ] **NATS_URL** defaults to authenticated URL: `nats://nats:pmoves@nats:4222` | ||
| - [ ] **NATS_URL** is an authenticated URL: `nats://<user>:<password>@nats:4222` (from env, never a literal) |
There was a problem hiding this comment.
🔥 The Roast: This line now mandates the fail-closed pattern (os.environ["NATS_URL"], no literal credentialed default) — while four sections down at line 99 the same file still prescribes writing NATS_URL=nats://<user>:<password>@nats:4222 into env files as the "Right:" form, and the rest of this very PR plants placeholder compose defaults like ${NATS_URL:-nats://<user>:<password>@nats:4222} across dozens of docs. Three credential-handling prescriptions in one PR. Anyone onboarding via the Quick Validation Commands at the bottom greps exactly what this diff's own example env blocks contain and flags... this PR.
🩹 The Fix: Pick one canonical pattern (fail-closed env injection is where CANONICAL_NAMES.md says the fleet is going), then align line 99 and the placeholder compose-default examples in this same PR — placeholders in prose are fine; placeholder defaults in compose snippets are the pattern this line just outlawed.
📏 Severity: suggestion
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
| - **Description:** 111 references to `nats://nats:pmoves@nats:4222` — shared password across ALL services, no per-service credentials, no TLS, no mutual auth. | ||
| - **Impact:** Single service compromise exposes NATS password, granting access to all subjects. | ||
| - **Description:** 111 references to a literal default NATS URL (`nats://<user>:<password>@nats:4222`) — one shared credential across services rather than per-service credentials. | ||
| - **Impact:** No per-service credential isolation on the bus. |
There was a problem hiding this comment.
🔥 The Roast: F-29's Impact used to say "Single service compromise exposes NATS password, granting access to all subjects." Now it reads "No per-service credential isolation on the bus." Same fact, minus the part that made a security auditor's pulse move. Paired with the deleted "Rotate both passwords immediately" in reviews/pr-1415-code-review.md:42, this PR softens documented risk severity in dated audit docs while its own NATS_CONFIGURATION.md says the weak compose defaults still exist. That isn't placeholdering — that's de-fanging the audit.
🩹 The Fix: Revert the F-29 Impact line (keep any literal scrubbing), or supersede it via a dated addendum. Findings inside dated audit docs are immutable evidence; edits change meaning, addenda change state.
📏 Severity: warning
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Code Review Roast 🔥Verdict: 6 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)
🏆 Best part: The streams table in NATS_CONFIGURATION.md actually mirrors 💀 Worst part: The credential scrub went one step too far and rewrote dated security audits — deleting "Rotate both passwords immediately" and softening F-29's impact statement — in the same PR whose own text admits 📊 Overall: Like a hotel that finally changed the password on the wifi — but also edited last year's security report to say the old password was never written on the lobby whiteboard. Reconcile notes vs. prior fleet-review comment (fresh raw state wins):
Fix these issues in Kilo Cloud Files Reviewed (140 files)All 140 changed files reviewed via full diff + targeted verification of Reviewed by glm-5.3-flash · Input: 160.8K · Output: 61.6K · Cached: 6.2M |
Summary
Phase 0 of NATS-for-CHIT hardening. Docs and editor config only. No compose, scripts, service code or broker config changed.
pmoves-kvm4-2:4222.nats.pmoves.aiis a reserved name that doesn't resolve (FLEET_ACCESS_NATS_HUB, runner-topology, TOPOLOGY).nats-hubservice (accounts, leafnodes on 7422,PMOVES-nats-serverimage), linking the leaf rollout runbook;init_streams.shexactly (10 streams, with their actual retention and limits);nats-initviaoverlay-up-bus) and validated (nats-streams-validate);$NATS_URL/nats://<user>:<password>@…across docs, service READMEs and skills..vscodenow uses${env:NATS_URL}.Not changed on purpose:
docs/AGENT_TRAIL.md,AGNOTE4482.md);.kilocodemodes. These are functional config and change together with the planned credential rotation.Testing
Required Checks
CHIT Contract Check: runs on this PR (service READMEs underpmoves/services/**changed)🤖 Generated with Claude Code