CSSLP Exam Prep · Topic 2 of 5

Secure Software Design & Threat Modeling

STRIDE · DREAD · Attack Trees · DFDs · Zero Trust · Security Architecture · OAuth 2.0

Study with Practice Tests →

Secure Software Design & Threat Modeling

Domain 3 (~14%) of the CSSLP CBK. Security architecture and threat modeling decisions made during design phase are the most cost-effective — far cheaper to address than post-deployment fixes.

~14% of Exam · Domain 3

CSSLP 8-Domain Overview

DomainWeightKey Topics
1. Secure Software Concepts10%CIA, AAA, security principles, risk
2. Secure Software Requirements14%Requirements, privacy, compliance, abuse cases
3. Secure Software Design14%Threat modeling, STRIDE, security architecture, auth design
4. Secure Software Implementation14%Secure coding, injection, crypto, code review
5. Secure Software Testing14%SAST, DAST, IAST, fuzzing, pen testing
6. Secure Software Lifecycle Management11%DevSecOps, SDLC integration, metrics
7. Secure Software Deployment & Ops11%Deployment, configuration, patch management
8. Secure Software Supply Chain12%Third-party risk, SBOM, CI/CD security

Core Concepts at a Glance

STRIDE Threat Model

6 threat categories: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege. Each maps to a security property it violates. Applied to every component and data flow in the system.

DREAD Risk Scoring

Rates each identified threat on 5 dimensions (1–3 each, max 15): Damage, Reproducibility, Exploitability, Affected Users, Discoverability. Higher score = higher priority threat to mitigate.

Attack Trees

Root = attacker's goal. Child nodes = attack methods (AND = all must succeed; OR = any one suffices). Used to enumerate all paths to a goal and identify highest-leverage defensive chokepoints.

Data Flow Diagrams

DFDs decompose the system into: external entities, processes, data stores, and data flows. Dashed lines show trust boundaries — every flow crossing a boundary is a threat modeling candidate.

Zero Trust Architecture

"Never trust, always verify." No implicit trust from network location. Identity-based access, microsegmentation, continuous verification, assume breach posture. Replaces perimeter-based "castle and moat" model.

OAuth 2.0 & JWT

OAuth 2.0: authorization framework with multiple grant types (Authorization Code + PKCE preferred for users; Client Credentials for services). JWT: Header.Payload.Signature — always validate algorithm, reject alg=none, set expiry.

Exam Tips

Threat Modeling Timing

Threat modeling is a DESIGN phase activity — not implementation. The output of threat modeling feeds back into security requirements and design decisions. Update threat models when architecture changes significantly.

STRIDE → CIA Mapping

Spoofing=Authentication, Tampering=Integrity, Repudiation=Non-repudiation, Info Disclosure=Confidentiality, DoS=Availability, EoP=Authorization. Know these mappings cold — exam uses them frequently.

JWT Pitfalls

Three common exam traps: alg=none attack (always reject), weak HMAC secret (use asymmetric RS256 for production), missing exp claim (tokens never expire). Store in HttpOnly cookies, not localStorage.

STRIDE & Threat Modeling

Threat modeling is a structured process to identify, rate, and mitigate security threats during the design phase. STRIDE is the most common framework applied in software threat modeling.

STRIDE Threat Categories

ThreatViolatesExampleCountermeasures
SpoofingAuthenticationAttacker impersonates a legitimate user or serviceMFA, mutual TLS, digital signatures, Kerberos
TamperingIntegrityAttacker modifies data in transit or at restHMAC, TLS, digital signatures, input validation
RepudiationNon-repudiationUser denies having performed an actionTamper-evident audit logs, digital signatures, NTP-synced timestamps
Information DisclosureConfidentialityUnauthorized exposure of sensitive dataEncryption at rest/transit, access controls, data masking
Denial of ServiceAvailabilityOverwhelming resources to prevent legitimate useRate limiting, WAF, load balancing, circuit breakers
Elevation of PrivilegeAuthorizationGaining higher rights than granted (e.g., user → admin)Least privilege, RBAC, input validation, sandboxing

