Web Dashboard

A local, optional browser UI for scanning history, drift timelines, severity distribution, environment comparison and alert management.

pip install "cfgdrift[web]"
cfgdrift serve                    # http://127.0.0.1:8080

Views

ViewWhat it shows
OverviewSummary cards + daemon health / error rate
TimelineSearchable / filterable / paginated drift history (v0.9.0)
Severity distributionPie chart; clicking a segment filters the timeline
Environment comparisonCompare baselines side by side, constraints included
ConstraintsActive constraint list, enable/disable user rules, recent violations (v0.7.0)
AlertingAlert rules, recent events, silence / ack (v0.10.0)
Self-Healing Auditremediation_log records, 30 days / 5000 rows pruned (v0.12.0)

Report export

The report view has an "Export HTML" button that produces a single-file offline HTML report (GET /api/reports/{scan_id}/html), the same artifact the CLI produces via cfgdrift report --html out.html.

Rollback buttons (v0.13.0)

The report view renders a hint block under each drift row with three buttons: 预览回滚 (preview rollback), 执行回滚 (apply rollback), 复制命令 (copy command). Without a remediate.yaml, apply is disabled with a readable error and the button degrades to copying the rollback command; dry-run preview always works.

Access auth (v0.17.0, G9)

The dashboard supports an optional Bearer-token gate for shared / team deployments. When a token is configured, every /api/* route (including the write operations: remediation apply, ignore-rule changes, alert tests/retries, constraint candidate promotion) requires Authorization: Bearer <token>; static files (the login page) stay open so the SPA can load. Without a token the service is fully anonymous and byte-identical to v0.16.0 (zero-noise default).

cfgdrift web token                   # generate a URL-safe token (43 chars, one line)
cfgdrift serve --token <TOKEN>    # enable auth on startup
CFGDRIFT_WEB_TOKEN=<TOKEN> cfgdrift serve   # or via env (CLI --token wins)

More details in README.en.md — Features at a Glance and the v0.13.0 [hint] section.