Skip to content

Provide read-only monitoring credentials separate from dashboard administration #3183

Closed as not planned

Description

@VijitSingh97

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

How I found it

  • docs/monitoring.md ("Prometheus metrics") on develop (37c3bb2) and develop-v2.1.0 (7cb2266), read 2026-10-27: with dashboard.auth.password set the scrape needs the same credentials, and the example uses basic_auth with the dashboard login plus insecure_skip_verify: true.
  • handle_metrics in dashboard/mining_dashboard/web/server.py states the same trust boundary as the state API: behind Caddy's single optional basic_auth block, which forwards the username as X-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 /metrics accepts it, so a route added later is denied by default.
  • /metrics returns 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 /metrics stays 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.md uses the monitoring credential, gives copyable examples with a placeholder instead of the secret, and verifies the stack's certificate instead of recommending insecure_skip_verify. If a scraper cannot verify the certificate yet, the docs say so and state the trust step. docs/dashboard.md is updated.
  • No change to the current (old) dashboard UI, and no explanatory code comments.

Possible solutions

These are options, not verified.

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

  1. added this to the v2.x - post-GA milestone on Oct 6, 2026
  2. self-assigned this
    on Oct 6, 2026
  3. added
    enhancement
    dashboard
    on Oct 6, 2026
  4. added
    operator-action
    blocked
    on Oct 27, 2026
  5. removed
    operator-action
    on Oct 27, 2026
  6. pithead-developer commented on Nov 2, 2026

    @pithead-developer
    Contributor

    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 /metrics credential.

  7. pithead-developer commented on Nov 2, 2026

    @pithead-developer
    Contributor

    Operator, 2026-11-02: closing as superseded by #3872, whose acceptance criterion 5 is this issue's separate read-only /metrics credential; #3872 is being implemented now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

blockeddashboardenhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions