Part 10 · Revision sheet
Security and Data Protection
Key Terms
- Defense in depth — no single security control is trusted alone; a layered control still holds if another fails (→ 158)
- Threat modeling (STRIDE) — enumerate what can go wrong at every trust boundary before building, then mitigate and validate (→ 158)
- Authentication vs. authorization — two independent questions, verified identity then permitted action, checked in that order on every request (→ 159)
- Identity lifecycle — registration, password storage, MFA, account recovery, lockout, device/session management as one continuous set of controls (→ 160)
- OAuth 2.0 / OpenID Connect — OAuth delegates authorization (access token); OIDC adds authentication (ID token) for SSO and federation (→ 161)
- Refresh token rotation — every refresh-token use issues a new one and invalidates the old; reuse is a theft signal that revokes the whole chain (→ 162)
- RBAC vs. ABAC — roles-to-permissions (coarse, simple) vs. policy over attributes (fine-grained, complex); both still need a resource-level check (→ 163)
- Envelope encryption — a data key encrypts the value; a KMS master key wraps the data key, so rotation re-wraps keys, not bulk data (→ 164)
- Secret rotation — bounds how long a leaked credential stays useful; short-lived credentials beat scheduled rotation of static ones (→ 165)
- OWASP Top 10:2025 — a ranked, shared checklist of common web-application risks, run alongside — never instead of — a threat model (→ 166)
- Zero trust — never trust by network location; every request and service identity is authenticated and authorized, assuming breach (→ 169)
- Audit log — append-only, tamper-evident who-did-what-when for privileged actions, kept separate from and retained independently of observability logs (→ 171)
Decision Rules
- Run a full STRIDE pass for a new trust boundary or new sensitive data; a short checklist of the same six questions suffices for a low-stakes change (→ 158)
- Authentication and authorization are always both required beyond public data; the only judgment is how much machinery to build, never whether to separate the checks (→ 159)
- Tune lockout thresholds to stop brute force without locking out a legitimate user who mistypes a password (→ 160)
- Use OAuth/OIDC when a third party needs delegated access or SSO/federation is required; otherwise plain session/token authentication is simpler (→ 161)
- Use JWTs when many services must verify independently without a shared store; use server-side sessions when instant revocation matters more (→ 162)
- Use RBAC when permissions are small and stable; use ABAC only when rules genuinely depend on dynamic attributes a fixed role can't express (→ 163)
- Encrypt in transit and at rest always, as a baseline; reserve field-level/envelope encryption for the highest-sensitivity fields only (→ 164)
- Use a managed secrets store and rotation schedule for every production credential; an untracked local env file is fine only on one developer's machine (→ 165)
- Treat a clean OWASP Top 10:2025 pass as necessary, not sufficient — it never replaces a threat model for business-logic flaws (→ 166)
- Harden every API handling untrusted input, including "internal-only" ones — internal callers are often the first thing compromised (→ 167)
- Pair network segmentation with per-request authentication; segmentation alone is blast-radius control, not a complete defense (→ 168)
- Reserve zero trust for systems where internal compromise is realistic; a small, low-stakes internal network can choose perimeter security plus basic auth instead (→ 169)
- Minimize what's collected at intake — data never collected never needs consent, protection, or erasure later (→ 170)
- Use PCI-style scope minimization (tokenization) wherever a sensitive data type can be isolated behind a narrow boundary (→ 171)
- Match secure-lifecycle gate depth to the risk of the change rather than running every gate at full depth on every trivial change (→ 172)
- Adopt SBOM/signing/provenance once a pipeline, team, or artifact distribution grows past what can be checked by hand (→ 173)
Numbers & Formulas
None — this part teaches no standalone numbers or formulas.
Traps
- Authorization inferred from authentication alone — "logged in" treated as "allowed" — the single most common access-control mistake (→ 159)
- An account-recovery flow weaker than login, or one that silently bypasses MFA — the classic real-world breach pattern (→ 160)
- Treating an OAuth access token as proof of identity instead of using OIDC's ID token for that job (→ 161)
- A refresh token reused after rotation going undetected, so theft isn't caught and the whole chain isn't revoked (→ 162)
- Mass assignment — binding an entire request body onto an internal model lets a caller set an unintended field such as role (→ 167)
Self-Quiz
Mark the questions you can explain and choose which topics to revisit.
Answers are available for this page visit. Browser storage is unavailable.
-
Can you run all six STRIDE questions against every trust boundary in a design, not just the obvious one? (no → revisit 158)
-
Can you design the full identity lifecycle — registration, password storage, MFA, recovery, lockout, session management — for a real account? (no → revisit 160)
-
Can you pick RBAC, ABAC, or a resource-level check for a given access rule and name what stops privilege escalation? (no → revisit 163)
-
Can you map a described vulnerability to its OWASP Top 10:2025 category and name a design-level defense? (no → revisit 166)
-
Can you design an audit log for a privileged action and explain how tokenization shrinks compliance scope? (no → revisit 171)