Threat Modeling Process

Step 1 — Decompose

Create a DFD of the application. Identify: external entities (users, third-party services), processes (app components), data stores (databases, files), and data flows between them. Draw trust boundaries around components with different security levels.

Step 2 — Identify Threats

Apply STRIDE to each element and data flow in the DFD. Ask: "How could an attacker exploit this component or flow?" Focus especially on data flows that cross trust boundaries — these are the highest-risk points.

Step 3 — Rate Threats

Score each identified threat using DREAD (1–3 per dimension, max 15) or CVSS. Prioritize mitigation by risk score. High-score threats with low mitigation cost should be addressed first.

Step 4 — Countermeasures

For each threat, define a specific security control: accept (document residual risk), mitigate (add control), transfer (contract/insurance), or avoid (remove the risky feature). Document the decision.

Step 5 — Validate

Verify that defined countermeasures actually address the identified threats. Update threat model when architecture changes. The threat model is a living document — not a one-time activity.

DREAD Scoring

Damage · Reproducibility · Exploitability · Affected Users · Discoverability
Each 1–3, max total = 15. Use to rank threats by severity and prioritize remediation roadmap.

Data Flow Diagram (DFD) Elements

ElementSymbolDescriptionThreat Modeling Focus
External EntityRectangleOutside system boundary (user, external service, browser)Source of untrusted input — apply Spoofing and Tampering
ProcessCircle/OvalTransforms or acts on data (application component, API)All STRIDE threats apply — EoP, DoS especially relevant
Data StoreParallel linesWhere data is persisted (DB, file, cache, secret store)Information Disclosure, Tampering, Repudiation
Data FlowArrowData moving between elementsTampering, Information Disclosure — especially cross-boundary flows
Trust BoundaryDashed lineWhere security level changes (internet→DMZ→internal)Every flow crossing boundary must be validated and authenticated

Attack Trees

AND Nodes

Attacker must succeed at ALL child sub-goals to achieve the parent goal. AND nodes = harder to exploit (multiple conditions). Focus defenses here — blocking any one child blocks the entire path.

OR Nodes

Attacker needs to succeed at only ONE child sub-goal. OR nodes = more attack paths (easier to find a way in). Defenses must cover ALL branches, not just one.

Example: "Steal Credentials"

OR: Phish user | Brute-force password | Exploit password reset
Each is an independent path to the goal. Defenses must address all three: MFA, lockout, secure reset token.

Security Architecture Patterns

Security architecture translates security requirements and threat model outputs into concrete design decisions that are embedded into the system structure.

Core Architecture Patterns

Defense in Depth

Multiple overlapping security layers — no single point of failure. Layers: Network (firewall, IDS) → Host (EDR, patching) → Application (WAF, input validation) → Data (encryption, access control). Attacker must bypass all layers.

Zero Trust Architecture

Three tenets: Verify identity explicitly (MFA, device health). Use least privilege access (just-in-time, just-enough access). Assume breach (microsegmentation, encrypt east-west traffic, full telemetry). No implicit trust from network location.

Secure by Default

Product ships with the most secure configuration: no default passwords, minimal open ports, TLS enforced, logging enabled. Users must explicitly opt out of security — not opt in. Reduces risk from misconfiguration at deployment.

Least Common Mechanism

Minimize shared resources between users and processes. Example: separate database schemas or connections per tenant prevents data leakage. Shared caches, temp files, and session stores can all be vectors for cross-user data exposure.

Fail Secure

On failure, the system defaults to denying access — not granting it. Circuit breaker pattern: if downstream service is unavailable, return an error rather than partial/unsafe data. Firewall default deny on rule engine failure.

Microsegmentation

