Lion Cipher Lab

Turn a threat model into security test cases that run in CI (so the model cannot silently rot)

Why it matters

Most threat models are written once, in a workshop, and then quietly drift away from the code. Six months later someone refactors a route, the ownership check falls out, and the threat model still says 'mitigated' because nobody re-reads a document. The fix is to give the model an executable half: every threat that can be checked by a machine becomes a test, the tests carry the threat's id, and a small script fails the build whenever the model and the tests disagree. Then the model cannot rot silently. In this lab you build a small document-sharing service, model it with STRIDE (16 threats),…

What you'll learn

Steps in this lab

  1. What you are building, and why a threat model needs an executable half
  2. Set up a folder and check Python
  3. Build the service: docshare.py
  4. Smoke test it by hand (optional, two minutes)
  5. Question 1, what are we working on: write the data-flow diagram as text
  6. Question 2, what can go wrong: STRIDE per element into threats.json
  7. Question 3, what are we going to do about it: rewrite each threat as an abuse case
  8. Implement the abuse cases as a unittest suite tagged with threat ids
  9. The traceability gate: trace.py fails the build when model and tests drift
  10. Run both checks in CI on every push
  11. Question 4, did we do a good job: break the service on purpose and measure
  12. Close the gap the suite missed: add T17 and watch the gate enforce it
  13. What not to automate, and say so in the model
  14. Judgment: when this pays off, where it does not, and how a pro does it better

Open the full interactive lab →