Security posture self-test
Run metrum-ai-routerctl doctor --security --config config.yaml to check local security configuration. Add --target https://router.example to probe metrics authorization without sending credentials; plain HTTP targets are allowed only on loopback. Use --advisories <file> to choose an engine advisory snapshot. Release packages include bin/engine-advisories.json, which is read by default when present beside the binary.
The command returns pass, warn, fail, or informational not checked findings with safe fix guidance. JSON output and --fail-on warn support CI gates. External metrics probes have a three-second timeout, do not follow redirects, and never send credentials. A 2xx unauthenticated metrics response fails; 401 and 403 pass; other responses warn. Configuration findings cover serving TLS, provider key source/spend ceilings, admin exposure, security reports, caller limits, caller token format and recorded entropy, development/test keys, active metrics authorization, caller age, and sensitive-target PII filtering. Revoked and disabled callers are excluded from key checks. Missing or future callers[].token_issued_at warns. Token values are never read. In database config mode, the doctor warns that DB-stored callers and keys were not checked.
Engine image pins in the operator YAML are compared with the JSON snapshot generated by the release engine advisory gate and included in release packages. The advisory check makes no network requests and never searches for or executes repository scripts. --target and --report-latest are explicit network operations. Without a snapshot, engine advisories are informational not checked, so offline --fail-on warn can pass.
Use --report-latest --router-url https://router.example --admin-key-file ./admin.key to publish only the timestamp, aggregate outcome, and check identifiers/status/severity to the authenticated latest-report operation. The key also accepts ROUTER_ADMIN_KEY or ROUTER_ADMIN_KEY_FILE; never pass a key as a flag value. Grant admin:security_reports, write narrowly. The persisted report excludes target addresses, detailed findings, fix text, and credentials. The usage database must have its migrations applied.