Repository navigation
Description
What's the problem
When a dashboard login is set, scraping /metrics needs that same login (docs/monitoring.md: "the scrape needs the same credentials"). The login also opens every control, configuration, upgrade and worker route, so a homelab Prometheus or an enterprise scrape job must hold the credential that controls the stack just to read gauges. There is no read-only way in. The endpoint itself (current values only, no history) is fine; the missing piece is a separate, narrower credential for it.
Scope is that credential and its lifecycle in the new UI's Advanced drawer (#3566, Access section). The old setup-surface issue #2537 is closed and folded into #2530 (owner, 2026-10-16: Prometheus goes in Advanced), so the original requirement to update #2537's monitoring setup surface now means the Advanced section. Nothing in the current dashboard UI changes (owner, 2026-10-27).
This is an optional access-separation feature, filed under the post-GA adoption roadmap #3181 (closed 2026-10-16, replaced by the lean roadmap). It is not a newly reproduced vulnerability and not a reason to apply a security priority label.
What it impacts
- Operators who scrape
/metricswith Prometheus or Grafana, and teams that share one scrape job: today they hold the full-control login. - Every dashboard-login holder: the new principal must not weaken that login, and existing installs must keep working unchanged.
- Code: the Caddy front end config (
lib/pithead/35-caddyfile-and-auth-helpers.sh), the control channel, the Advanced Access section (Sovereign: organize mining and advanced settings without losing fields #2530 on the Sovereign: build navigation, page headers and persistent status #2513 drawer),docs/monitoring.mdanddocs/dashboard.md.
How I found it
docs/monitoring.md("Prometheus metrics") ondevelop(37c3bb2) anddevelop-v2.1.0(7cb2266), read 2026-10-27: withdashboard.auth.passwordset the scrape needs the same credentials, and the example usesbasic_authwith the dashboard login plusinsecure_skip_verify: true.handle_metricsindashboard/mining_dashboard/web/server.pystates the same trust boundary as the state API: behind Caddy's single optionalbasic_authblock, which forwards the username asX-Auth-User(the audit actor).- The Sovereign: surface Prometheus and external monitoring setup #2537 investigation brief (2026-09-23) reached the same reading. Nothing was run and no breach was reproduced.
- Not established: how many users scrape today, whether Caddy can limit a second principal to one path without a disruptive reload (untested), and how a monitoring name would appear in the audit actor.
How important is it
Low. The lean roadmap rates it P4 (later, only on demand, defer). The owner's 2026-10-27 direction lifts the pause on post-GA work, so it may be worked now, but it gates neither 2.0.x nor v2.1.0 and the milestone stays v2.x - post-GA. It is security-sensitive (a new credential at the front end), so correctness and proof matter more than speed. The UI part waits for #2530; the host and authentication part and its tests do not.
Acceptance criteria
- A monitoring credential is a separate principal from the dashboard login and reads only
/metrics, through the same front end and endpoint as today. No second exporter and no new listener. - Every other route (state API, control, configuration, worker, upgrade, backup, support bundle, access and audit logs, the UI) rejects it. A test walks the registered route table and fails if any route besides
/metricsaccepts it, so a route added later is denied by default. -
/metricsreturns 401 for absent, malformed, wrong, rotated-out and revoked credentials, and for expired ones if the design adds an expiry. Rotating issues a new secret and invalidates the old one at once; revoking removes access without touching the dashboard login. - Existing behavior is preserved deliberately. With no monitoring credential created, an upgraded install behaves exactly as before (the dashboard login still scrapes
/metrics). With no dashboard login set there is nothing to separate and/metricsstays as it is. Defaults and migration are documented; tests cover both modes and the unused-feature case. - The secret never appears in a query string, access-log line, audit entry, API response, support bundle or the Configuration JSON view after it is shown. A redaction test asserts each.
- Create, rotate and revoke live only in the Advanced drawer (Access section, v2.1.0 lean UI spec: four pages, one profile control, an Advanced drawer #3566 F/G), through the shared preview-and-confirm gate at its existing confirmation strength. There are zero new counted controls: the control-count fixtures for appliance, DIY with login and DIY without login still pass. The section is hidden on DIY without a login (v2.1.0 lean UI spec: four pages, one profile control, an Advanced drawer #3566 J). It has keyboard access, AA contrast in light and dark, and no horizontal scroll at 375 px.
- The scrape setup in Advanced and in
docs/monitoring.mduses the monitoring credential, gives copyable examples with a placeholder instead of the secret, and verifies the stack's certificate instead of recommendinginsecure_skip_verify. If a scraper cannot verify the certificate yet, the docs say so and state the trust step.docs/dashboard.mdis updated. - No change to the current (old) dashboard UI, and no explanatory code comments.
Possible solutions
These are options, not verified.
- Second Caddy user limited to
/metricsby a path matcher. Trap: a user added to the existing singlebasic_authblock would gain the whole dashboard. - A scoped bearer token for
/metricschecked at the front end. More moving parts than a second basic-auth user. - Lifecycle: generate on demand, show once (the pattern of the generated dashboard login in v2.1.0 lean UI spec: four pages, one profile control, an Advanced drawer #3566 H), store only a hash. Rotate means regenerate; revoke means delete and reload the front end through the control channel, where the host executes.
- Proof: a request test against the real Caddy (401 or 200 per route), reusing the harness of Tier 3: run the real Caddy and prove the login gate, the audit actor and the access-log contract #3085 if it has landed, else a minimal one. Tier follows the path: Caddy rendering is box behavior, so a tier-4
/metricsthrough Caddy leg may be owed; Forward appliance fixture credentials to authenticated metrics coverage #3667 and PR test: forward appliance credentials to authenticated metrics #3669 touch that fixture. - Sequence: host and authentication part first, then the Advanced section after Sovereign: organize mining and advanced settings without losing fields #2530.
- Unknown, to settle in the PR: the reload path, the audit actor name for the new principal, and whether the onion-service route matters (the current docs scope scraping over Tor out).
Earlier scope, kept as evidence only (superseded 2026-10-27; do not implement from it)
What's the problem
The existing /metrics endpoint uses the dashboard's credentials. A homelab monitoring service or enterprise scrape job should not need the same credential used for dashboard control.
Acceptance:
- Reuse the existing endpoint and authentication boundary; provide a separately scoped read-only credential or equivalent approved read surface, with rotation/revocation and documented TLS verification.
- A monitoring principal can read only the intended metrics and cannot access control/config/upgrade endpoints, secrets, sensitive dashboard data or a different authentication bypass.
- Preserve current dashboard authentication and no-login behavior deliberately; document migration/defaults rather than silently weakening protection. Never put credentials in query strings/logs.
- Test cross-route authorization, malformed/expired/revoked credentials, disabled mode, scrape configuration and redaction. Update Sovereign: surface Prometheus and external monitoring setup #2537's monitoring setup surface to consume this feature without introducing another exporter.
This is an optional access-separation feature in #3181, not a claim of a newly reproduced vulnerability or a reason to bypass post-GA routing with a security priority label.
what it impacts
Impact is not separately established in the existing report; confirm the affected users or behavior.
How I found it
Discovery details are not separately established in the existing report; preserve and verify the evidence already recorded.
how important is it
Importance has not been assessed explicitly; triage must state the priority and its reason.
acceptance criteria
Acceptance is not isolated in the existing report; the agent must identify a testable outcome before implementation.
possible solutions
No distinct solution options are recorded; investigate the existing report before choosing an approach.
Activity
pithead-developer commentedon Nov 2, 2026
Operator, 2026-11-02: folded into #3872 (owner request: a dedicated login page with admin and read-only roles). Its acceptance criterion 5 covers this issue's separate read-only
/metricscredential.pithead-developer commentedon Nov 2, 2026
Operator, 2026-11-02: closing as superseded by #3872, whose acceptance criterion 5 is this issue's separate read-only
/metricscredential; #3872 is being implemented now.