Define Security Requirements
Purpose
Produce a concise, testable set of security requirements that developers can build against and testers can verify, anchored to OWASP ASVS so coverage and level are explicit.
When to use
- A new application, API or significant feature enters design or refinement.
- A threat model has produced mitigations that must become requirements.
- A tender, customer contract or auditor asks for a documented security baseline.
When not to use
- You still need to discover what threats exist. Use
threat-model first.
- You need general quality attributes (performance, availability). Use
nfr-specification.
- You are reviewing existing code against requirements. Use
secure-code-review.
Inputs
Required:
- A description of the system or feature: users, interfaces, data handled and how it is deployed.
Optional, improves quality:
- Target ASVS level (L1, L2, L3) or the risk profile to derive it.
- Threat model output, existing security standards or policies.
- Regulatory scope (KVKK/GDPR, PCI DSS, sector rules), identity provider, tech stack.
If the system description is missing, ask for it. If the ASVS level is not given, propose one with justification and mark it [ASSUMPTION].
Process
- Summarize the system context: exposure (internet/internal), user types, data classes, integrations.
- Choose the ASVS level: L1 for low-risk, L2 as default for applications handling personal or business-critical data, L3 for high-value transactions or safety-critical systems. State the reason.
- Select relevant ASVS chapters (e.g. authentication, session management, access control, validation and encoding, cryptography, error handling and logging, data protection, API, configuration). Drop chapters that do not apply and say why.
- Write each requirement as one testable "shall" statement tailored to the context; cite the ASVS chapter/requirement reference instead of copying its text.
- Add context-specific requirements from the threat model and regulation: data minimization, retention, masking in logs, consent, data subject request handling for KVKK/GDPR.
- For each requirement define verification: automated test, SAST/DAST/SCA rule, code review, configuration check, pentest.
- Prioritize with MoSCoW or Must/Should/Could and tie Must items to release gates.
- Mark conflicts and trade-offs (e.g. session timeout vs usability) and who decides.
- List open questions and assumptions.
- Suggest the next skill:
acceptance-criteria to make each requirement testable in work items, threat-model if threats have not yet been modeled, secure-code-review for verification.
Output format
# Security Requirements: <system/feature>
Target level: OWASP ASVS <version> L<n> – <justification>
## Context
- Exposure, users, data classes, integrations
## Requirements
| ID | Requirement (shall) | ASVS ref | Source (ASVS / threat / regulation) | Priority | Verification | Owner |
|---|---|---|---|---|---|---|
| SEC-01 | ... | V<chapter>.<section> | ... | Must | Automated test | ... |
## Excluded Chapters
- <chapter> – reason
## Trade-offs and Decisions Needed
- ...
## Assumptions and Open Questions
- [ASSUMPTION] ...
Quality checklist
Common pitfalls
- Writing "the system shall be secure" style requirements. Each item must describe observable behavior.
- Copying the whole ASVS into the backlog. Tailor to context and drop what does not apply, with a reason.
- Forgetting non-functional security needs such as logging, monitoring and secret rotation.
Example
Input: "Customer self-service portal, internet facing, stores names, phone numbers and addresses; payments via hosted payment page."
Excerpt of output:
- Target level: ASVS L2 – internet-facing, personal data, no card data stored.
| SEC-04 | The portal shall invalidate the server-side session on logout and after 15 minutes of inactivity [ASSUMPTION: timeout to be confirmed] | V3 | ASVS | Must | Automated test |
| SEC-11 | Application logs shall not contain phone numbers or addresses in clear text | V7 | KVKK | Must | Log review + test |
1---2name: security-requirements3description: "Defines testable security requirements for a system or feature, aligned to OWASP ASVS levels and chapters, with rationale, verification method and priority. Use when a new application or feature needs security acceptance criteria, when a threat model must be turned into backlog items, or when a customer or regulator asks for a security requirements baseline."4license: MIT5metadata:6 source: https://skillmd.com/skills/muratdincer/security-requirements7 version: "1.0.0"8 language: en9 category: 09-security10 role: security-engineer11 area: design12 title: "Define security requirements"13 related: "threat-model, nfr-specification, authn-authz-design, secure-code-review, acceptance-criteria"14 prompt: "Define security requirements for our new customer self-service portal; it handles personal data and payments are done via a hosted payment page."15---1617# Define Security Requirements1819## Purpose20Produce a concise, testable set of security requirements that developers can build against and testers can verify, anchored to OWASP ASVS so coverage and level are explicit.2122## When to use23- A new application, API or significant feature enters design or refinement.24- A threat model has produced mitigations that must become requirements.25- A tender, customer contract or auditor asks for a documented security baseline.2627## When not to use28- You still need to discover what threats exist. Use `threat-model` first.29- You need general quality attributes (performance, availability). Use `nfr-specification`.30- You are reviewing existing code against requirements. Use `secure-code-review`.3132## Inputs33Required:34- A description of the system or feature: users, interfaces, data handled and how it is deployed.3536Optional, improves quality:37- Target ASVS level (L1, L2, L3) or the risk profile to derive it.38- Threat model output, existing security standards or policies.39- Regulatory scope (KVKK/GDPR, PCI DSS, sector rules), identity provider, tech stack.4041If the system description is missing, ask for it. If the ASVS level is not given, propose one with justification and mark it `[ASSUMPTION]`.4243## Process441. Summarize the system context: exposure (internet/internal), user types, data classes, integrations.452. Choose the ASVS level: L1 for low-risk, L2 as default for applications handling personal or business-critical data, L3 for high-value transactions or safety-critical systems. State the reason.463. Select relevant ASVS chapters (e.g. authentication, session management, access control, validation and encoding, cryptography, error handling and logging, data protection, API, configuration). Drop chapters that do not apply and say why.474. Write each requirement as one testable "shall" statement tailored to the context; cite the ASVS chapter/requirement reference instead of copying its text.485. Add context-specific requirements from the threat model and regulation: data minimization, retention, masking in logs, consent, data subject request handling for KVKK/GDPR.496. For each requirement define verification: automated test, SAST/DAST/SCA rule, code review, configuration check, pentest.507. Prioritize with MoSCoW or Must/Should/Could and tie Must items to release gates.518. Mark conflicts and trade-offs (e.g. session timeout vs usability) and who decides.529. List open questions and assumptions.5310. Suggest the next skill: `acceptance-criteria` to make each requirement testable in work items, `threat-model` if threats have not yet been modeled, `secure-code-review` for verification.5455## Output format56```markdown57# Security Requirements: <system/feature>58Target level: OWASP ASVS <version> L<n> – <justification>59## Context60- Exposure, users, data classes, integrations61## Requirements62| ID | Requirement (shall) | ASVS ref | Source (ASVS / threat / regulation) | Priority | Verification | Owner |63|---|---|---|---|---|---|---|64| SEC-01 | ... | V<chapter>.<section> | ... | Must | Automated test | ... |65## Excluded Chapters66- <chapter> – reason67## Trade-offs and Decisions Needed68- ...69## Assumptions and Open Questions70- [ASSUMPTION] ...71```7273## Quality checklist74- [ ] Every requirement is a single, testable statement with a verification method.75- [ ] The ASVS level and version are stated and justified.76- [ ] Personal data requirements cover minimization, masking in logs and retention.77- [ ] No ASVS text is quoted verbatim; references point to the section.78- [ ] Must requirements are linked to a release gate.79- [ ] Nothing about existing controls is invented; unknowns are marked.80- [ ] All checks pass; if any fails, revise the output and re-run this checklist before answering.8182## Common pitfalls83- Writing "the system shall be secure" style requirements. Each item must describe observable behavior.84- Copying the whole ASVS into the backlog. Tailor to context and drop what does not apply, with a reason.85- Forgetting non-functional security needs such as logging, monitoring and secret rotation.8687## Example88Input: "Customer self-service portal, internet facing, stores names, phone numbers and addresses; payments via hosted payment page."8990Excerpt of output:91- Target level: ASVS L2 – internet-facing, personal data, no card data stored.92| SEC-04 | The portal shall invalidate the server-side session on logout and after 15 minutes of inactivity [ASSUMPTION: timeout to be confirmed] | V3 | ASVS | Must | Automated test |93| SEC-11 | Application logs shall not contain phone numbers or addresses in clear text | V7 | KVKK | Must | Log review + test |