Security Architecture Fundamentals
1. Executive Summary
Security architecture defines how a system protects confidentiality, integrity, and availability against intentional and accidental threats across people, processes, and technology. At principal level, security is not a checklist of tools—it is a design discipline integrating identity, network segmentation, encryption, supply chain controls, and detective response into every architecture decision.
This chapter covers defense in depth, the zero trust model ("never trust, always verify"), threat modeling with STRIDE, encryption in transit and at rest, AWS IAM and KMS as control planes, and production patterns: WAF, Secrets Manager, GuardDuty, Security Hub, and audit logging via CloudTrail.
Principal architects balance security vs velocity with explicit risk acceptance, measurable controls, and alignment to compliance frameworks—not security theater that blocks delivery without reducing real risk.
2. Why This Topic Matters
Security failures end careers and companies. Interviewers expect:
- STRIDE threat categorization on a whiteboard design.
- Zero trust principles applied to cloud microservices.
- IAM least privilege and blast radius of compromised credentials.
- Encryption key management (KMS, rotation, MRKs for DR).
- mTLS vs TLS termination at load balancer tradeoffs.
- Shared responsibility on AWS—what you must still own.
- Incident response integration: detection, containment, recovery.
Security architecture is distributed systems security: boundaries, trust, and failure modes under attack.
3. Problems Being Solved
| Problem | Security architecture response |
|---|---|
| Unauthorized access | IAM, MFA, RBAC, policy boundaries |
| Data exfiltration | Encryption, DLP, network egress controls |
| Lateral movement | Segmentation, zero trust, short-lived credentials |
| Supply chain compromise | Signed artifacts, dependency scanning, IaC review |
| Insider threat | Least privilege, audit logs, separation of duties |
| DDoS / abuse | WAF, Shield, rate limiting |
| Compliance | Config rules, evidence from CloudTrail |
| Key compromise | Rotation, HSM, MRK, revocation procedures |
Security does not guarantee zero incidents—it reduces likelihood and impact with detectable, recoverable posture.
4. Assumptions and System Model
| Assumption | Implication |
|---|---|
| Breach will occur | Design detection and containment, not only prevention |
| Insiders and bugs exist | Least privilege; no single god-role |
| Dependencies are untrusted | Verify signatures, scan CVEs |
| Network perimeter is insufficient | Zero trust inside VPC |
| Crypto keys are high-value targets | KMS, HSM, rotation |
| Auditability required | Immutable logs, retention policies |
Threat model: Rational adversaries with varying capability—script kiddies to nation-states; design for credential theft and misconfiguration as most common AWS risks.
5. Essential Terminology
| Term | Definition |
|---|---|
| CIA triad | Confidentiality, Integrity, Availability |
| Authentication | Proving identity (who) |
| Authorization | Permitting action (what) |
| Zero trust | Verify every request; no implicit network trust |
| Defense in depth | Layered controls |
| STRIDE | Spoofing, Tampering, Repudiation, Info disclosure, DoS, Elevation |
| mTLS | Mutual TLS—client and server certificates |
| KMS | AWS Key Management Service for encryption keys |
| CMK | Customer Master Key |
| HSM | Hardware Security Module (CloudHSM, KMS custom key store) |
| WAF | Web Application Firewall |
| SCP | Service Control Policy in AWS Organizations |
| SBOM | Software Bill of Materials |
| CSPM | Cloud Security Posture Management |
| MTTD / MTTR | Mean time to detect / respond |
6. Core Mechanism
6.1 Defense in depth layers
- Identity — IAM, SSO, MFA, role assumption.
- Perimeter — WAF, Shield, CloudFront, API throttling.
- Network — VPC segmentation, security groups, PrivateLink.
- Compute — Hardened AMIs, IMDSv2, patch management.
- Application — Input validation, OWASP mitigations, authZ.
- Data — Encryption at rest (KMS), in transit (TLS), tokenization.
- Detection — GuardDuty, Security Hub, CloudTrail anomalies.
- Response — Runbooks, IR teams, automated containment (Lambda).
Failure of one layer should not imply total compromise.
6.2 Zero trust on AWS
Traditional: "Inside VPC = trusted." Zero trust: Every API call and connection is authenticated and authorized regardless of network location.
Practices:
- IAM roles for workloads; no long-lived keys.
- Service-to-service mTLS or IAM SigV4 for AWS APIs.
- Security groups as micro-segmentation—not flat
10.0.0.0/16access. - VPC Lattice / App Mesh for service identity policies.
- Conditional access — MFA for humans;
aws:SourceVpcin policies.
Figure 1: Zero trust layers—edge authentication, service-level authorization, encrypted data with KMS.
6.3 Threat modeling with STRIDE
Apply STRIDE per component or data flow:
| Threat | Example | Mitigation |
|---|---|---|
| Spoofing | Fake service calling API | mTLS, IAM, JWT validation |
| Tampering | Modify S3 object in transit | TLS, signed URLs, checksums |
| Repudiation | Deny placing order | CloudTrail, signed audit logs |
| Information disclosure | S3 bucket public | Block Public Access, SCPs, encryption |
| Denial of service | Flood ALB | Shield, WAF rate limits, autoscaling |
| Elevation of privilege | Compromised role gains admin | Least privilege, permission boundaries |
Process: Diagram data flows → identify assets → STRIDE per flow → prioritize mitigations → verify in tests.
6.4 Encryption architecture
In transit: TLS 1.2+ everywhere; ACM for public certs; internal mTLS for service mesh where needed.
At rest:
- S3 SSE-S3, SSE-KMS, or SSE-C.
- EBS/RDS KMS encryption.
- Secrets Manager encryption with CMK.
Key management:
- CMK rotation annual automatic (AWS-managed) or manual for customer keys.
- Multi-Region Keys (MRK) for DR decrypt in secondary region.
- Key policies + IAM policies both must allow—dual authorization.
- CloudHSM when FIPS 140-2 Level 3 or contractual HSM required.
Principal rule: Encryption without access control is incomplete; KMS policies are authorization layer.
6.5 AWS security services map
| Service | Role |
|---|---|
| IAM / SSO | Identity and access |
| KMS | Key management |
| WAF + Shield | Application DDoS and OWASP rules |
| GuardDuty | Threat detection (ML on VPC Flow, DNS, CloudTrail) |
| Security Hub | Findings aggregation (CIS, PCI) |
| Inspector | Vulnerability scanning for EC2/ECR/Lambda |
| Macie | Sensitive data discovery in S3 |
| Config | Configuration compliance rules |
| CloudTrail | API audit trail |
| Secrets Manager | Secret rotation |
| Network Firewall | IDS/IPS at VPC edge |
Figure 2: AWS security control plane—preventive IAM/encryption; detective aggregation in Security Hub.
6.6 Compliance mapping (informative)
Security architecture often maps to frameworks without being identical:
| Framework | AWS-aligned controls (examples) |
|---|---|
| CIS AWS Foundations | Security Hub benchmark, Config rules |
| PCI DSS | Network segmentation, encryption, logging (scope reduction via tokenization) |
| SOC 2 | Access control evidence from CloudTrail, change management via IaC |
| GDPR | Data residency, encryption, breach notification procedures |
| HIPAA | BAA with AWS, KMS, access logging (not automatic compliance—architecture required) |
Distinction: Compliance attestation is organizational; technical controls enable but do not guarantee audit success.
7. Step-by-Step Walkthrough
Walkthrough A: Threat model a public API
- Draw: Client → CloudFront → WAF → ALB → ECS → RDS.
- STRIDE on client→ALB: spoofing (JWT), tampering (TLS), DoS (WAF).
- STRIDE on ECS→RDS: info disclosure (SG rules), elevation (DB creds in env—use Secrets Manager).
- Prioritize: public S3 risk, SQL injection, IAM overpermission.
- Document mitigations in ADR; track in Security Hub.
Walkthrough B: IAM least privilege for Lambda
- Start with AWS managed policy for prototyping only.
- Replace with inline policy listing specific ARNs: one DynamoDB table, one SQS queue.
- Add permission boundary on role max permissions.
- Enable IAM Access Analyzer — remove unused permissions quarterly.
- CloudTrail alerts on
AttachUserPolicywithAdministratorAccess.
Walkthrough C: Encrypt data path end-to-end
- ACM cert on ALB (TLS 1.3 policy).
- ALB → targets over TLS or within private VPC (threat model dependent).
- RDS storage encryption with CMK;
rds:Encryptedin Config rule. - S3 bucket policy denies
aws:SecureTransport=false. - KMS key policy allows only app role and backup role.
Walkthrough D: Respond to leaked access key
- Disable key immediately in IAM.
- CloudTrail
LookupEventsfor key ID—scope API calls made. - Rotate affected secrets; review S3/EC2 creations.
- GuardDuty findings for exfiltration patterns.
- Postmortem: key was in Git—implement git-secrets, OIDC for CI, no long-lived keys.
Walkthrough E: Organization guardrails
- AWS Organizations with SCP: deny
s3:PutBucketPublicAccessBlockdisable, deny unapproved regions. - Control Tower landing zone — centralized logging account.
- Config aggregator across accounts.
- Security Hub enabled org-wide with CIS benchmark.
- Security Hub custom insights route critical findings to ticketing with SLA by severity.
Walkthrough F: OAuth 2.0 / OIDC for API security on AWS
Public APIs commonly use Amazon Cognito or external IdP (Okta, Auth0) with OAuth 2.0 authorization code flow + PKCE for mobile/SPA:
- Client obtains authorization code from IdP.
- Exchanges code for access token (short-lived) and refresh token (restricted storage).
- API Gateway JWT authorizer or application middleware validates signature,
aud,exp, scopes. - Fine-grained authorization at service layer—JWT scopes are coarse; map to RBAC/ABAC internally.
- Token revocation via short TTL + refresh rotation; Cognito global sign-out for compromise response.
mTLS complements OAuth for service-to-service calls where no human IdP exists—common in mesh architectures.
Walkthrough G: Encryption key lifecycle and DR
- Create customer-managed CMK in primary region with automatic annual rotation enabled.
- Define key administrators (security team) separate from key users (application roles)—separation of duties.
- For multi-region DR, use Multi-Region Keys (MRK) so ciphertext from primary decrypts in DR region after failover.
- Key deletion requires waiting period—document break-glass if key compromise requires disable-not-delete first.
- CloudTrail logs all
kms:Decryptcalls—alert on anomalous principals.
Key lifecycle is architecture, not a one-time setup task.
8. Invariants and Guarantees
| Property | Statement |
|---|---|
| IAM explicit Deny | Overrides Allow |
| KMS dual policy | Key policy + IAM must both permit |
| TLS correct implementation | Protects confidentiality on wire—not endpoint auth alone |
| CloudTrail immutability | With log file validation and restricted delete IAM |
Cryptography provides computational guarantees; operational errors bypass crypto.
9. Failure Scenarios
| Failure | Impact | Mitigation |
|---|---|---|
| Public S3 bucket | Mass data leak | Block Public Access, Macie, SCPs |
| Overprivileged role | Lateral movement | Least privilege, Access Analyzer |
| Stale CVE in container | RCE | ECR scanning, patch pipeline |
| SSRF to IMDS | Credential theft | IMDSv2, hop limit 1, no public IPs |
| KMS key deletion | Data unrecoverable | Waiting period, MRK, backups |
| WAF bypass | Application-layer attack | App validation, rate limits |
| Audit log gap | No forensics | Org trail, log validation, S3 Object Lock |
| Supply chain poison | Malicious dependency | SBOM, signed images, provenance |
10. Performance Characteristics
| Control | Overhead |
|---|---|
| TLS | CPU on handshake; session resumption mitigates |
| KMS encrypt/decrypt | API latency; data key caching in SDK |
| mTLS mesh | Connection setup; cert rotation automation |
| WAF inspection | Latency ms-level; rule complexity matters |
| GuardDuty | No inline traffic inspection—API analysis |
Security controls add latency—budget in performance requirements.
11. Scalability Limits
- IAM policy size limits—use permission sets and ABAC patterns.
- KMS request quotas—request increases for high-throughput encrypt.
- WAF ACL rule limits—prioritize rules; use rule groups.
- CloudTrail volume—management events only vs data events cost.
- Centralized security account as bottleneck—automate with event-driven response.
12. Operational Considerations
- Security champions embedded in product teams.
- Threat model per major feature at design review.
- Vulnerability management SLA by severity (CVSS).
- Penetration testing annual + after major changes.
- Break-glass accounts in vault with MFA and logging.
- Patch cadence for AMIs, EKS versions, Lambda runtimes.
- Disaster recovery for KMS keys and certificate expiry calendars.
Figure 3: Layered response—WAF blocks obvious attacks; authZ limits blast radius; GuardDuty triggers IR.
13. Security Considerations
This section is meta—security of security tools:
- Restrict Security Hub / GuardDuty admin to security account.
- CloudTrail log bucket — deny delete except break-glass; MFA delete on S3.
- Secrets rotation without downtime—dual-secret pattern.
- Third-party SaaS — OAuth scopes, data processing agreements.
14. Cost Considerations
| Item | Notes |
|---|---|
| GuardDuty / Security Hub | Per-account or volume pricing |
| KMS API calls | High-throughput apps—cache data keys |
| WAF | Per rule + request charges |
| CloudTrail data events | Expensive—scope S3 object-level selectively |
| Macie | Sensitive data scanning at scale |
Security spend is risk insurance—justify with threat model priorities.
15. Production Implementations
| Pattern | AWS implementation |
|---|---|
| Landing zone | Control Tower, SCPs, centralized logging |
| Microservice zero trust | App Mesh mTLS, IAM roles per task |
| Data lake security | Lake Formation, column-level permissions |
| CI/CD security | OIDC to AWS, signed containers, CodePipeline scans |
| Hybrid identity | IAM Identity Center + SAML to corporate IdP |
Reference: AWS Security Reference Architecture.
16. Alternatives and Tradeoffs
| Alternative | When |
|---|---|
| VPN perimeter trust | Legacy; insufficient alone for cloud |
| Hardware HSM on-prem | Regulatory; higher ops burden vs CloudHSM |
| Third-party CNAPP | Multi-cloud unified posture |
| Mutual TLS everywhere | High security microservices; ops complexity |
| Network ACL only | Insufficient—stateless, coarse |
Balance pragmatic layered controls vs perfect zero trust timeline.
17. Common Misconceptions
| Misconception | Reality |
|---|---|
| "VPC = secure" | Misconfigured SGs, IAM, public resources |
| "Encryption = secure" | Keys and access policies matter |
| "Compliance = security" | Checkbox vs threat-informed design |
| "Security team owns all security" | Builders own secure code; platform enables |
| "WAF stops all attacks" | App-layer logic flaws remain |
18. Principal Architect Perspective
- Embed threat modeling in architecture review gate—not optional for tier-1.
- Identity is the perimeter in cloud—design roles per workload function.
- Automate guardrails (SCPs, Config) over policy documents alone.
- Measure MTTD for critical findings—not just vulnerability count.
- Align with business risk—don't encrypt public marketing site with HSM.
19. Architecture Review Exercise
Scenario: Team stores DB password in Terraform state plaintext, uses AdministratorAccess for CI role, disables CloudTrail to save cost, allows SSH from 0.0.0.0/0 on bastion.
Findings: Critical—state secrets, god CI role, no audit, open SSH.
Remediation: Remote state with encryption + locking; OIDC CI with least privilege; org CloudTrail; SSM Session Manager replacing SSH; Secrets Manager for DB creds referenced at runtime.
20. Whiteboard Explanation
"Security architecture layers controls: identity with IAM roles and MFA, network segmentation in VPC, encryption with KMS for data at rest and TLS in transit, edge protection with WAF and Shield, and detection with GuardDuty and CloudTrail feeding Security Hub. We assume breach—zero trust means every service call is authenticated and authorized, not trusted because it's inside the VPC. Threat modeling with STRIDE on each data flow finds gaps before build. On AWS, shared responsibility means we own IAM config, encryption choices, and application security; AWS owns the hypervisor."
21. Interview Questions
- CIA triad? — Confidentiality, integrity, availability.
- Zero trust principles? — Verify explicitly, least privilege, assume breach.
- STRIDE categories? — Six threat types.
- IAM role vs user? — Workloads use roles; humans use SSO.
- KMS key policy vs IAM? — Both must allow decrypt.
- mTLS vs TLS at ALB? — Mutual auth vs server-only.
- How detect credential leak? — CloudTrail anomalies, GuardDuty.
- S3 public access prevention? — Block Public Access, bucket policies, SCPs.
- Shared responsibility on EC2? — AWS: host; customer: OS, app, data.
- WAF vs Security Group? — L7 app rules vs L4 stateful firewall.
- Why IMDSv2? — SSRF credential theft mitigation.
- Defense in depth example? — Multiple independent layers.
22. Interview Follow-Ups
- Design security for multi-tenant SaaS on AWS. — Row-level security, tenant IAM namespaces, encryption per tenant keys.
- MRK for DR encryption? — Replicate keys; decrypt in secondary region.
- OAuth vs SAML vs Cognito? — Protocol and use-case fit.
- Container escape mitigation? — Minimal images, read-only root, seccomp, EKS hardening.
- Balance security and developer velocity? — Platform golden paths, automated scans in CI.
22A. Production Low-Level Design (Interview + Game Day)
Public PII REST API on AWS with defense-in-depth layers. Production LLD and Game Day Standard.
Control vs data plane
| Plane | Components |
|---|---|
| Control | IAM, KMS, Cognito/OIDC, WAF rules, CloudTrail, GuardDuty |
| Data | ALB → private app tier → RDS (encrypted); S3 via VPC endpoint |
Step-by-step request security path:
| Step | Control | Failure mode |
|---|---|---|
| 1 | WAF rate limit + OWASP rules | 429 abuse |
| 2 | OIDC short-lived JWT | Revoke on leak |
| 3 | App-layer authZ (not network trust) | IDOR blocked |
| 4 | KMS CMK per tenant optional | Key policy audit |
| 5 | CloudTrail + structured access log | Forensics on PII access |
One SLO
Security ops: 100% PII API paths behind authZ tests in CI; mean time to revoke compromised token < 15 minutes.
22B. Game Day Playbooks
| # | Drill | Inject | Detect | Mitigate | Verify |
|---|---|---|---|---|---|
| GD-1 | Leaked JWT | Simulate token in logs | GuardDuty / anomaly | Revoke session; rotate signing keys | Stolen token rejected |
| GD-2 | WAF bypass attempt | SQLi probe traffic | WAF block metric | Tighten rule; block IP | No DB query executed |
| GD-3 | S3 bucket policy drift | Public ACL simulation | Config rule NON_COMPLIANT | Block Public Access; SCP | Bucket remains private |
GD-1 — Credential leak response
23. Strong Answer Example
Question: "How would you secure a public-facing REST API on AWS handling PII?"
Answer this as a 45-minute greenfield design using the PRACTICE framework. Below is how a strong student sounds aloud—clarify first, layer controls, run STRIDE on a DFD, then defend tradeoffs and residual risk.

