Threat model driven security
Skill roronoazoroshao369/vibe-coding-os/skills/core/threat-model-driven-security
Vibe Coding OS — Claude/Codex/Cursor skill framework with 139 skills, 111 commands, 95 templates, 22 tracked sources, 28/28 validation gates PASS. Quality Shield, Engineering Discipline Pack, plugin marketplace.From the repository description
npx -y skills add roronoazoroshao369/vibe-coding-os --skill threat-model-driven-securityAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
8.3 KB, ~1.9k tokens by cl100k_base, as published. Nobody here has run it
Skill: Threat-Model-Driven Security
Purpose
Design security before building by mapping trust boundaries, applying the STRIDE 6-letter lens, and writing abuse cases alongside use cases. Counter the anti-pattern "auth checklist at the end" by forcing a threat-model-first workflow that surfaces attack surface, adversary capabilities, and mitigations during design rather than during a post-implementation review.
When to use
Use when designing a new feature with auth, data access, external input, or any user-trust boundary. Also use when adding a new endpoint, changing a permission model, integrating with an external system, or reviewing an existing system for hidden attack surface. Triggers include:
- New endpoint, route, or API surface
- Permission model change (RBAC, ACL, scopes)
- External integration (third-party API, OAuth, webhooks)
- Sensitive data handling (PII, secrets, financial)
- Post-incident: "we should have threat-modeled this"
Inputs
- Feature spec or in-progress implementation
- Data flow (who sends what to whom, where it is stored)
- Existing auth/authz model
- Trust boundaries list (or generated list — see step 1)
- External system list (and their threat models if available)
Workflow
- Map trust boundaries. Identify all boundaries where trust changes level:
- User → frontend
- Frontend → backend API
- Backend → database
- Backend → external service (third-party API, OAuth provider)
- Backend → internal service (microservice, queue)
- User → external system (e.g. user uploads to S3 directly) For each boundary, document: who is on each side, what data crosses, what auth/authz is applied, what the failure mode is if auth is bypassed.
- Enumerate assets. For each trust boundary, list what is being protected:
- Data assets (PII, secrets, financial records, intellectual property)
- Capability assets (admin actions, irreversible operations, financial transfers)
- Availability assets (rate limits, quotas, compute)
- Identify adversaries. For each asset, list potential adversaries:
- Anonymous external (no credentials)
- Authenticated low-privilege user
- Authenticated high-privilege user (admin, ops)
- Compromised internal service (credential leak, supply chain)
- Malicious internal actor (insider threat)
- Apply STRIDE 6-letter lens. For each (boundary, asset, adversary) tuple, evaluate:
- S — Spoofing — can the adversary pretend to be someone else?
- T — Tampering — can the adversary modify data in transit or at rest?
- R — Repudiation — can the adversary deny an action they took?
- I — Information Disclosure — can the adversary read data they shouldn't?
- D — Denial of Service — can the adversary degrade or block service?
- E — Elevation of Privilege — can the adversary gain higher access than authorized?
- Write abuse cases alongside use cases. For each use case, write at least 1 abuse case showing how an adversary would subvert it. Use
templates/threat-model-template.md. - Prioritize mitigations. For each STRIDE finding, score: likelihood (1-3) × impact (1-3). Mitigations for score ≥6 are mandatory; 3-5 are recommended; ≤2 are tracked but not blocking.
- Wire mitigations into the design. Place each mitigation in the design (not after). For each mitigation, document: control type (preventive/detective/corrective), implementation cost, residual risk.
- Plan the verification. Specify how to prove each mitigation works: penetration test, automated test, manual code review, threat-model re-review after change.
Outputs
templates/threat-model-template.mdfilled with: trust boundaries, assets, adversaries, STRIDE matrix, abuse cases, mitigations, verification- Optional ADR for non-obvious security decisions
- A pre-merge verification step in the feature's quality gate
Failure modes
- Threat modeling after implementation (defensive cramming; misses design flaws)
- STRIDE applied to the system instead of to (boundary, asset, adversary) tuples (loses granularity)
- Adversaries limited to "external attacker" (misses insider threat, compromised services)
- Mitigations without verification (no proof they work)
- "Auth checklist at the end" (treats security as a layer, not a property)
- Threat model not updated when the design changes (decays)
STRIDE quick reference
| Letter | Threat | Question | Example mitigation |
|---|---|---|---|
| S | Spoofing | Can the adversary impersonate? | MFA, signed tokens, mTLS |
| T | Tampering | Can the adversary modify data? | Integrity hashes, signed payloads, append-only logs |
| R | Repudiation | Can the adversary deny actions? | Audit logs with non-repudiation, signed receipts |
| I | Information Disclosure | Can the adversary read data? | Encryption at rest/transit, access control, redaction |
| D | Denial of Service | Can the adversary degrade/block? | Rate limits, circuit breakers, capacity planning |
| E | Elevation of Privilege | Can the adversary gain higher access? | Least privilege, defense in depth, security boundaries |
Common rationalizations to reject
| Rationalization | Why it's wrong | Counter |
|---|---|---|
| "We use HTTPS, so it's secure" | HTTPS is one control; STRIDE has 6 dimensions. | Apply full STRIDE per boundary. |
| "Auth is in place, threat model is done" | Auth is one mitigation; many STRIDE threats remain. | Map each threat to a specific mitigation. |
| "It's an internal API, no threat model needed" | Internal APIs are the highest-risk surface (insider threat). | Trust boundary is still a boundary. |
| "We'll add security at the end" | End-of-pipeline security is a layer, not a property. | Threat model during design. |
| "STRIDE is too academic, we use OWASP" | STRIDE and OWASP are complementary, not alternatives. | STRIDE for design, OWASP for checklist. |
| "We don't have time for threat modeling" | Time pressure increases the cost of skipped threat modeling. | Minimum 30 minutes; surface 1-2 high-impact threats. |
| "Pen test will find the issues" | Pen test finds implementation flaws, not design flaws. | Threat model the design first. |
Red flags (must produce remediation)
- Trust boundary without STRIDE coverage
- Adversary model limited to "external attacker" only
- Mitigation without verification
- Score ≥6 finding without a documented mitigation
- Abuse case not written for a use case
- Threat model not updated after a design change
- "We'll add it at the end" — no in-design threat model
Verification checklist
- All trust boundaries mapped
- All assets enumerated
- Adversaries include at least: anonymous external, authenticated low-privilege, compromised internal
- STRIDE applied to (boundary, asset, adversary) tuples
- Abuse cases written for each use case
- Mitigations scored (likelihood × impact) and prioritized
- Score ≥6 mitigations are in the design
- Each mitigation has a verification method
- Threat model updated for any design change
Source alignment
Inspired by addyosmani/agent-skills security-and-hardening category (MIT, verified 2026-06-20). Adapted into Vibe Coding OS with original wording, threat-model-first framing, STRIDE 6-letter lens, abuse-case requirement, and bilingual maintainability notes. Renamed from security-and-hardening to threat-model-driven-security to avoid collision with skills/checklists/auth-quality/ (which is a review checklist) and skills/core/guard-bypass-protocol/ (which is a prompt guard).
Ghi chú tiếng Việt
Kỹ năng này dạy workflow trust boundaries → assets → adversaries → STRIDE → mitigations, không phải "auth checklist ở cuối". Mỗi use case phải có ít nhất 1 abuse case đi kèm. Mỗi mitigation phải có verification (pen test, automated test, manual review). Score ≥6 (likelihood × impact) là bắt buộc phải mitigate. Threat model phải update khi design thay đổi. Tên đổi từ security-and-hardening sang threat-model-driven-security để tránh trùng với checklist review (auth-quality) và prompt guard (guard-bypass-protocol).
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most threat modeling skills give in ~1.9k tokens
Counted across 325 of the 341 authors here whose files we hold, read 2026-09-06
- Use parameterized queries for all database accessin 58 of 325, across 34 files
- Validate all user input with schemasin 52 of 325, across 29 files
- Store tokens in httpOnly cookiesin 50 of 325, across 27 files
- Store secrets in environment variablesin 50 of 325, across 27 files
- Sanitize user-provided HTML before renderingin 49 of 325, across 26 files
- Apply rate limiting to all API endpointsin 48 of 325, across 25 files
- Verify authorization before sensitive operationsin 47 of 325, across 24 files
- Require CSRF tokens on state-changing operationsin 46 of 325, across 23 files
- Return generic error messages to usersin 40 of 325, across 22 files
- Restrict file uploads by size, type, and extensionin 38 of 325, across 20 files
- Run npm audit and fix vulnerabilitiesin 28 of 325, across 16 files
- Redact sensitive data from logsin 25 of 325, across 11 files
Said here and by no other author read
- Document data, auth, and failure mode per boundary
- Identify adversaries for each asset
- Apply STRIDE to each boundary-asset-adversary tuple
- Mitigate findings scoring six or higher
- Place mitigations in the design, not after
- Update the threat model on design changes
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.