Divide the network into small zones with tightly controlled east-west traffic between them. Limits blast radius of a breach — attacker cannot freely move laterally. Enforced via software-defined networking (SDN) or host-based firewalls.

Microservices Security Design

ConcernDesign PatternExample
Service-to-service authMutual TLS (mTLS), JWT with service identityEach service has its own certificate; mTLS enforced on all internal calls
API access controlAPI Gateway: centralized auth, rate limiting, routingKong, AWS API Gateway validates tokens before routing to services
Secrets managementNever hardcode; use dedicated secrets managerHashiCorp Vault, AWS Secrets Manager, injected via environment at runtime
Container securityMinimal images, non-root user, read-only FSAlpine base image, USER nonroot, resource limits, no privileged mode
Logging & observabilityStructured logs with correlation IDs, centralized SIEMEvery request tagged with trace ID; logs shipped to ELK or Splunk
Data isolationSeparate DB per service, no direct cross-service DB accessEach microservice owns its schema; cross-service reads via API only

Security Principles Applied to Architecture

PrincipleArchitectural DecisionExample
Least PrivilegeService accounts scoped to exact needsPayment service can only read/write payments table — no other DB access
Complete MediationRe-validate permissions on every API callSession token + RBAC check on every request, no cached decisions
Separation of DutiesDeploy pipeline requires multiple approvalsDeveloper → PR Review → Security Gate → Ops Approval → Deploy
Defense in DepthWAF + input validation + DB constraintsWAF blocks obvious attacks; app validates semantics; DB enforces types and constraints
Psychological AcceptabilitySSO reduces friction while maintaining securityOne login for all internal tools; MFA prompted only for sensitive actions

Authentication & API Security Design

Authentication and authorization design decisions made early in the SDLC have outsized security impact. Choosing the right protocols and avoiding known pitfalls is critical for the CSSLP exam.

OAuth 2.0 Grant Types

Grant TypeUse CaseSecurity NotesStatus
Authorization Code + PKCEWeb apps, mobile apps with user loginMost secure for user flows; PKCE prevents code interception in public clients✅ Recommended
Client CredentialsMachine-to-machine (no user)Client ID + secret; use short-lived tokens; rotate secrets regularly✅ Recommended
Device CodeLimited-input devices (TV, CLI)User completes auth on separate device; polling for token✅ Situational
ImplicitOriginally for SPAsToken in URL fragment — logged in browser history, referer headers❌ Deprecated
Resource Owner PasswordTrusted first-party apps onlyPassword sent to authorization server — bypasses consent; avoid⚠️ Avoid

OpenID Connect (OIDC) vs SAML

OIDC (OpenID Connect)

Identity layer on top of OAuth 2.0. Adds ID Token (JWT) containing user claims (sub, email, name). REST/JSON based — modern and mobile-friendly. Discovery endpoint: /.well-known/openid-configuration. Use for new web and mobile applications.

SAML 2.0

XML-based federated identity protocol. Identity Provider (IdP) issues XML assertions to Service Provider (SP). Enterprise SSO standard — widely deployed in legacy enterprise. More verbose but deeply integrated in corporate environments (Okta, ADFS, Ping).

JWT Security Rules

Always: validate alg (reject none), validate iss (issuer), aud (audience), exp (expiry). Use RS256 (asymmetric) over HS256 (shared secret) for distributed systems. Store in HttpOnly Secure cookies — not localStorage (XSS vulnerable).

Secure API Design Principles

PrincipleWhy It MattersImplementation
Input validation on all inputsPrevents injection, overflow, logic bypassType, length, format, range checks server-side; allowlist approach
HTTPS onlyTokens and data exposed in plaintext over HTTPHSTS header, redirect HTTP → HTTPS, TLS 1.2 minimum
Rate limitingPrevents brute force, credential stuffing, DoSPer-IP and per-user limits; exponential backoff on failures
Principle of Least DisclosureReduces information leakageReturn only necessary fields; no debug info in responses
CORS allowlistWildcard * with credentials not allowed by browsersExplicit Access-Control-Allow-Origin list; Vary header
VersioningDeprecate insecure endpoints cleanly/api/v1/ routing; sunset headers for deprecated versions

