Free preview

The Threat a Deployment System Uniquely Carries

This lesson goes beyond the design

The design's security row lists MFA, OAuth, encryption at rest and in transit, secure coding practices, firewalls, intrusion detection, and IAM with least privilege. Every item is correct and every item would appear unchanged on any other system in this module.

None of them addresses what makes a deployment system different, which is the subject here. The mechanisms below — artifact signing, provenance, verification at install — are standard practice at every large infrastructure organization and are what an interviewer is listening for when they ask about securing a deployment pipeline.

The asymmetry

A deployment system is the highest-value target in any infrastructure

Consider what this system is, stated plainly:

A service with authenticated write access to the executable running on every production machine, in every region, that can push a change to all of them in minutes.

Nothing else in the module has that property. Compromise the newsfeed service and you can manipulate feeds. Compromise the payment system and you can move money. Compromise the deployment system and you own every service the company runs — including the payment system, including the logging that would show what you did, and including the system you would use to remediate.

The blast radius is not one system; it is all of them, plus the recovery path.

Compromise a service        -> that service's data and capability
Compromise the DEPLOYMENT   -> arbitrary code on every machine,
                               and the tool you'd use to fix it

That asymmetry is why the generic security controls, though necessary, are not sufficient. MFA on the deployment console protects the front door. It says nothing about whether the bytes that reach production are the bytes that were built — and that gap is the one that has produced the largest real-world compromises of the last decade.

When a system's compromise implies compromise of everything downstream, its security requirement is not access control but integrity of the artifact it produces.

Where the pipeline can be subverted

#AttackWhat generic controls catch
  1. Malicious commit
Compromised developer credentials push a backdoorMFA helps; code review is the real control
  1. CI configuration
Modify the build config to inject a stepNothing here — config is often less reviewed than code
  1. Build worker
A compromised worker modifies the artifact after compilationNothing — the build output is trusted implicitly
  1. Dependencies
A poisoned package pulled at build timeNothing — dependencies are fetched and trusted
5–6. Storage / replicationArtifact substituted at rest or in transit between regionsEncryption in transit helps; at-rest substitution by an authorized writer does not
  1. P2P swarm
A compromised peer serves modified chunks to thousandsNothing — peers are trusted because they are yours
  1. Install
The machine installs whatever it receivedNothing — no verification step exists

Steps 3 and 7 are the ones this design makes worse than average

Two entries deserve emphasis because they are consequences of decisions made earlier in this chapter.

The build worker (3). Lesson 5 concluded that build workers are ideal candidates for cheap, interruptible, spot capacity — stateless, disposable, easily replaced. That is correct for economics and it means the machine that compiles your production code is the least-hardened machine in your fleet. A worker that modifies the binary after compilation produces an artifact that passes every test (the tests ran before the modification) and looks entirely normal downstream.

The P2P swarm (7). Lesson 6 justified peer-to-peer partly on the grounds that peers are trusted because they are your own servers. But "yours" is not "uncompromised" — and P2P inverts the usual blast radius:

Client-server: compromise the blob store -> you can serve bad bytes
P2P:           compromise ANY ONE of 2,000 peers
               -> it serves bad chunks to the swarm
               -> which propagates them further

Peer-to-peer distribution turns a single compromised machine into a distribution channel. That is not a reason to avoid P2P — it is a reason that P2P requires content verification, which is exactly how BitTorrent has always worked and which this design does not mention.

The mechanism: verify the artifact, not the channel

Content addressing plus signing closes most of the surface at once

The single most valuable change is to stop trusting the path an artifact travelled and start verifying the artifact itself.

Content-address everything. Identify an artifact by the hash of its bytes, not by a name or a location:

Instead of:  regional-blob/myservice/latest
Use:         sha256:9f2c4a...  and store it under that hash

Now substitution is detectable by definition — modified bytes produce a different hash, and a consumer asking for a specific hash cannot be handed something else. This closes steps 5, 6, and 7 in one move, and it composes with the P2P chunk verification that swarms need anyway and the dedup from Lesson 3. One mechanism, three benefits.

Sign at the point of build. The build worker signs the artifact hash with a key it holds only for that purpose:

signature = sign(sha256(artifact), build_key)

