Derive Security From Risk
Turns a ratified business driver or functional requirement — together
with a named threat — into a Security Requirement (SR) the gate can
verify. This skill does NOT propose generic controls and does NOT
parent SRs to unspecified parent risks; every SR names the obligation
or threat it satisfies.
When to Use
- A
BR-* or FR-* exists for the engagement and processes regulated
data, money, identity, or controlled access.
- A threat modelling session (STRIDE, LINDDUN, attack tree) has
produced a concrete threat the architecture must mitigate.
- A compliance obligation (PCI, HIPAA, APRA CPS 234, GDPR, ISO 27001
Annex A) maps to a control the design must enforce.
- NOT when nobody can name the threat yet — run a threat-modelling
session first; do not derive a control to look productive.
Prerequisites
- The parent
BR-* or FR-* exists in
requirements/<engagement>/ and is ratified.
- A named threat or obligation is recorded in
requirements/<engagement>/threats/<threat-id>.md (free-form, but
the SR body must cite it).
spec/artifact-schema.md is the contract for SR frontmatter.
If no named threat exists, stop. The TOGAF red thread breaks the
moment a control mitigates a threat nobody named.
How to Run
bash scripts/verify-traceability.sh requirements/<engagement>
# create requirements/<engagement>/SR/SR-NNN.md
bash scripts/verify-traceability.sh requirements/<engagement>
Quick Reference
| Action |
Tool |
Notes |
| Read parent BR/FR |
view |
Get exact id. |
| Read threat record |
view |
The threat ID goes in the SR body. |
| Write SR |
create |
Frontmatter per schema; measurable: true. |
| Verify lineage |
bash scripts/verify-traceability.sh |
Must pass before commit. |
Example SR frontmatter:
---
id: SR-003
layer: SR
title: PII masking before persistence
parent_ids: [BR-001, FR-002]
owner: security.lead@example.com
measurable: true
ratified_by: ""
target: "Zero unmasked PII fields in storage; verified by daily DLP scan."
derivation_skill: derive-security-from-risk
tags: [pii, masking, data-protection, threat-T03]
---
Procedure
Step 1: Assess
- Read the parent artifact with
view. Confirm the data classification
(public / internal / confidential / regulated) is stated.
- Read the threat record. Confirm it names a threat actor, a target
asset, and a damaging outcome. A "threat" of "users might do
something bad" is not a threat — stop.
Step 2: Derive
For each named threat or obligation, produce one SR with:
- A control statement that names what the system MUST or MUST NOT
do (RFC 2119 register, not prose).
- A measurable target: a scan, a metric, an audit query, an
attestation cadence. If the control cannot be measured the gate
rejects it.
- A traceable obligation: cite the threat ID or the
regulation clause in the body. The agent never invents the
obligation — it cites one.
Step 3: Link
parent_ids includes the affected BR-* and/or FR-*. SRs MAY
also parent to an NFR-* when the control constrains an existing
quality attribute (e.g. an availability SR for a fraud-detection
service).
derivation_skill: derive-security-from-risk is mandatory.
Step 4: Confirm
bash scripts/verify-traceability.sh requirements/<engagement>
Must exit 0. Then regenerate the RTM:
bash scripts/gen-rtm.sh requirements/<engagement>
Pitfalls
- DO NOT emit a generic "encrypt everything" SR with no threat
cited. Generic controls produce generic audits and miss the actual
risk.
- DO NOT parent an SR to a threat record directly — the threat is
the justification (cited in the body); the parent is always a
ratified requirement.
- DO NOT mark
measurable: true without defining how it is
measured. The gate cannot tell, but the auditor can.
- DO NOT ratify the SR from the agent. The Security Architect (or
a human approver) sets
ratified_by after review.
- DO NOT write an SR that mitigates a threat without an owner. An
unowned control is an unowned control failure six months from now.
Verification
1---
2name: derive-security-from-risk
3description: Derives security requirements from a named threat.
4tier: practical
5category: workflow
6created_by: human
7platforms: [windows, macos, linux]
8tags: [security, requirements, traceability, togaf, threat-modelling]
9verifier: traceability-sample
10author: Andreas Wasita (@andreaswasita)
11metadata:
12 source: https://skillmd.com/skills/gabrielmoreira/derive-security-from-risk
13---
14
15# Derive Security From Risk
16
17Turns a ratified business driver or functional requirement — together
18with a named threat — into a Security Requirement (SR) the gate can
19verify. This skill does NOT propose generic controls and does NOT
20parent SRs to unspecified parent risks; every SR names the obligation
21or threat it satisfies.
22
23## When to Use
24
25- A `BR-*` or `FR-*` exists for the engagement and processes regulated
26 data, money, identity, or controlled access.
27- A threat modelling session (STRIDE, LINDDUN, attack tree) has
28 produced a concrete threat the architecture must mitigate.
29- A compliance obligation (PCI, HIPAA, APRA CPS 234, GDPR, ISO 27001
30 Annex A) maps to a control the design must enforce.
31- **NOT** when nobody can name the threat yet — run a threat-modelling
32 session first; do not derive a control to look productive.
33
34## Prerequisites
35
36- The parent `BR-*` or `FR-*` exists in
37 `requirements/<engagement>/` and is ratified.
38- A named threat or obligation is recorded in
39 `requirements/<engagement>/threats/<threat-id>.md` (free-form, but
40 the SR body must cite it).
41- `spec/artifact-schema.md` is the contract for SR frontmatter.
42
43If no named threat exists, stop. The TOGAF red thread breaks the
44moment a control mitigates a threat nobody named.
45
46## How to Run
47
48```bash
49bash scripts/verify-traceability.sh requirements/<engagement>
50# create requirements/<engagement>/SR/SR-NNN.md
51bash scripts/verify-traceability.sh requirements/<engagement>
52```
53
54## Quick Reference
55
56| Action | Tool | Notes |
57|---|---|---|
58| Read parent BR/FR | `view` | Get exact `id`. |
59| Read threat record | `view` | The threat ID goes in the SR body. |
60| Write SR | `create` | Frontmatter per schema; `measurable: true`. |
61| Verify lineage | `bash scripts/verify-traceability.sh` | Must pass before commit. |
62
63Example SR frontmatter:
64
65```yaml
66---
67id: SR-003
68layer: SR
69title: PII masking before persistence
70parent_ids: [BR-001, FR-002]
71owner: security.lead@example.com
72measurable: true
73ratified_by: ""
74target: "Zero unmasked PII fields in storage; verified by daily DLP scan."
75derivation_skill: derive-security-from-risk
76tags: [pii, masking, data-protection, threat-T03]
77---
78```
79
80## Procedure
81
82### Step 1: Assess
83
84- Read the parent artifact with `view`. Confirm the data classification
85 (public / internal / confidential / regulated) is stated.
86- Read the threat record. Confirm it names a threat actor, a target
87 asset, and a damaging outcome. A "threat" of "users might do
88 something bad" is not a threat — stop.
89
90### Step 2: Derive
91
92For each named threat or obligation, produce one SR with:
93
94- A **control statement** that names what the system MUST or MUST NOT
95 do (RFC 2119 register, not prose).
96- A **measurable target**: a scan, a metric, an audit query, an
97 attestation cadence. If the control cannot be measured the gate
98 rejects it.
99- A **traceable obligation**: cite the threat ID or the
100 regulation clause in the body. The agent never invents the
101 obligation — it cites one.
102
103### Step 3: Link
104
105- `parent_ids` includes the affected `BR-*` and/or `FR-*`. SRs MAY
106 also parent to an `NFR-*` when the control constrains an existing
107 quality attribute (e.g. an availability SR for a fraud-detection
108 service).
109- `derivation_skill: derive-security-from-risk` is mandatory.
110
111### Step 4: Confirm
112
113```bash
114bash scripts/verify-traceability.sh requirements/<engagement>
115```
116
117Must exit 0. Then regenerate the RTM:
118
119```bash
120bash scripts/gen-rtm.sh requirements/<engagement>
121```
122
123## Pitfalls
124
125- **DO NOT** emit a generic "encrypt everything" SR with no threat
126 cited. Generic controls produce generic audits and miss the actual
127 risk.
128- **DO NOT** parent an SR to a threat record directly — the threat is
129 the *justification* (cited in the body); the parent is always a
130 ratified requirement.
131- **DO NOT** mark `measurable: true` without defining how it is
132 measured. The gate cannot tell, but the auditor can.
133- **DO NOT** ratify the SR from the agent. The Security Architect (or
134 a human approver) sets `ratified_by` after review.
135- **DO NOT** write an SR that mitigates a threat without an owner. An
136 unowned control is an unowned control failure six months from now.
137
138## Verification
139
140- [ ] `SR-*.md` filename equals its `id`.
141- [ ] `parent_ids` resolves to ratified `BR-*`/`FR-*`/`NFR-*`.
142- [ ] Body cites a named threat ID or a specific regulatory clause.
143- [ ] `target` describes how the control is measured.
144- [ ] `bash scripts/verify-traceability.sh requirements/<engagement>` exits 0.
145- [ ] `bash scripts/verify.sh` passes the full gate.