Skip to content

Endpoint Security Checklist 🟑 BETA

Check every new or changed HTTP handler for identity, tenant scoping, sanitised errors and the required headers before it ships.

Admin guide Β· endpoint review runbook

When to use Before you start Steps Verify Roll back
Reviewing a pull request, before a deploy Source checkout, generated API list Read the handler, grep the guards, probe the route All five checks pass Revert the route and redeploy

When to use

Use this runbook when a handler is added or changed, or when an endpoint is suspected of leaking data across a tenant or returning an internal error string.

Before you start

  • The generated route list is the authority for what exists; start with the generated API reference index.
  • The permission model is in the permissions matrix and the enforcement map in the security matrix.
  • Repository rules that apply to every handler: no unwrap/expect/panic, SafeCommand for process execution, sql_guard for identifiers, log_and_sanitize for error responses, CSRF for state-changing methods except Bearer-token API endpoints.

Steps

# 1. Locate the handler and read it whole.
grep -RIn "<route-fragment>" botserver/src/main_module/routes --include='*.rs'

# 2. Check it resolves identity from the server, not from a client field.
grep -nE "Extension<Arc<AppState>>|resolve_user_role|branch_id|org_id" <handler-file>

# 3. Check it does not return raw errors or build SQL from user input.
grep -nE "unwrap\(|expect\(|format!\(.*SELECT|to_string\(\)\)" <handler-file>

# 4. Probe the live route with and without a token.
curl -sI http://localhost:8080/health
curl -s -o /dev/null -w '%{http_code}\n' "<route-url>"

Verify

Check Where Pass condition
Identity handler source resolved from state/token, never from a client tenant field
Tenant scope SQL and object keys org_id / branch_id predicate on every read and write
Errors log_and_sanitize present no internal message in the response body
Headers curl -sI all six IMP-09 headers on the response
Methods route registration CSRF required except Bearer-token API
Route parity generated reference no undocumented route shipped

Roll back

πŸ”΄ Revert the handler through version control and redeploy with the deploy runbook. If data was exposed, treat it as an incident and follow incident response rather than only reverting code.