Threat Model and Security Clinic
This is a hands-on session on the capstone repo. No reading substitutes for actually running STRIDE against your own diagram, scanning your own code, and diffing your own IAM.
Retrieval Prompts
- State each letter of STRIDE and what it covers, in your own words.
- Why does STRIDE yield more per hour spent on trust-boundary flows than on internal flows?
- What three sub-problems does the "secrets, dependencies, supply chain" policy cover?
- Define RPO and RTO and give one sentence that distinguishes them.
- What is the experiment that proves a role is least-privilege rather than just narrow-looking?
Compare and Distinguish
- STRIDE vs a security audit
- pinned dependency vs scanned dependency
- secret in
.envvs secret in a secrets manager - managed policy vs narrow inline policy
- "same-account snapshot" vs "cross-account copy"
Common Mistake Check
- "We ran STRIDE but couldn't find gaps, so we're fine."
- "Our
.envhas all the secrets; Git won't commit it by accident." - "
AmazonS3FullAccessis easier; we'll tighten it later." - "We enabled RDS backups, so we're backup-ready."
- "CI uses
Action: *, Resource: *because it deploys a lot of services."
Mini Application
Part A -- STRIDE Pass (60 min)
- Draw your capstone's data-flow diagram. Mark trust boundaries.
- Pick the one flow crossing the highest-value boundary.
- Fill a six-row STRIDE table: mitigated / gap / accepted -- with evidence.
- Pick one real gap. Walk it end-to-end:
- threat -> evidence -> mitigation -> detection -> residual -> deployed
- Commit the worksheet and the walk to
library/raw/threat-model.md.
Part B -- Secrets, Dependencies, Supply Chain (60 min)
- Run
gitleaks detectandtrufflehog filesystem .on your repo. Remediate every finding. - Move at least one secret from
.envto your secrets manager. Verify the runtime fetches it via role. - Add
pip-audit/npm audit/cargo auditto CI with a HIGH/CRITICAL fail threshold. - Enable signed build provenance (GitHub Attestations or
cosign attest) for one artifact. - Commit
library/raw/security-policy.mdas a one-page policy.
Part C -- Least-Privilege Diff (60 min)
- Pick one runtime identity with a suspect policy.
- Record its current effective permissions.
- Replace with a narrow inline policy of only the actions and resources you think it uses.
- Deploy to staging. Record what breaks.
- Widen one permission at a time, each scoped as narrowly as possible.
- Commit the before/after diff to
library/raw/iam.md.
Part D -- Backup Restore Drill (60-90 min)
- Document RPO and RTO in
library/raw/recovery.md. - Restore yesterday's snapshot into a new DB instance.
- Run a canary query on both prod and the restored instance; diff.
- Record total elapsed time. If it exceeds RTO, either invest in faster restore or loosen RTO with rationale.
- Log issues found and convert each into a runbook update.
Evidence Check
- STRIDE worksheet with at least one letter walked to a deployed mitigation
- no secrets found in the repo; at least one secret now loaded from a manager
- CI scans dependencies and fails on HIGH/CRITICAL
- at least one artifact carries signed build provenance
- one IAM role was tightened, something broke, and widening is committed with a diff
-
library/raw/recovery.mdcontains a dated restore drill log with timings and issues found