Files
Julian LechnerandClaude Opus 5.5 368cf5ee4a docs(security): add logging and client app rules, close coverage gaps
New focused rules: security logging and audit (events to log, log
injection, what never to log, tamper-evident audit trails) and desktop
and mobile client apps (shipped code is public, platform secret stores,
pinning with rotation, signed updates, WebView limits).

Existing rules gain inbound webhook verification in api, GDPR handling
of personal data in data, container and infrastructure-as-code
hardening in supply-chain, and post-quantum key establishment with
ML-KEM (FIPS 203) in a hybrid construction in crypto. Security testing
of a third-party or public target now needs one confirmation of
ownership or permission. Duplicate authorization bullets in auth and
api are merged, and webhook routing distinguishes inbound from outbound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 10:03:44 +01:00

1.3 KiB

Security Logging and Audit

Apply these rules when adding or changing logging, audit trails, monitoring, or alerting.

  • Log security events with who, what, when, where, and outcome: authentication successes and failures, authorization failures, session and token failures, input validation failures at trust boundaries, privilege and role changes, administrative actions, sensitive data access, key rotation, data import or export, configuration changes, and certificate or TLS failures.
  • Prevent log injection: use structured logging with constant message templates and named parameters, never string concatenation; neutralize CR, LF, and delimiters in untrusted values, encode for the log format, and cap the length of user-supplied values.
  • Never log passwords, authentication secrets, session IDs, access or refresh tokens, encryption keys, connection strings, payment data, or unnecessary personal data. Hash a token when you need to correlate it.
  • Keep audit records append-only and tamper evident, restrict and review read access to logs, ship them over secure transport, and alert when logging stops.
  • Correlate requests across services with an ID that carries no secrets or personal data.
  • Set log retention to what operations, security, and the law require, and delete older records.