Skip to main content
Career Paths
Concepts
Security First Design
The Simplified Tech

Role-based learning paths to help you master cloud engineering with clarity and confidence.

Product

  • Career Paths
  • Interview Prep
  • Scenarios
  • AI Features
  • Cloud Comparison
  • Pricing

Community

  • Join Discord

Account

  • Dashboard
  • Credits
  • Updates
  • Sign in
  • Sign up
  • Contact Support

Stay updated

Get the latest learning tips and updates. No spam, ever.

Terms of ServicePrivacy Policy

© 2026 TheSimplifiedTech. All rights reserved.

BackBack
Interactive Explainer

Security-First Design

Threat modeling with STRIDE, defense in depth, zero trust principles, secrets management, and supply chain security.

🎯Key Takeaways
Security is an architecture concern — it cannot be bolted on after the fact. Design decisions made without security create structural vulnerabilities tools cannot fix.
STRIDE threat modeling: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege — apply systematically to every component.
Defense in depth: security controls at every layer (network, identity, application, data, detection) — compromise of one layer does not mean full system compromise.
Never hardcode secrets. Use IAM roles for AWS service access (no keys at all). Use AWS Secrets Manager or Vault for third-party API keys and database passwords.
Least privilege: every identity (user, service, Lambda function) should have only the exact permissions it needs for its specific job — nothing more.

Security-First Design

Threat modeling with STRIDE, defense in depth, zero trust principles, secrets management, and supply chain security.

~6 min read
Be the first to complete!
What you'll learn
  • Security is an architecture concern — it cannot be bolted on after the fact. Design decisions made without security create structural vulnerabilities tools cannot fix.
  • STRIDE threat modeling: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege — apply systematically to every component.
  • Defense in depth: security controls at every layer (network, identity, application, data, detection) — compromise of one layer does not mean full system compromise.
  • Never hardcode secrets. Use IAM roles for AWS service access (no keys at all). Use AWS Secrets Manager or Vault for third-party API keys and database passwords.
  • Least privilege: every identity (user, service, Lambda function) should have only the exact permissions it needs for its specific job — nothing more.

Lesson outline

Security is an architecture problem, not a product problem

The most common misconception in software security: that you can add security at the end. "We will do the security audit before release." "We will enable WAF when we are in production." "We will rotate secrets after launch."

Security that is added after the fact has gaps — design decisions made without security in mind create structural vulnerabilities that tools cannot patch. A WAF cannot fix an IDOR (Insecure Direct Object Reference) bug in your API. An audit cannot undo the fact that your service runs with admin database permissions.

Security-first design

Security is designed into the architecture at every layer — not bolted on afterward. It asks: what could go wrong? Who could misuse this? What is the blast radius if this component is compromised? These questions are asked in design reviews, not in security audits three months later.

Threat modeling with STRIDE

Threat modeling is the practice of systematically identifying what could go wrong with a system before it is built. STRIDE is the most widely-used framework.

ThreatWhat it meansExampleMitigation
SpoofingAttacker pretends to be another user or serviceForged JWTs, session fixation, IP spoofingStrong authentication, signed tokens, certificate pinning
TamperingAttacker modifies data in transit or at restHTTP parameter manipulation, SQL injection, MITMHTTPS everywhere, parameterized queries, input validation, checksums
RepudiationAttacker denies performing an action"I never transferred that money"Immutable audit logs with user, timestamp, and action — CloudTrail, WORM storage
Information DisclosureSensitive data exposed to unauthorized partiesStack traces in API errors, S3 bucket ACL misconfiguration, verbose logsLeast privilege, encrypt at rest, sanitize error messages, no credentials in logs
Denial of ServiceAttacker makes service unavailableDDoS, resource exhaustion via large payloads, regex DoSRate limiting, input size limits, WAF, DDoS protection (CloudFront/Shield)
Elevation of PrivilegeAttacker gains more access than intendedIDOR bugs, JWT algorithm confusion, path traversalAuthorization checks on every request, principle of least privilege, RBAC

How to run a threat modeling session

→

01

Draw a data flow diagram (DFD): every component, every data store, every external entity, every data flow with trust boundaries.

→

02

For each component and data flow, apply STRIDE: which of the six threats apply here?

→

03

For each threat identified, assess likelihood (1–5) × impact (1–5) = risk score.

→

04

For high-risk threats (score ≥ 12), define a mitigation and assign it as a work item.

05

Document assumptions. "We assume the internal network is trusted" is a decision — not a fact. Make it explicit.

1