Figure A: PRACTICE map — Problem → Requirements → Assumptions → Capacity → Topology → Invariants → Constraints → Evolution.
Student interview script (PRACTICE)
P — Problem framing
"We're securing a public REST API on AWS that stores and returns PII—names, emails, maybe government IDs or account identifiers. Attackers can hit the edge from the internet, so we assume breach is possible and design for prevention plus detection and containment.
Non-goals for v1: multi-region active-active auth, custom HSM appliances, and full DLP for every analytics warehouse. I'll call those out as later phases. I'll treat PII at rest and in transit, identity, and auditability as the core."
R — Requirements
| Type | Requirement |
|---|---|
| FR | Authenticated CRUD on user/profile resources; export/download paths are high-risk |
| NFR | Confidentiality of PII; integrity of records; availability under abuse (rate limits) |
| Compliance | Audit who accessed which PII; encryption evidence for SOC2 / privacy regs |
| Ops | Secrets rotation, incident runbook (token revoke), continuous findings triage |
"I'll ask: B2B API keys or end-user OIDC? Which PII fields? Any PCI/card data mixed in? I'll assume OIDC users + service clients, PII but not full card PAN, AWS multi-account org available."
A — Assumptions (state aloud)
| Assumption | Why it matters |
|---|---|
| AWS control plane (ACM, KMS, IAM, Cognito) | Standard building blocks interviewers expect |
| API workloads in private subnets | No public IPs on app tier |
| Short-lived JWTs (minutes), not long-lived API keys alone | Limits blast radius of stolen tokens |
| App-layer authZ required | Network location ≠ authorization (zero trust) |
| Customer-managed KMS for PII store | Key policy + rotation + audit of decrypts |
"If they say 'API keys only' or 'must support partner mTLS,' I'd add API Gateway usage plans / mutual TLS at the edge—but the private data plane + least privilege story stays."
C — Capacity (back-of-envelope + blast radius)
Peak read QPS → 2,000–5,000 (say)
Auth: Cognito / JWT verify → local JWKS cache; avoid per-request Cognito call
WAF rate limit → per-IP + per-token soft limits; protect login & export
PII decrypt path → envelope encryption; KMS Decrypt not on every row if cached DEK
Blast radius of one task role → one table / one S3 prefix — not account admin
Log volume → CloudTrail + app audit; never log raw PII payloads
"Capacity here isn't just QPS—it's how much an attacker can exfiltrate if one credential or one pod is compromised."
T — Topology (draw this)

