Fundamentals

Threat modeling a CI/CD pipeline with STRIDE

STRIDE threat modeling for a CI/CD pipeline: the diagram, trust boundaries, threats in six categories, decisions, controls and how to check that they work.

Szymon Mytych May 27, 2026 10 min read

Why a pipeline needs its own model

On an application diagram, the CI/CD pipeline usually appears as a single arrow labelled “deploy”. In reality it is a separate system with its own privileges: it writes to the repository, publishes images to a registry, obtains an identity in the cloud and deploys changes to production. Whoever takes control of it can ship arbitrary code to every customer without touching the application itself. We cover this in more detail in CI/CD Hardening — What It Is and Why Companies Ignore It.

That is why the pipeline deserves its own model, like any other system. Below we work through a complete model on a typical example: a repository on GitHub, runs in GitHub Actions, a container image registry and a Kubernetes cluster in the cloud. With GitLab CI, Jenkins or Azure DevOps the settings have different names, but the questions stay the same.

The method and where it comes from

We build the model around four questions that Adam Shostack described as the Four Question Frame: what are we working on, what can go wrong, what are we going to do about it, and did we do a good job. The same questions underpin the Threat Modeling Manifesto and the OWASP Threat Modeling Cheat Sheet, which turns them into four phases: system modeling, threat identification, response and mitigations, and review and validation. The steps in this article follow those questions.

For the second question we use STRIDE — six threat categories developed at Microsoft in the late 1990s by Loren Kohnfelder and Praerit Garg. Each category is a violation of one security property, and for a pipeline it translates into a concrete question:

CategoryProperty violatedQuestion for the pipeline
SpoofingauthenticationWho or what can act as the trusted pipeline?
TamperingintegrityWhat can be changed between a commit and production?
Repudiationnon-repudiationCan we establish who deployed a change and on what basis?
Information disclosureconfidentialityWhere can secrets or code leak?
Denial of serviceavailabilityWhat can stop a build or a release?
Elevation of privilegeauthorizationWhere can code or a person do more than they should?

Step 1. What are we working on: the pipeline diagram

The model starts with a data flow diagram. In our example it has eight elements:

A trust boundary is a point where data or commands pass between areas with different levels of trust. In this pipeline we mark five of them:

pull request (including from a fork)
    |   [1] code from outside the team triggers a workflow
    v
repository + workflow definitions
    |
    v
runner --[2]--> actions, base images, packages from registries
    |  \--[3]--> cloud identity (OIDC or a key)
    v
image registry
    |   [4] the cluster runs whatever it finds in the registry
    v
production cluster

run logs --[5]--> anyone with access to the repository

The diagram must reflect what is actually in the workflow files and repository settings, not how the pipeline was meant to look. Discrepancies found at this stage are often the first threats to record: a forgotten workflow with access to production, a secret nobody uses any more, or a runner shared with another project.

Step 2. What can go wrong: STRIDE at every boundary

At every boundary we ask the questions from all six categories. Not every category produces a threat at every boundary, but going through the full list means the result does not depend on who runs the session and what they happen to remember. In our example we record, among others, these threats:

Spoofing (boundaries 1 and 3). A long-lived cloud key stored as a secret lets anyone who obtains it act as the pipeline from anywhere — more on this in Long-lived tokens in CI/CD. OIDC federation does not solve this on its own: if the cloud trust policy does not check the repository, branch and environment, a workflow started from any branch can obtain a token.

Tampering (boundaries 2 and 4). A third-party action pinned to a tag such as @v4 runs whatever code its author — or whoever has taken over the author’s account — moves that tag to. An image in the registry can be swapped between build and deployment if the deployment refers to a mutable tag such as latest and more identities than the pipeline itself can write to the registry. A third threat is a change to the workflow definition in a pull request that quietly disables tests or scanning.

Repudiation (boundary 4). A deployment started by hand from an administrator’s laptop or from the cloud console leaves no link to a commit, a pull request or an approval. After an incident, nobody can establish which code reached production or who decided it should.

Information disclosure (boundaries 1 and 5). A secret printed to the log by a debugging command or a bug in a script. Log masking relies on an exact match, so a value derived from a secret — for example a token generated from a private key — is not masked unless it is registered as a secret too. A workflow triggered by pull_request_target that checks out and runs code from the pull request gives that code access to the repository’s secrets. We show examples in Secret leaks in CI/CD pipelines.

