General Bots Security Features Guide π‘ BETA
Read the implemented security contracts from their source and verify them on the running service; do not infer a feature from a flag name.
Admin guide Β· security feature verification runbook
| When to use | Before you start | Steps | Verify | Roll back |
|---|---|---|---|---|
| Before a release, during a review, after a config change | Source checkout, running server | Read the crate, probe the service | Contract present and enforced | Restore prior config or binary |
When to use
Use this runbook to separate features that are wired into a request path from library code that is merely present.
Before you start
- Repository rules are code contracts: no
unwrap/expect/panicin production,SafeCommandfor commands,log_and_sanitizefor errors,sql_guardfor identifiers, CSRF on state-changing endpoints except Bearer-token APIs. - Rate-limit defaults are 100 req/s general, 10 req/s auth and 50 req/s API per token; WebSocket messages are also limited. The implementation uses
governor. - Security headers (IMP-09) must be on every response; HSTS uses
max-age=63072000; includeSubDomains; preload. - Secrets live in Vault; the
.envfile holds onlyVAULT_*variables.
Steps
# 1. Read the enforcement code, not the prose.
grep -RIn "log_and_sanitize\|sql_guard\|SafeCommand\|governor" \
botserver/src botserver/crates --include='*.rs' | head -40
# 2. Probe the deployed headers and health.
curl -sI http://localhost:8080/health
curl -s -o /dev/null -w '%{http_code}\n' http://localhost:8080/health
# 3. Check the per-bot LLM configuration source (Vault first, then env).
grep -RIn "secret/gbo/llm\|LLM_URL\|LLM_MODEL" botserver/src botserver/crates --include='*.rs' | head -20
# 4. Run the dependency audit from the repository root.
cargo audit
Verify
| Feature | Evidence | Pass condition |
|---|---|---|
| Error sanitisation | source grep | no raw error returned |
| SQL identifiers | sql_guard consumers |
identifiers sanitised |
| Rate limits | governor consumers |
100 / 10 / 50 defaults in force |
| Headers | curl -sI |
all six IMP-09 headers |
| Auth | initial setup, user auth | directory-backed login |
| Tenants | multi-tenant isolation | no cross-tenant read |
| Audit | cargo audit |
no unpatched critical advisory |
Mechanical gates in CI
A gate is real only when CI fails on a violation. The generated references and guard scripts are checked in CI; a gate that only prints a warning is not a gate. Confirm the corresponding check appears in the workflow before claiming it protects a release.
Roll back
π΄ Restore the previous configuration from Vault or snapshot, or redeploy the previous binary via the deploy runbook, then re-run the table. A header or auth regression is an incident under incident response.