Verify at the point of install. The application server checks the signature before executing anything:

if not verify(signature, sha256(downloaded), trusted_public_key):
    refuse to install, alert

That is the step this design entirely lacks, and it is the one that matters most — because the last link in the chain is the only place where verification catches every earlier compromise. Verify at install and it does not matter whether the substitution happened in blob storage, in replication, or in the swarm.

Verify content at the point of use, not at each hop — the same principle as end-to-end checksums, and for the same reason: intermediate verification only proves that hop was honest.

Provenance answers a different question: not 'is it intact' but 'where did it come from'

Signing proves the artifact has not changed since the build. It does not prove the build was legitimate.

Provenance — an attestation, generated by the build system, recording:

source repository and commit SHA
the build configuration used
the exact dependency versions resolved
the builder identity and timestamp
the hash of the resulting artifact

signed by the build system and stored alongside the artifact. Now the question a deployment can ask is not "is this artifact intact?" but "was this artifact built from commit abc123 of our repository, by our build system, with reviewed dependencies?"

That is what catches step 2 (a modified build config produces a different attestation) and step 4 (a poisoned dependency is recorded in the attestation and can be checked against a policy).

It also solves an operational problem that has nothing to do with security. During an incident, "what is running on these machines and where did it come from?" is a question teams routinely cannot answer quickly. Provenance makes the answer a lookup.

And it enables a policy gate: refuse to deploy an artifact whose provenance does not satisfy the rules — built from main, all dependencies from approved sources, tests recorded as passed. That gate belongs exactly where Lesson 8 found a missing controller.

Reproducible builds

The property that makes verification independently checkable

A reproducible build is one where the same source and same dependencies always produce a byte-identical artifact.

Most builds are not. They embed timestamps, build numbers, absolute paths, or non-deterministic file ordering — so two builds of the same commit produce different bytes.

That has a security consequence and an operational one.

Security: if builds are reproducible, anyone can rebuild from source and check they get the same hash. The build system stops being something you have to trust and becomes something you can audit — and independent rebuilders can detect a compromised builder without access to it.

Operational: it also fixes the duplicate-execution problem from Lesson 4. When the heartbeat lease misfires and two workers build the same commit, reproducibility guarantees the two artifacts are byte-identical, so it does not matter which one wins. Without it, the ambiguity is real.

Reproducibility converts trust in the builder into a verifiable claim — and, as a side effect, makes at-least-once build execution harmless.

What to say in an interview

Four sentences, in order of value

"The deployment system has write access to every production machine, so its compromise implies compromise of everything downstream — including the tooling I'd use to remediate. So access control is necessary but the real requirement is artifact integrity.

I'd content-address artifacts by hash, which makes substitution detectable by definition and composes with both the P2P chunk verification and the storage dedup this design already wants.

I'd sign at build and verify at install — the last link is the only place that catches every earlier compromise, and this design currently installs whatever it received without checking.

And I'd generate signed provenance recording source commit, build config, and resolved dependencies, then gate deployment on a provenance policy. That catches the attacks signing alone misses — a modified build config or a poisoned dependency — and it answers 'what is running and where did it come from?' during an incident."

The reason this lands: it is the one part of a deployment system design where the generic answer is visibly generic. MFA and encryption at rest apply to every system ever designed. Naming the supply chain shows you understood what makes this system different — which is the same skill every other chapter in this module has been testing.

Key takeaway

A deployment system has write access to the executable on every production machine, so its compromise implies compromise of everything downstream plus the recovery path — which makes its security requirement artifact integrity, not access control. The design's list (MFA, OAuth, encryption, IAM) is correct and would be identical for any system in the module. Two of this design's own decisions worsen the exposure: build workers are the least-hardened machines in the fleet, and P2P turns one compromised peer into a distribution channel. The mechanisms are content addressing (which also gives chunk verification and dedup), sign at build and verify at install — the last link is the only place that catches every earlier compromise — and signed provenance gated by policy, which catches modified build configs and poisoned dependencies. Reproducible builds turn trust in the builder into a verifiable claim, and incidentally make duplicate build execution harmless.

Next: the evaluation.

Enjoying the preview?

Create a free account to unlock the rest of this course, the in-browser judge, and live AI mock interviews.

Sign up free to continue