Secure › Module 2 › Lesson 2
Threat in Design
Lightweight threat modeling on YOUR toy app — STRIDE literacy, no stranger prod targets.
Visual · threat_in_design
Threat modeling literacy. $MY_REPO / $TOY_APP only. Original Cyberlium.
Opening
Threats named in design cost less than breaches in production — on YOUR app first.
Threat modeling asks: what are we building, what can go wrong, what mitigations exist? STRIDE (Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege) gives developers a checklist. Cyberlium teaches a one-page threat sketch for $TOY_APP in $MY_REPO — not a formal review of a café ordering SaaS you do not operate. You will NOT publish threat docs that include stranger architecture diagrams scraped from the internet, or use findings as excuse to exploit live shops. Next: Shift Left.
1. What are we building?
Draw a simple data-flow: user browser → your API → database on localhost lab deploy. Mark trust boundaries: public internet vs your server vs data store. List assets: sessions, passwords, PII in your toy schema.
On $MY_REPO, one diagram beats zero. Defenders and architects use the same habit before sprint planning.
Command guide
Try these commands — What are we building?
═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)
OWASP Threat Modeling — https://owasp.org/www-community/Threat_Modeling
═══ INSTALL ═══
Linux (Debian/Ubuntu):
Command — copy this
sudo apt install python3 sudo apt install curl
macOS:
Command — copy this
brew install python3
Windows: Download https://python.org/downloads/ Built-in (PowerShell: Invoke-WebRequest)
═══ LINUX / macOS ═══
Command — copy this
python3 -c "print('Trust boundary: browser -> API -> DB on 127.0.0.1')"
curl -sS -o /dev/null -w '%{http_code}
' --max-time 3 http://127.0.0.1:8820/ || echo 'Toy API offline — still map boundaries on paper'
printf 'boundary: browser to API
data_store: lab only
' > "$HOME/cyberlium-lab/t17-threat.txt"
grep boundary "$HOME/cyberlium-lab/t17-threat.txt"Primary tools to practice this lesson: python3, curl. Reference sites: OWASP Threat Modeling (https://owasp.org/www-community/Threat_Modeling). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.
2. STRIDE at lunch-n-learn depth
For each boundary crossing, ask STRIDE questions. Example: can an attacker tamper with an unsigned request body? Can they elevate via missing auth on /admin in your toy app?
Answers become backlog items: add auth middleware, validate Content-Type, hash passwords with Argon2 — fixes you implement in $MY_REPO.
3. No stranger architecture homework
Threat modeling employer systems without ticket, or a trending startup from a TechCrunch article, is out of scope. Lab stays on $TOY_APP you can reset.
Ship: one data-flow sketch + three STRIDE notes for $MY_REPO. Next: Shift Left.
4. What you ship: threat sketch for $TOY_APP
Data-flow diagram. Three STRIDE findings with planned mitigations. $MY_REPO only. chmod 600.
5. What you record before the next lesson
Date. Threat sketch path. $TOY_APP boundaries noted. File t17-m02-l02-threat-in-design.txt chmod 600.
6. Wrong vs right: stranger apps vs YOUR repo
Worked failure — same MSF word, opposite target. Right never needs a café Wi-Fi or classmate laptop.
Wrong
Threat-model a live shop's checkout from public docs then XSS it. Publish classmate architecture flaws in Discord.
Right
Sketch threats on $TOY_APP in $MY_REPO. Next: Shift Left.
Mission: lightweight threat model
1) Draw data-flow for $TOY_APP. 2) Mark two trust boundaries. 3) Write three STRIDE notes with mitigation ideas. Never model stranger production systems.
Stuck? Ask Cyberlium AI Mentor
STRIDE is a vocabulary — one boundary and three threats is enough for lab credit.
Knowledge Check
APPLY: Threat modeling on Cyberlium applies to:
Multiple choice
Knowledge Check
APPLY: True or False: STRIDE helps name spoofing, tampering, and elevation risks at design time.
True or False
Knowledge Check
APPLY: A STRIDE 'Information disclosure' finding might become:
Multiple choice