Figure B: Edge (CloudFront + WAF) → TLS on ALB → private API → KMS-encrypted RDS/S3; identity via Cognito; secrets via Secrets Manager; detect with CloudTrail / GuardDuty / Security Hub.
Pattern choice: Defense in depth + zero trust at the request—not "VPC = secure."
| Layer | Control |
|---|---|
| Edge | CloudFront, WAF managed rules, Shield Standard/Advanced as needed |
| Transport | TLS 1.2+ (prefer 1.3), ACM certs; HSTS |
| Identity | Cognito (or IdP) OIDC; MFA for humans; no long-lived keys on servers |
| AuthZ | App checks scopes + resource attributes; deny by default |
| Network | Private subnets, SG least ports, VPC endpoints for AWS APIs |
| Data | RDS/S3 encryption with CMK; field-level where high-risk |
| Secrets | Secrets Manager / SSM; rotation; never bake into images |
| Detect | Org CloudTrail, GuardDuty, Config, Security Hub; Macie on S3 |

Figure C: One request through verify → authorize → decrypt → audit; fail closed at token, WAF, scope, or IAM.
I — Invariants (safety)
"Non-negotiable for PII:
- No plaintext PII at rest — CMK-backed encryption; key policy audited.
- AuthN ≠ AuthZ — valid JWT still fails without resource permission.
- Least privilege IAM — task roles scoped to table/prefix; no
*onkms:Decryptacross all keys if avoidable.- Never log secrets or raw PII — structured audit with subject id + action + resource id.
- Assume breach — short token TTL, revoke path, IMDSv2, no SSH bastions with standing access."
Run STRIDE threat model (interview whiteboard)
"Before I lock mitigations, I'll run STRIDE—not as a checklist dump, but on a data-flow diagram with trust boundaries. Process: draw flows → name assets → STRIDE each critical flow → rank by impact × likelihood → map controls → leave residual risk explicit."

