The single TODO item (exporters as protected web servers, certs as auth, root certificate generated and managed by the collector) is now phase 15: cert management in meta, agent TLS mode, https collector dials, gated /api/certs surface, /certs admin page, installer + live rollout. LLM-Generated: true
3.6 KiB
3.6 KiB
Task 07 — The fleet runs TLS: install, flip, verify, document
Phase: 15_agent_mtls · Source: TODO.md:3 — "I want all exporters to be protected web servers. The collector should generate and manage a root certificate that needs to be installed with each exporter. Use the certs as auth to each exporter."
Objective
The two live agents (deskwork, gateway) present the dashboard-issued server cert and require the dashboard's client cert; the dashboard dials https://; the health table, the live suite, and a /certs screenshot prove it — and the still-missing driveripper install is documented to carry a bundle from day one.
Work
- Fleet (operator root actions, the
deploy/agent-sudoersgrant): fordeskworkandgateway:GET /api/certs/<name>/bundle(a signed-incurl),scpthe bundle to the host,sudo ./deploy/install-agent.sh --cert-bundle <file>,systemctl restart dashboards-agent,./deploy/install-agent.sh --statusgreen over TLS. Record the exact commands + output indata/logs/NOTES-agent-install.md(an append to the file's existing per-host record; local evidence, not tracked, the AGENTS.md rule). - The flip:
.env.dev— theHOST_TARGETSentries becomehttps://<same address>:9120(no userinfo — the cert is the auth; the token goes away for a TLS host),./scripts/dev-server.sh restart,./scripts/dev-server.sh statusshowshost:deskwork ok,host:gateway ok,disks:deskwork ok,disks:gateway ok(the twodriveripperjobs stayDOWN— unchanged, the designed degradation). - Proof (invariant 10):
uv run pytest -m live --live— the host/disks tests over thehttpspath; a/certsscreenshot (the table showing both rowsactive, issued rev == deployed rev) and a/systemscreenshot (the host rows not dimmed) indata/logs/; adata/logs/NOTES-verify.md-style note: thecurlcodes (unsigned/api/certsrefused, signed-in 200), one line for a wrong-CA client's handshake failure (the redacted URL only). - The
driveripperprocedure: an append todata/logs/NOTES-agent-install.md— when the agent is finally installed (the outstanding operator action, the AGENTS.md fleet section), install the bundle in the same invocation (sudo ./deploy/install-agent.sh --bind … --cert-bundle …) and pointHOST_TARGETSathttps://from day one; a token-only install after this phase is a host thehttps-dialing dashboard cannot reach. - Docs (the AGENTS.md definition of done): the AGENTS.md fleet section (the transport fact: the agent is now mTLS, the bundle file, the
/certspage) + the commands section (the bundle-fetch line); a short "Protecting the agent" section inREADME.md(the operator's how-to: fetch the bundle, install, flip the URL — three sentences, no flavour).
Testing & Quality
- the live suite is read-only (the repo's rule) — no bundle mutations on the hardware; the revocation/rotation proof happens on a dev-box agent, not the fleet's.
- invariant 10: the dev server stays up throughout; screenshots in
data/logs/.
Completion Criteria
./scripts/dev-server.sh status:host:deskwork ok,host:gateway ok,disks:deskwork ok,disks:gateway okover thehttps://dialsuv run pytest -m live --livegreen for the host/disks paths- the
/certs+/systemscreenshots indata/logs/showactive, issued rev == deployed rev, the host rows not dimmed - the
data/logs/note records the exact commands + thecurlcodes + the wrong-CA failure line - AGENTS.md +
README.mdupdated (the definition of done) bash .agents/validate.shgreen