Draw a data flow diagram (DFD): every component, every data store, every external entity, every data flow with trust boundaries.

2

For each component and data flow, apply STRIDE: which of the six threats apply here?

3

For each threat identified, assess likelihood (1–5) × impact (1–5) = risk score.

4

For high-risk threats (score ≥ 12), define a mitigation and assign it as a work item.

5

Document assumptions. "We assume the internal network is trusted" is a decision — not a fact. Make it explicit.

Defense in depth

Defense in depth means having multiple independent security controls at every layer. A single control failing does not mean the attacker wins — they still must defeat every other control.

Security layers in a cloud architecture

  • Network layer — VPC with private subnets, security groups (allow-list only), NACLs, WAF on the edge, no direct internet access to databases or internal services.
  • Identity & access layer — IAM least privilege, MFA for all human access, OIDC for service-to-service, no long-lived access keys (use role assumption and temporary credentials via STS).
  • Application layer — Input validation, parameterized queries, output encoding, CSRF tokens, Content Security Policy, secure cookie flags (HttpOnly, Secure, SameSite).
  • Data layer — Encryption at rest (KMS-managed keys), encryption in transit (TLS 1.2+), field-level encryption for PII, data minimization (do not store what you do not need).
  • Detection layer — CloudTrail (API calls), VPC Flow Logs (network traffic), GuardDuty (threat detection), Security Hub (compliance posture), access log alerting for unusual patterns.

The attacker's cost model

Defense in depth works by making the cost of a successful attack prohibitively high. Even if an attacker bypasses the WAF, they still need to break the application-layer auth. Even if they compromise an application server, the database is in a private subnet with no direct internet route, encrypted at rest, and the app only has SELECT permission on specific tables. Each layer adds cost to the attack.

Quick check

A developer hardcodes an AWS access key in a Lambda function environment variable to access an S3 bucket. Which security problem does this create?

Secrets management

Secrets (API keys, database passwords, certificates, OAuth tokens) need to be stored securely, rotated regularly, and accessed with minimal blast radius.

MethodSecurity levelProblem
Hardcoded in source code❌ NoneChecked into git forever — every developer and their laptop has it
Environment variables baked into image❌ PoorIn image layers, in CI logs, in kubectl describe pod output
Environment variables injected at runtime (unencrypted)⚠️ PartialVisible in process list, container env dumps, CloudWatch Logs
AWS Secrets Manager / HashiCorp Vault✅ GoodEncrypted at rest, access-controlled by IAM, automatic rotation, full audit trail
AWS Parameter Store (SecureString with KMS)✅ GoodCheaper than Secrets Manager for static secrets; no auto-rotation

The IAM role pattern eliminates most secrets

Most "secrets" in cloud environments are credentials to access other AWS services (RDS, S3, DynamoDB). IAM roles eliminate these entirely — the Lambda function or EC2 instance assumes a role and gets temporary credentials automatically. No keys to store, rotate, or leak. Only use Secrets Manager for third-party API keys and database passwords.

How this might come up in interviews

Security-conscious companies and any senior engineering interview. Often comes up as a follow-up when discussing architecture: "How would you secure this system?"

Common questions:

  • How do you approach security in system design?
  • What is threat modeling and have you done it?
  • What is defense in depth?
  • How do you manage secrets in a cloud application?
  • What is the principle of least privilege?

Key takeaways

  • Security is an architecture concern — it cannot be bolted on after the fact. Design decisions made without security create structural vulnerabilities tools cannot fix.
  • STRIDE threat modeling: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, Elevation of Privilege — apply systematically to every component.
  • Defense in depth: security controls at every layer (network, identity, application, data, detection) — compromise of one layer does not mean full system compromise.
  • Never hardcode secrets. Use IAM roles for AWS service access (no keys at all). Use AWS Secrets Manager or Vault for third-party API keys and database passwords.
  • Least privilege: every identity (user, service, Lambda function) should have only the exact permissions it needs for its specific job — nothing more.
Before you move on: can you answer these?

What does "defense in depth" mean, and why does it matter?

Multiple independent security controls at every layer so that no single failure compromises the entire system. An attacker must defeat every control — network, identity, application, data, and detection — not just one.

Ready to see how this works in the cloud?

Switch to Career Paths for structured paths (e.g. Developer, DevOps) and provider-specific lessons.

View role-based paths

Sign in to track your progress and mark lessons complete.

Discussion

Questions? Discuss in the community or start a thread below.

Join Discord

In-app Q&A

Sign in to start or join a thread.