Skip to content

Security

Admin guide · Security runbook

🟢 Supported · ⚠️ code-level contracts · verify, do not invent flags

When to use Before you start Steps Verify Roll back
First boot, access policy, tenant isolation Vault unsealed, admin identity ready Check headers, limits, RBAC, audit Headers present, health 200, no secret values Restore policy from Vault / snapshot

When to use

You are bootstrapping access on a new installation, reviewing a deployment before it takes traffic, or responding to a change in access policy. This runbook verifies the contracts the code enforces.

Before you start

  • The security rules in the repository AGENTS.md are code contracts, not switches: no panics in production, SafeCommand for process execution, log_and_sanitize for error responses, sql_guard for identifiers.
  • Rate-limit defaults are 100 req/s general, 10 req/s auth, 50 req/s API per token, with WebSocket message limits. These are implemented with governor.
  • CSRF is required on POST, PUT, DELETE and PATCH, except Bearer-token API endpoints. Security headers must be present on all responses.
  • Only VAULT_* variables may live in .env; token and unseal key files are in /tmp. Use hostnames, never internal IPs.

Steps

## Security headers on every response (AGENTS.md IMP-09)
curl -sI http://localhost:8080/health

Expected headers: Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy and Permissions-Policy. Use the values in the repository AGENTS.md; do not substitute a different policy.

## Health and running process
curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/health
sudo incus exec <container> -- pgrep -a botserver
## Weekly dependency audit (AGENTS.md IMP-10)
cargo audit

Set up RBAC from the documented pages, keep one tenant per scope, and confirm the admin identity comes from the directory service rather than an unverified database row. Rotate secrets with the rotation runbook.

Verify

Check Command / surface Pass condition
Headers curl -sI http://localhost:8080/health all six headers above present
Auth Initial setup, user auth admin login works, no anonymous admin
RBAC RBAC overview, configuration roles match the permissions matrix
Tenants Multi-tenant isolation no cross-tenant read
Limits System limits 100/10/50 req/s defaults in force
Audit cargo audit no unpatched critical advisories
Logs grep -E "ERROR|WARN" botserver.log \| tail -20 no credential values printed

Do not trust an HTTP 200 alone on a proxied host: compare the page title or a checksum, because a missing page can return the home page with status 200.

Roll back

🔴 Restore the previous policy from Vault and the previous service snapshot, then re-run the verification table. If access was changed through a directory service, use its documented recovery path rather than editing database rows. Record the change and the evidence in the incident response record.

See also security features, security policy, production verification, permissions matrix, organizations, input guardrails, deployment security checklist, secrets management and production readiness.