Security controls
Each safeguard of docs/ops/RED-TEAM.md, and its state with when it was last checked. A site
admin sees it at /settings/security/controls (linked from Security) and in
the terminal as the palette command "Security controls". Anyone else gets a 404
on the page and is offered nothing in the terminal. Read-only.
Where the times come from
<FORGE_DATA>/security-report.json, the file the Security page reads, written
whole by the timer outside the forge. Per control, first match wins:
- An entry in the optional
controlslist:{ "id": "app-env", "at": "<ISO date>", "ok": true }.
Ids: app-env, identity-headers, edge-secret, crew-sandbox,
injection-marking, pod-security. Unknown ids, duplicates, a bad date or a
non-boolean ok are ignored.
- For the five controls a test file keeps: the report's own
at, passing when
selfTest.failed is 0. The timer's self-test runs those tests, so existing
reports already give a time.
- Otherwise "No check recorded". Pod security is kept in the cluster's source,
so only a controls entry written by whatever checks the cluster gives it a time.
Each control is one row with a word and glyph, never colour alone: "Passing",
"Failed" (ok is false), "Out of date" (the check is more than 8 days old) or
"No check recorded". The terminal says the same four words. Open a row's fold
(a native details, no script) for what the control holds and what keeps it.
Code
src/checks/controls.ts (the list and the reading), src/web/pages/security_controls.ts,
src/tui/screens/controls.ts. Tests: test/security-controls.test.ts.