Figure D: STRIDE cheat sheet — Spoofing→identity, Tampering→integrity, Repudiation→non-repudiation, Info disclosure→confidentiality, DoS→availability, Elevation→authorization.
Step 1 — Draw the DFD and trust boundaries

Figure E: DFD — Internet / Edge / VPC / Data / Identity / Control-plane boundaries; flows F1–F6 carry JWT, PII, and key material.
Assets (say aloud): PII rows, export files, JWTs/refresh tokens, CMK/DEKs, DB credentials, CloudTrail evidence.
Highest-risk flows for interview depth: login/token (F1–F3) and PII export (F4–F5)—bulk disclosure and privilege abuse live here.
Step 2 — STRIDE each critical flow (student script)

Figure F: Worked STRIDE on Login/Token vs PII Export—threat → mitigation; prioritize export + elevation + info disclosure.
Flow A — Login / token issue & API auth (F1–F3)
| STRIDE | Threat (what I'd say) | Mitigation |
|---|---|---|
| S Spoofing | Stolen / forged JWT; credential stuffing | Cognito MFA for humans; short-lived access tokens; iss/aud/exp checks; revoke refresh; WAF bot rules on /oauth |
| T Tampering | Rewritten JWT claims or request body | Asymmetric JWT signature verify; TLS end-to-end to ALB; server-side schema validation |
| R Repudiation | User denies login or API call | Cognito auth events + app audit (sub, IP, request_id); CloudTrail for admin IdP changes |
| I Info disclosure | Token in logs/URLs; verbose auth errors | Never log bearer tokens; generic 401/403; HttpOnly cookies if browser; short TTL |
| D DoS | Password spray / Cognito flood | WAF rate limit per IP; Cognito advanced security / lockout; Shield |
| E Elevation | role=admin claim injected or confused client | Ignore unverifiable claims; map groups server-side; deny-by-default authZ |
"On spoofing I'd stress: validating a JWT signature is authN—I still need authZ on the resource. That's the zero-trust punchline."
Flow B — PII read & export (F4–F5, KMS F6)
| STRIDE | Threat (what I'd say) | Mitigation |
|---|---|---|
| S Spoofing | Compromised task role calling RDS/S3 as the API | IMDSv2; no long-lived keys; optional mTLS service-to-service later |
| T Tampering | Attacker alters export object or swaps object key | SSE-KMS; bucket versioning; signed checksums; least-privilege s3:PutObject prefix |
| R Repudiation | Insider denies bulk export | App audit of export jobs + CloudTrail GetObject/Decrypt; immutable log bucket |
| I Info disclosure | Public bucket, over-broad Select *, Macie-findable dumps | Block Public Access + SCP; CMK; field minimization; Macie on export bucket; row-level authZ |
| D DoS | Export fan-out exhausts DB / KMS | Rate limit export API; async job quota; KMS request throttling awareness |
| E Elevation | Task role with s3:* / kms:Decrypt on all keys | Table/prefix-scoped IAM; key policy tying decrypt to API role; permission boundaries; Access Analyzer |
Cross-boundary quick hits (show breadth without boiling the ocean):
| Flow | Top STRIDE risks | Control highlight |
|---|---|---|
| F2 Edge→API | T, D | TLS 1.3; WAF OWASP; only ALB SG to tasks |
| F6 API→KMS | I, E | CMK key policy; CloudTrail on Decrypt; no kms:* |
| Secrets path | E, I | Secrets Manager rotation; inject at runtime |
Step 3 — Prioritize (impact × likelihood)
| Priority | Finding | Why first | Control owner |
|---|---|---|---|
| P0 | Bulk PII export / public S3 (I + E) | Regulatory + brand blast radius | Platform + app |
| P0 | Over-broad task role / CMK (E) | One compromise → full datastore | Platform IAM |
| P1 | Stolen JWT reuse (S) | Common; contained if TTL + revoke work | App + IdP |
| P1 | Auth/export DoS (D) | Availability + cover for exfil | Edge + app |
| P2 | Repudiation gaps (R) | Hurts IR and compliance evidence | Sec + app |
"I'd ship P0 controls in M1–M2, not after the pen test. STRIDE that doesn't change the roadmap is theater."
Step 4 — Residual risk (say this—interviewers love honesty)
| Accepted / deferred | Why |
|---|---|
| Determined insider with break-glass | Detect via dual-control + audit; not fully preventable |
| Nation-state against KMS/HSM | Out of v1 scope; AWS shared responsibility + CMK policy |
| Full field-level encryption everywhere | Latency/cost; start with high-risk fields + CMK at store |
| Partner mTLS | Add when B2B requirement lands |
C — Constraints (second C)
| Constraint | Design response |
|---|---|
| Latency | Verify JWT locally; cache DEKs carefully with TTL |
| Cost | WAF + GuardDuty + Macie on sensitive buckets first—not everywhere day one |
| Developer velocity | Golden path IaC module: private API + WAF + CMK + logging defaults |
| Compliance | SCPs: deny public S3, deny leaving org, require CloudTrail |
| Human error | No admin CI role; OIDC deploy roles; break-glass with MFA + ticket |
E — Evolution (phased harden + respond)
Phased delivery:
| Phase | Deliverable |
|---|---|
| M1 | Private API + TLS + Cognito JWT + SG baseline |
| M2 | WAF + rate limits; CMK on RDS/S3; Secrets Manager |
| M3 | Org CloudTrail, GuardDuty, Security Hub CIS; Macie on export bucket |
| M4 | Re-run STRIDE after major changes; pen test; dependency scanning in CI |
| M5 | Incident runbook: revoke tokens, rotate secrets, isolate task role |
Incident snippet I'd mention:
"If we suspect token theft: revoke refresh tokens / user pool sessions, rotate client secrets, invalidate CloudFront if needed, query CloudTrail for
kms:Decryptand data-plane access from that principal, then scope IAM tighter."
Observability / evidence: auth failure rate, WAF blocked counts, anomalous Decrypt geography, GuardDuty findings SLA, Config non-compliance count, export-job audit completeness (repudiation control).
Closing line (interview)
"So: CloudFront + WAF at the edge, TLS into a private API, Cognito short-lived JWTs with app-layer authZ, PII encrypted with customer-managed KMS, Secrets Manager + least-privilege task roles, and CloudTrail / GuardDuty / Security Hub so we detect misuse. I ran STRIDE on a DFD—prioritizing login/token and PII export—so P0 is bulk disclosure and over-broad IAM, not a random tool checklist. Zero trust means the VPC is not the trust boundary—the verified request is."
Scoring signals
| Strong | Weak / red flag |
|---|---|
| Separates authN vs authZ | "Put it in a VPC and use HTTPS" |
| Defense in depth layers | Encryption mentioned with no key ownership |
| KMS CMK + no PII in logs | Long-lived access keys on EC2 |
| Detection + revoke runbook | WAF only, no identity story |
| DFD + STRIDE per flow + P0 ranking | Names STRIDE letters with no assets/flows |
| Explicit residual risk | Claims "fully secure" after WAF |
Compact outline (if time-boxed to 2 minutes)
"Edge: CloudFront + WAF OWASP + rate limit. ALB TLS 1.3. API in private subnets, Cognito OIDC short JWTs, authZ in app. RDS/S3 PII with CMK; Secrets Manager rotation; least-privilege task roles. Org CloudTrail, GuardDuty, Security Hub; Macie on exports; SCPs block public S3. STRIDE on DFD: P0 = export info disclosure + IAM elevation; P1 = stolen JWT + DoS; residual = determined insider. Pen test + CI scans; revoke runbook."
24. Weak Answer Example
Question: "How would you secure a public-facing REST API on AWS handling PII?"
"Use HTTPS, IAM, and enable encryption."
Why weak / red flags: No threat model, no authZ detail, no detection, no secret management, no zero trust—checklist words without architecture.
25. Hands-On Exercise
- Deploy vulnerable-by-design app (e.g., AWS security workshop).
- Run STRIDE threat model; document mitigations.
- Enable GuardDuty and trigger test finding.
- Fix public S3 finding with Block Public Access.
- Implement IAM role least privilege; verify Access Analyzer clean.
- Enable CloudTrail log file validation.
26. Knowledge Check
- Name STRIDE threats.
- What is zero trust?
- Difference authentication vs authorization?
- KMS CMK vs data key?
- Purpose of SCP?
- IMDSv2 benefit?
- CloudTrail vs Config?
- WAF layer in OSI model?
- Shared responsibility for Lambda?
- Why permission boundaries?
- MRK use case?
- Defense in depth example?
27. Flashcards
| Front | Back |
|---|---|
| CIA triad | Confidentiality, Integrity, Availability |
| Zero trust | Never trust network location; verify every request |
| STRIDE | Spoofing, Tampering, Repudiation, Info disclosure, DoS, Elevation |
| Least privilege | Minimum permissions required for function |
| mTLS | Both client and server present certificates |
| KMS CMK | Customer Master Key wrapping data keys |
| SCP | Organization policy guardrail on all accounts |
| GuardDuty | AWS threat detection service |
| CloudTrail | API audit logging |
| IMDSv2 | Session-oriented EC2 metadata access |
| WAF | Web Application Firewall at L7 |
| Defense in depth | Multiple independent security layers |
28. Cheat Sheet
PRINCIPLES
zero trust: verify every call
least privilege IAM
defense in depth
assume breach → detect + contain
AWS IDENTITY
humans: SSO + MFA
workloads: IAM roles (no long-lived keys)
SCPs: org guardrails
ENCRYPTION
transit: TLS 1.2+ (ACM)
rest: KMS (S3, EBS, RDS)
keys: rotation, MRK for DR
DETECTION
CloudTrail (audit)
GuardDuty (threats)
Security Hub (aggregate)
Config (compliance)
THREAT MODEL
diagram flows → STRIDE each → prioritize mitigations
COMMON FAILURES
public S3, open SG, admin CI role, secrets in code
29. Related Concepts
- AWS Fundamentals — IAM, VPC, shared responsibility
- Networking — TLS, DNS, segmentation foundations
- Observability Fundamentals — security logging and audit
- Multi-Region Architecture — MRK, cross-region policies
- Idempotency — secure retry design
- Production Failures — security incident case studies
30. References
Primary sources
- Microsoft. STRIDE Threat Modeling. https://learn.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats
- NIST. Zero Trust Architecture SP 800-207. https://csrc.nist.gov/publications/detail/sp/800-207/final
- Amazon Web Services. AWS Security Reference Architecture. https://docs.aws.amazon.com/prescriptive-guidance/latest/security-reference-architecture/
- Amazon Web Services. IAM Best Practices. https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html
- Amazon Web Services. AWS KMS Developer Guide. https://docs.aws.amazon.com/kms/
- OWASP. Top Ten Web Application Security Risks. https://owasp.org/www-project-top-ten/
Books
- Shostack, A. (2014). Threat Modeling: Designing for Security. Wiley.
- Allen, E. (2020). AWS Security. O'Reilly.
Distinction
- Compliance frameworks (PCI, SOC2) — Audit requirements; map to technical controls.
- AWS service capabilities — Verify current feature sets and regions.