Skip to content
Tutorials Center
My learning

Topics

Lesson 8 of 38 ยท Shared Responsibility and Threats

Threat Modeling for Cloud Workloads

Learn a practical four-question threat modeling process, draw data flow diagrams, apply STRIDE to cloud components, and rank risks with a runnable scoring example.

Threat modeling is the habit of asking "what could go wrong with this design?" before you build it, while changes are still cheap. It does not require special software. A whiteboard, a diagram and a structured list of questions are enough. For cloud systems it is especially valuable, because a design decision such as "this function can read every queue" becomes a permission in production a few hours later.

The four questions

A popular lightweight method uses four questions:

  1. What are we building? Draw it.
  2. What can go wrong? Use a checklist such as STRIDE.
  3. What are we going to do about it? Mitigate, accept, transfer or avoid.
  4. Did we do a good job? Review and test.

Step 1: draw a data flow diagram

Show the components, the data stores, who talks to whom, and the trust boundaries where the level of trust changes (internet to your edge, your network to the provider's management plane, one account to another).

flowchart LR
    User["Browser (untrusted)"] -->|"HTTPS"| CDN["CDN / WAF"]
    CDN --> API["API service"]
    API -->|"role-based access"| DB[("Orders database")]
    API --> Q["Message queue"]
    Q --> Fn["Worker function"]
    Fn --> Store[("Object storage")]
    subgraph Boundary["Your cloud account"]
        API
        DB
        Q
        Fn
        Store
    end

Everything inside the box is in your account; the arrow from the browser crosses a trust boundary.

Step 2: apply STRIDE

STRIDE is a mnemonic for six kinds of threats. Each one violates a security property.

STRIDE: first half

Spoofing Pretending to be someone
Tampering Changing data or code
Repudiation Denying an action

Violates authenticity, integrity, non-repudiation.

1 / 2

Apply it to each component and each data flow. A few cloud examples:

Threat Cloud example Typical mitigation
Spoofing Stolen access key used to call the API MFA, short-lived credentials, signed requests
Tampering Someone edits objects in the storage bucket Write permissions, versioning, object lock, hashes
Repudiation An admin deletes data and denies it Audit logs in a separate, write-only account
Information disclosure Public snapshot of a database Block public sharing, encryption, classification
Denial of service Flood of requests to the API CDN, rate limits, autoscaling limits, quotas
Elevation of privilege Function role can attach admin policies Least privilege, permission boundaries

Step 3: decide what to do

For each threat pick one:

  • Mitigate: add a control (most common).
  • Eliminate: remove the feature or data that creates the risk.
  • Transfer: use a managed service or insurance for part of it.
  • Accept: knowingly live with a low risk, and write that decision down with an owner.

Ranking threats

You rarely have time for everything, so rank. One simple approach multiplies likelihood and impact on a 1 to 5 scale. The program below scores a few threats from the diagram and sorts them. The numbers are the team's judgement, not measurements, and the exercise is mostly about the conversation it triggers.

Python Score and rank threats

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Try changing the likelihood of the public bucket to 5 and watch it move to the top. Teams often re-rank after discussing which controls already exist.

Cloud-specific things to ask

  • Which identities (users, roles, services) can touch each component, and with which permissions?
  • What happens if one account, one region or one credential is lost?
  • What is reachable from the internet, and what only from inside?
  • Where does data cross a boundary, and is it encrypted there?
  • What do we log, and can an attacker with admin access delete it?
  • Which third-party libraries, images and services do we trust?

Make it a habit

  • Do a short threat model whenever you add a component or change a data flow.
  • Keep the diagram and the list in the repository next to the code and update them like code.
  • Turn each mitigation into a task, a test or an automated check.
  • Revisit after incidents: the "what could go wrong" list should grow with what you learn.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does the S in STRIDE stand for?

    STRIDE is Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege.
  2. 2. What is a trust boundary?

    Data crossing a trust boundary needs extra scrutiny such as authentication, validation and encryption.
  3. 3. Which threat does an immutable audit log in a separate account mainly address?

    Protected logs prove who did what, so actions cannot be plausibly denied.
  4. 4. Which is NOT one of the four responses to a threat?

    Accepting a risk is a documented decision; ignoring it silently is not a response.

Summary

  • Threat modeling asks what we are building, what can go wrong, what we will do, and whether it worked.
  • Draw a data flow diagram with trust boundaries, then apply STRIDE to each component and flow.
  • Respond by mitigating, eliminating, transferring or knowingly accepting each risk, and rank by likelihood and impact.
  • Keep the model in the repository and update it as the design changes.

Next: Attack Paths and Blast Radius