Denial of service (boundaries 1 and 2). A flood of runs, for example from pull requests opened by new accounts, ties up the runners and delays an urgent release. An outage of a public package or image registry can stop the build on the day you need to ship a security fix.

Elevation of privilege (boundaries 1 and 3). A GITHUB_TOKEN with write access — if it has not been restricted in the settings or in the workflow’s permissions section — lets a compromised step change code or publish a release. A self-hosted runner shared by repositories with different levels of trust can be persistently compromised by code from one of them and then used by the next job, including one with access to production. A cloud role granted to the pipeline “just in case” gives it more than the deployment needs. We have collected similar configuration mistakes in GitHub Actions — 10 most common configuration mistakes.

Step 3. What are we going to do about it: decisions and controls

Every recorded threat gets a decision. There are four options: reduce the risk with a control, remove the element that creates it, transfer the risk, for example through a contract with a supplier, or accept it deliberately. Acceptance is a decision too: it needs a justification, an owner and a date for the next review. A few hours of a public package registry being unavailable can be accepted, provided the team records who made that decision and when it will be revisited.

In our example, selected decisions look like this:

ThreatDecision and controlHow we check that it works
S: stolen cloud keyOIDC federation with a token valid only for the duration of the run; the trust policy checks the repository, branch and environmentAn attempt to obtain a token from another branch or from a fork is refused
T: moved action tagActions pinned to a full commit SHA (or locked with a workflow lockfile where the platform supports it); updates via automated pull requestsA workflow scan, for example the Pinned-Dependencies check in OpenSSF Scorecard, reports no unpinned actions
T: swapped imageImage signed after the build, signature verified at deployment, deployment by digest rather than by tagDeploying an unsigned image to staging is rejected
R: manual deploymentsProduction only from the pipeline, with a required environment approval and a retained run historyFor a randomly chosen release we trace the commit, pull request, approver and run
I: secrets in logs and in fork runsNo secrets in runs from forks, secret scanning in the repository, derived values registered as secretsA test canary secret does not appear in the logs
D: busy runners, unavailable registryConcurrency and job time limits, approval for runs from new accounts, a cache or proxy for packages and imagesA settings review and a trial build with access to the public registry switched off
E: broad GITHUB_TOKEN, shared runnerscontents: read by default, wider permissions only in the job that needs them; ephemeral runners for deployments; a cloud role limited to deploymentA workflow scan (the Token-Permissions check in OpenSSF Scorecard) and a review of cloud roles

The right-hand column matters as much as the middle one. Until someone has checked that a control works, it is only an assumption.

Step 4. Did we do a good job: verification

A recorded decision shows what the team decided. Proof that the control works only comes from checking it. That is why we keep both apart for every threat:

Threat:       T-2, image swapped between build and deployment
Boundary:     4 (registry -> production cluster)
Decision:     reduce the risk
Control:      image signed (cosign) in the build job; signature
              verified by an admission policy in the cluster
Owner:        platform team
Verification: deploying an unsigned image to staging was
              rejected; result and date attached to the ticket
Status:       implemented and verified

We cover image signing and verification in more detail in Artifact integrity in DevOps.

We also check the model itself. Does the diagram still match the workflow files? Has every boundary been through all the categories? Do accepted threats have current review dates? Records like these are useful later in audits and customer security questionnaires: they show which risks were considered, who made the decision and how the controls were verified.

When to revisit the model

The pipeline model needs an update whenever something changes that touches a trust boundary:

The simplest approach is to keep the model in the repository next to .github/workflows/, for example as a Markdown file with the diagram and the decision table. A CODEOWNERS file can route every workflow change to someone who knows the model, and the pull request template can ask whether the change touches any of the five boundaries. An update then usually concerns one boundary and a few rows of the table, and the history of the model follows the history of the pipeline.

What you have at the end

After working through the four questions, the team has:

A pipeline is a good place for a company’s first threat model: it has few elements, it is fully described in configuration files, and almost every element has a path to production. The same method — diagram, STRIDE at every boundary, decision, control and verification — can then be applied to your applications.

Sources

Threat modelingSTRIDEPipeline SecurityFundamentals