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>
This commit is contained in:
1 parent
ff33ea1327
commit
368cf5ee4a
10 files changed
+39
-10
No files matched your search
@@ -1,7 +1,6 @@
|
||||
# API security
|
||||
|
||||
* Authenticate and authorize protected endpoints; validate every request payload and identifier.
|
||||
* Enforce object-level authorization on every read and write, using the authenticated principal and resource ownership at the operation that accesses the data.
|
||||
* Authenticate protected endpoints and validate every request payload and identifier. Enforce object-level authorization on every read and write, using the authenticated principal and resource ownership at the operation that accesses the data.
|
||||
* Bind only explicitly permitted request fields. Do not allow mass assignment of ownership, role, state, or other privileged properties.
|
||||
* Bound request and response sizes, pagination, query results, and expensive operations.
|
||||
* Apply rate limits and quotas to authentication, search, uploads, expensive operations, and other abuse-prone endpoints. Keep administrative routes separately protected.
|
||||
@@ -10,4 +9,5 @@
|
||||
* Prefer explicit DTOs and schemas; reject unknown or ambiguous fields when accepting them could alter privileged state.
|
||||
* Deserialize request bodies into explicit types. Never let the payload choose the runtime type (polymorphic type names, class names, or default typing) unless the allowed subtypes are registered explicitly; bound body size and nesting depth. Parse XML with external entities and DTDs disabled.
|
||||
* Keep authorization, validation, serialization, and error responses consistent with the published schema and supported clients.
|
||||
* For inbound webhooks, verify the sender's signature (for example an HMAC over the raw body) with a constant-time comparison before parsing or acting on the payload, reject stale timestamps and repeated event IDs to stop replay, process events idempotently, and keep signing secrets per sender and rotatable.
|
||||
* Test malformed, oversized, unauthenticated, unauthorized, cross-user, cross-tenant, and duplicate requests within the user's requested scope.
|
||||
Reference in new issue
Block a user