Notes
What good looks like
A good security requirement looks like any good requirement: specific, testable, and with a reason. The app must be secure is not a requirement; it is a wish. Validate all input is barely better. Compare: passwords are stored with Argon two i d, never logged and never returned in a response. Or: a user can only access records belonging to their own organisation. Each of those can be written as a test, checked in review and signed off. That is the bar.
- vague: "the app must be secure"
- vague: "validate all input"
- usable: "passwords are stored with Argon2id; never logged or returned"
- usable: "a user can only access records of their own organisation"
- each one can be tested and signed off
Abuse cases
The technique is the abuse case. Take a normal user story and ask how it could be misused. A user uploads a profile photo. How could that be abused? Upload a huge file to exhaust storage. Upload a script instead of an image. Overwrite another user's photo by guessing an identifier. Read a server file by putting a path in the filename. Each abuse case becomes a requirement: a size limit, content-type checks, an ownership check, path handling. One story, four requirements.
- story: "upload a profile photo". abuse cases: huge file (DoS) a script, not an image (stored XSS, RCE) overwrite another user's photo (access control) read server files via the file path (traversal)
- each abuse -> a requirement
A prompt list
You do not need inspiration; you need a prompt list. For every feature ask: who should not be able to do this, and can they? What if the input is huge, empty or malformed? What if it is called a thousand times a second? Can I act on someone else's data by changing an identifier in the request? What gets logged, and should it be? What if a step in the flow is skipped, repeated or done out of order? Run a feature through these and the requirements write themselves.
- who should NOT be able to do this? can they?
- what if the input is huge, empty or malformed?
- what if it is called 1000x a second?
- can I act on another user's data by changing an ID?
- what is logged, and should it be?
- a step skipped or repeated?
Do not start blank
You should not write these from a blank page. The OWASP Application Security Verification Standard, or ASVS, is a detailed checklist of requirements organised into levels, from basic to high assurance. The OWASP top ten gives the common risk categories, and the API top ten does the same for APIs. The proactive controls and cheat sheets give concrete guidance. Compliance regimes map to requirements too. And your own past incidents are the most relevant source of all.
- OWASP ASVS: a detailed, levelled checklist of app security requirements
- OWASP Top 10 and API Top 10: the common risk categories
- OWASP proactive controls and cheat sheets
- compliance: PCI DSS, HIPAA, SOC 2 map to requirements
- your own past incidents
Into the backlog
A requirement that lives in a document will be forgotten. Make it real. Add security acceptance criteria directly to the user story: the reset token expires in fifteen minutes; a user cannot read another organisation's orders. Write them as automated tests where you can, especially negative tests that confirm the bad thing is blocked. Put them in the definition of done. Cross-cutting ones, such as how cryptography and logging work, become shared standards referenced by every story.
- add security acceptance criteria to the user story
- write them as tests where possible: authz tests, negative tests
- add them to the definition of done
- non-functional ones (crypto, logging) become standards
- reviewed like any other acceptance criteria
A worked example
Here is one story worked through. A user logs in. Guessing passwords leads to a requirement for rate limiting, lockout and multi-factor authentication. User enumeration leads to identical responses and timing for valid and invalid accounts. Stolen passwords lead to breached-password checks and MFA. Session theft leads to secure cookies, session rotation after login and idle timeouts. Brute forcing the MFA code leads to limited attempts and short validity. One story, six concrete, testable requirements.
- abuse -> requirement: guessing passwords -> rate limit + lockout + MFA
- user enumeration -> identical response and timing
- stolen password -> breached- password check, MFA
- session theft -> secure cookie, rotation, timeout
- brute MFA codes -> limited attempts, short validity
Non-functional too
Not every requirement attaches to a single feature. Some apply to the whole system, and they are easy to forget because no story owns them. All traffic over modern TLS. Secrets from a vault, never in code. Security events logged, but personal data never logged. Dependencies scanned and kept current. Error messages that reveal nothing sensitive. Data retention and deletion honoured. Capture these once as platform requirements that every team inherits, rather than rediscovering them per project.
- all traffic over TLS 1.2+ secrets from a vault, never in code
- security events logged; PII never logged
- dependencies scanned and kept current
- errors reveal nothing sensitive
- data retention honoured
Common mistakes
Mistakes. Be secure as the whole of the security requirement. Writing only functional stories and never the abuse cases that go with them. Requirements with no test and no owner, which quietly disappear. Ignoring mature lists like ASVS and starting from scratch. Leaving security to appear at the end as penetration test findings, which is the expensive path this whole stage is trying to avoid. And letting the same gap recur in every project because nobody captured it as a standard requirement.
- "be secure" as the whole requirement
- functional stories, never abuse cases
- requirements with no test and no owner
- ignoring lists like ASVS
- security added only at the end, as findings
- the same gap recurring, never captured
Say it like this
In the interview: I derive security requirements from abuse cases. For each user story I ask how it could be misused, from guessing and tampering to acting on other users' data, and each answer becomes a specific, testable requirement. I reuse ready-made lists such as OWASP ASVS and map any compliance obligations. I put the requirements into acceptance criteria and the definition of done, write negative tests for them, and capture cross-cutting ones, like TLS, logging and secrets, as platform standards.
- "I derive them from abuse
- cases: for each user story I
- ask how it could be misused, and each answer becomes a testable requirement. I reuse
- OWASP ASVS and map compliance
- needs, add them to acceptance
- criteria and the definition
- of done, and capture
- system-wide ones as standards."