Skip to content

Security Review Checklist for SaaS Deployment 🟑 BETA

Run the pre-deployment security checks against the source and the running service, and record a result for every row.

Admin guide Β· deployment security runbook

When to use Before you start Steps Verify Roll back
Before a release takes traffic, during a review Source checkout, test deployment Grep the contracts, probe the service Every row has evidence Restore prior config or redeploy

When to use

Use this runbook to close a release gate. An unchecked row is not a pass; it is an open item in the review.

Before you start

  • The repository AGENTS.md is the authority for the contracts below: no panics in production, SafeCommand, log_and_sanitize, sql_guard, CSRF on state-changing endpoints except Bearer-token APIs, and six response headers on every response.
  • Rate limits default to 100 req/s general, 10 req/s auth and 50 req/s API per token; WebSocket messages are limited too.
  • The correct HSTS value is max-age=63072000; includeSubDomains; preload. A shorter value in an older page is wrong.
  • Keep evidence under /tmp; never write a credential or internal address into the repository.

Steps

# 1. Authentication and authorisation: resolve from the directory, not a client field.
grep -RIn "resolve_user_role\|log_and_sanitize\|sql_guard\|SafeCommand" \
  botserver/src botserver/crates --include='*.rs' | head -40

# 2. Rate limiting and resource protection.
grep -RIn "governor" botserver/src botserver/crates --include='*.rs' | head -20

# 3. TLS and security headers at the deployed host.
curl -sI https://docs.generalbots.org/ | grep -iE 'strict-transport|content-security|x-frame|x-content|referrer|permissions-policy'

# 4. Dependency audit and supply-chain gates.
cargo audit
python3 scripts/check_supply_chain_gates.py

# 5. Confirm a snapshot exists before any hardening change.
sudo incus snapshot list tables

Pre-Deployment Security Audit

Area Check Evidence
Authentication & authorization admin from directory, least privilege RBAC query and sign-in probe
Rate limiting 100 / 10 / 50 defaults governor consumers and a 429 probe
Input validation sql_guard, upload validator source plus upload probe
Data protection Vault paths, scoped keys Vault read and bucket prefix
API security CSRF, default deny method probe and generated routes
Infrastructure snapshots, Caddy validation incus snapshot list, caddy validate
LLM & AI prompt isolation, tool association tool probe in a standard session
Compliance requirements dated evidence table

Verify

Check Command / surface Pass condition
Headers curl -sI all six IMP-09 headers with documented values
Auth login on the login surface directory-backed admin, no anonymous admin
Limits repeated requests 429 at the documented rate
Audit cargo audit no unpatched critical advisory
Proxy caddy validate exit 0
Snapshot incus snapshot list pre-change snapshot exists

Incident Response

A failed gate stops the release. Record the failure and the evidence under /tmp, then follow incident response if exposure is possible. Do not re-run the probe until a different result is expected.

Regular Security Tasks

Repeat this checklist after every release that touches routes, auth or configuration, and run cargo audit weekly as required by IMP-10.

Roll back

πŸ”΄ Restore the prior configuration from Vault or snapshot and redeploy with the deploy runbook, then re-run the table.