Common Design-Level Vulnerabilities

IDOR (Insecure Direct Object Reference)

API endpoint uses user-supplied ID without verifying the user has access to that resource. GET /api/orders/12345 — does this user own order 12345? Fix: object-level authorization check on every request. Also called Broken Object Level Authorization (BOLA) in OWASP API Top 10.

Mass Assignment

Framework auto-binds all user-supplied JSON fields to a model object. Attacker adds "isAdmin": true. Fix: use explicit allowlist (DTO pattern) — only bind fields that should be user-controllable. Common in Rails, Laravel, Node.js frameworks.

JWT alg=none Attack

Attacker modifies JWT header to "alg": "none", removes the signature, and the server accepts it. Fix: always validate the algorithm explicitly — reject any token where alg is not in your approved list. Never trust the algorithm from the token header without validation.

Practice Quiz — Secure Software Design & Threat Modeling

10 questions covering STRIDE, threat modeling, security architecture, and authentication design.

1. In the STRIDE model, which threat category directly violates the Integrity security property?
2. Which STRIDE threat category is most directly countered by implementing tamper-evident audit logging?
3. In a Data Flow Diagram used for threat modeling, dashed lines represent:
4. Which OAuth 2.0 grant type is most appropriate for machine-to-machine API communication with no user interaction?
5. A JWT with `alg: none` in its header should be:
6. Which security architecture principle ensures a system defaults to denying all requests when a component fails?
7. In DREAD risk scoring, what does the second "D" stand for?
8. An attacker accesses another user's data by changing a user ID in an API URL (e.g., /api/orders/123 → /api/orders/456). This is an example of:
9. Zero Trust Architecture is based on which core principle?
10. Which threat modeling methodology uses a tree structure where the root node represents the attacker's goal?

Memory Hooks

Six sticky anchors for the highest-yield Design & Threat Modeling concepts.

🎯
STRIDE Mapping
"S=Auth · T=Integrity · R=Non-repud · I=Conf · D=Avail · E=AuthZ"
Spoofing violates Authentication. Tampering violates Integrity. Repudiation violates Non-repudiation. Information Disclosure violates Confidentiality. Denial of Service violates Availability. Elevation of Privilege violates Authorization. Map each to its CIA+ property — exam tests this constantly.
🌳
Attack Trees
"Goal at Root · AND=All Must Succeed · OR=Any One Suffices"
Root = what the attacker wants. AND nodes = harder (all children must succeed). OR nodes = easier (any path works). Defenses placed at AND node choke points block the most paths. OR nodes require covering every branch — miss one and the attacker wins.
🗺️
Threat Modeling Steps
"Decompose → STRIDE → DREAD → Countermeasures → Validate"
Done in the DESIGN phase. DFD is the input — trust boundary crossings are where threats live. Output feeds updated security requirements. Living document: update whenever architecture changes significantly.
🛡️
Zero Trust Tenets
"Verify Explicitly · Least Privilege · Assume Breach"
No free pass for being "inside" the network. Every request verified via identity + device health + context. Just-in-time and just-enough access. East-west traffic encrypted and segmented. Full telemetry and analytics — assume you're already breached.
🔑
OAuth 2.0 Flows
"Code+PKCE=Users · Credentials=Machines · Implicit=DEAD"
Authorization Code + PKCE: user-facing web and mobile apps. Client Credentials: service-to-service (no user). Device Code: input-limited devices. Implicit: DEPRECATED — tokens in URL fragment leak in browser history and server logs. OIDC adds identity (ID Token/JWT) on top of OAuth 2.0.
🔐
JWT Security
"Reject alg=none · RS256 > HS256 · HttpOnly Cookie"
alg=none attack: attacker strips signature, server accepts it if not validated. Always validate algorithm header — reject anything not on your approved list. RS256 (asymmetric) preferred over HS256 (shared secret) in distributed systems. Store tokens in HttpOnly Secure cookies — localStorage is XSS-vulnerable.

