Data and secrets
Keep keys out of code and pages. Show short errors, close debug doors and hidden files, and send back only the data each request needs.
- Required 11
Required
Keep secrets out of code
RequiredNever write a password, key or token into code, settings files in the repo, or its history.
Keep secrets out of the browser
RequiredSend no private key to the browser. Anything in a page, script or source map can be read by anyone.
Show short errors
RequiredShow visitors a short error with a reference number. Keep stack traces, queries and file paths in the server log.
Close debug and admin doors
RequiredRemove debug, test and status tools from production, or put them behind a login and a private network.
Serve no hidden files
RequiredServe only the files you meant to publish. Never serve version control folders, settings files, backups or folder listings.
Return only the fields needed
RequiredEach API reply returns only the fields the caller needs and may see. Never send a whole database record and let the page hide the rest.
Keep private data out of logs and addresses
RequiredNever put passwords, tokens, card numbers or personal details in addresses or logs.
Encrypt data on the wire and on disk
RequiredEncrypt every connection, including those between your own servers. Encrypt stored personal data and backups.
Give each key the least power
RequiredGive every key, account and service only the access it needs. Replace keys at least once a year, and at once after a leak or when someone with access leaves.
Keep storage buckets private
RequiredKeep cloud storage buckets and file shares private. Hand out short-lived signed links for single files instead of public folders.
Keep card numbers off your servers
RequiredNever let card numbers reach your servers or your own scripts. Take payments through the provider's hosted checkout or its embedded payment fields.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers security testing playbook: https://agentwranglers.se/playbook/adversarial-testing/data-and-secrets.