Flashcards & Study Advisor

Click any card to flip it. 8 high-yield concept cards for rapid review.

👆 Click a card to reveal the answer

STRIDE Full Expansion
All 6 threats and what each violates
S=Spoofing (Authentication)
T=Tampering (Integrity)
R=Repudiation (Non-repudiation)
I=Information Disclosure (Confidentiality)
D=Denial of Service (Availability)
E=Elevation of Privilege (Authorization)
DREAD Scoring
What are the 5 dimensions and the max score?
D=Damage · R=Reproducibility · E=Exploitability · A=Affected Users · D=Discoverability. Each scored 1–3. Max total = 15. Higher = higher priority threat. Used to rank and prioritize which threats to mitigate first.
DFD Trust Boundary
What do dashed lines represent and why do they matter?
Dashed lines = trust boundaries: where data crosses from one security trust level to another (e.g., internet → DMZ, external user → application). Every data flow crossing a trust boundary is a candidate for all STRIDE threats and must be examined for authentication, authorization, and data validation.
Mutual TLS (mTLS)
How does mTLS differ from standard TLS?
Standard TLS: only the server authenticates with a certificate. mTLS: BOTH client and server present certificates and authenticate each other. Used for service-to-service authentication in microservices and Zero Trust architectures. Prevents spoofing of internal services.
IDOR vs Mass Assignment
What's the difference and the fix for each?
IDOR: accessing another user's object via manipulated ID — missing object-level authorization. Fix: check "does this user own this resource?" on every request.
Mass Assignment: auto-binding all user fields including privileged ones. Fix: explicit allowlist (DTO pattern) of bindable fields only.
Implicit OAuth Flow
Why is it deprecated and what replaced it?
Implicit flow returns the access token directly in the URL fragment — visible in browser history, server logs, and referer headers. Deprecated in OAuth 2.1. Replaced by Authorization Code + PKCE for single-page apps and mobile apps. PKCE (Proof Key for Code Exchange) prevents code interception attacks in public clients.
Attack Tree AND vs OR
Which is harder for the attacker? Where should you place defenses?
AND nodes: attacker must succeed at ALL children — harder. Place defenses on AND nodes to block the most paths with single control. OR nodes: attacker needs only ONE child — easier. All branches of OR nodes must be defended, or the attacker uses the undefended path.
Zero Trust vs Perimeter Security
What assumption does each model make about internal traffic?
Perimeter (castle-moat): trust everything inside the network — fast but dangerous; lateral movement unchecked after initial breach. Zero Trust: verify every request regardless of location — identity + device health + context checked every time. Microsegmentation limits blast radius. Assume breach mindset drives architecture.

Study Advisor

Select a topic for targeted exam-day guidance.

STRIDE & Threat Modeling

  • Apply STRIDE to each DFD element: External Entity (Spoofing, Repudiation), Process (all 6), Data Store (Tampering, Info Disclosure, Repudiation), Data Flow (Tampering, Info Disclosure).
  • STRIDE-per-element: apply all 6 categories to each component. STRIDE-per-interaction: apply to each data flow crossing a trust boundary. Latter is more thorough but more work.
  • Output of threat modeling feeds into security requirements — not just "nice to have" design notes. Each threat should have a corresponding requirement and countermeasure.
  • Microsoft Threat Modeling Tool and OWASP Threat Dragon automate DFD creation and STRIDE analysis.
  • PASTA (Process for Attack Simulation and Threat Analysis): 7-stage, risk-centric alternative to STRIDE — more business risk focused.

Ready to pass the CSSLP?

Practice with full-length adaptive exams covering all 8 domains.

Start Free Practice Tests →