Security as a blocking gate: supply chain, review, immutable audit, and separation of duties

A security control that warns is a control that is ignored. Block the build, refuse the unsigned image at admission, keep the audit trail immutable and elsewhere — and give the exception path a logged, reviewed door.

Read the briefing
About 3 min to read 6 drills

What to remember

  1. Warn-only is off. Every warning becomes noise within a sprint. If it matters, fail the build or refuse admission.
  2. Signing without verification changes nothing. Cosign in CI plus an admission policy that verifies is a control; signing alone is a habit.
  3. Pin by digest — dependencies, base images, CI actions. A moving tag in your pipeline is remote code execution you scheduled yourself.
  4. An attacker with root edits local logs. Audit is evidence only if it left the host within seconds and lands write-once somewhere else.
  5. Build identity ≠ deploy identity ≠ developer identity. Separation of duties means the pipeline's credentials are not a person's, and the author is not the sole releaser.

The big picture

This is the engineering half of security: gates that actually block, a supply chain that is pinned and verified, duties separated so one compromise is not total, and an audit trail that survives the compromise it is supposed to record.

The mental model

Ask of each control: does it stop the action, or merely mention it? And of each record: would it still exist if the host that produced it were owned? Anything that fails either question is decoration.

In depth

Gates that block

Useful controls refuse. A policy check that fails the build; an admission controller that rejects an image without a verified signature; a CI step that rejects a destructive migration shipped alongside application code; a linter that fails on a wildcard IAM action. Warn-only modes exist for the rollout period and should have an expiry date, because a warning nobody must act on is noise within a sprint.

The corollary is that every gate needs a documented exception path: a way to proceed that requires an approval, records a reason, and is reviewed afterwards. Gates without doors get bypassed by copy-pasting the pipeline; gates with logged doors get used honestly.

Supply chain: pin, provenance, verify

Pin everything by digest — dependencies via lockfiles, base images by @sha256:, third-party CI actions by commit SHA. A moving tag in a pipeline is arbitrary code execution on a schedule. Provenance: generate an SBOM per build and record how the artefact was produced (SLSA-style attestations). Verify: sign artefacts (Sigstore/cosign) and — the step teams skip — enforce verification at admission, so an unsigned or wrongly-signed image cannot run. Signing without verification is a ritual.

Also treat the pipeline itself as production: its definitions reviewed, its credentials short-lived and federated (OIDC rather than stored keys), and fork-triggered workflows given no secrets.

Separation of duties

Three identities that should not be the same: the developer, the build and the deploy. Concretely: CI's cloud role can push an artefact but not modify production directly; deployment is performed by a controller reconciling from git (or by a job with its own narrow role); production human access is short-lived, approved and audited; and the author of a change is not the only person who can release it.

This is the control that limits blast radius when a laptop or a CI token is compromised, and it is what an auditor is really asking about when they ask who can deploy.

Audit that survives the incident

Audit logs are evidence only if they are immutable and elsewhere: shipped within seconds to a separate account or provider, stored write-once (object lock or equivalent), retained for the regulatory window, and covering the events that matter — authentication, privilege change, key use, secret access, deploys, and break-glass. Then put detection behind it: alerts on privilege escalation, key use outside normal patterns, unsigned or unexpected artefacts, access from unusual identities or regions, and a periodic access review that removes what nobody needs. An attacker with root on the producing host can edit anything still on it — which is the whole argument for shipping fast and storing immutably.

Myths and facts

Myth: Warn-only mode is a reasonable permanent state.

Fact: It becomes background noise. Ship warn-only with an expiry and a plan to enforce.

Myth: We sign our images, so the supply chain is covered.

Fact: Only if something verifies the signature before running it. Unverified signatures are decoration.

Myth: Central logging is enough.

Fact: Central and immutable and fast. Logs an attacker can edit or delay are not evidence.

Myth: Separation of duties slows small teams down too much.

Fact: The mechanical version — distinct build and deploy identities, GitOps, short-lived human access — costs little and is what limits a compromise.

Myth: Pinning by tag is fine if it is a version tag.

Fact: Tags move. Pin by digest or commit SHA and update deliberately.

How pros do it

  • Make controls block, with a documented, logged and reviewed exception path.
  • Pin dependencies, base images and CI actions by digest; generate SBOMs; verify signatures at admission.
  • Use federated short-lived credentials in CI; give fork-triggered workflows no secrets; review pipeline definitions like code.
  • Keep developer, build and deploy identities distinct; prefer pull-based deployment so CI holds no cluster credentials.
  • Ship audit off-host within seconds to write-once storage, alert on anomalies, and run periodic access reviews.

Questions people ask

How do I introduce a blocking control without stopping the team?

Warn-only with an expiry date, then enforce on the date. Publish the violations per team, fix them with the owners, and flip to blocking when the deadline arrives — the expiry is the mechanism, because a warning nobody must act on becomes noise within a sprint. Keep a time-boxed, logged exception path so the deadline can hold without blocking a real release.

What is the minimum viable admission policy?

Reject unsigned images and images from outside your registry; add resource and security-context rules after. Signature verification at admission is the one rule that stops a supply-chain substitution — it is the enforcing half of signing. The caveat is the policy engine's mode: a perfect rule in warn mode blocks nothing.

Where should audit logs go?

A separate account or provider, write-once, within seconds. Compromising the workload must not compromise the record, so the log leaves the host before an attacker with root can edit it and lands where the same credentials cannot reach. Retention follows the regulatory window, not disk size.

Is SBOM generation worth it?

Yes, and it is cheap. An SBOM per build turns 'are we affected by this CVE' from an investigation into a query, which is the moment you actually need it. It only pays off if something stores and indexes it — an SBOM nobody can search is a file.

How often should access be reviewed?

Quarterly at minimum, and automatically for anything time-limited. The review's value is removal: access nobody uses is blast radius waiting for a credential leak. If a review confirms everything and removes nothing, it was not a review.

Further reading

Drills · 6

Answer in your head, or out loud, before you reveal. Mark each one: "Again" brings it back, "Got it" counts on your desk.

1 Pick the strongest answer

How do you know what is running in production is what you built? Say your pipeline signs every image with cosign and pushes the signatures to the registry, but nothing in the cluster checks them. What have you actually got?

  1. Very little as a control: signing without verification proves provenance only to whoever bothers to check, so an attacker who can push an image to the registry or alter the deployment reference still runs unsigned code. Add signature verification at admission. Verification is the enforcing half; signing alone is provenance nobody consults.
  2. Nothing at all — cosign is only useful for public artefacts. It is widely used for private registries; the gap here is enforcement, not the tool.
  3. Compliance coverage, which is the main benefit. An auditor asking 'what enforces this' will find the same gap.
  4. Full supply-chain integrity, since the signature proves the image came from CI. It proves it to a verifier; with no verifier the property is unused.
In short

Almost nothing: a signature helps only when something checks it, so add signature verification at admission.

Why

The pattern generalises: every security artefact needs a consumer that refuses. Signatures need admission verification, SBOMs need a policy that reads them, attestations need a key policy that checks them.

The common mistake

Treating signing as the control. Signing without verification is provenance nobody consults; the substitution attack it was meant to stop still works.

Read the docs

2 Scenario: what do you do next?

You want to make image-signature verification blocking in a 12-team cluster. A dry run shows 40% of running workloads would be rejected: some are third-party charts, some are old images nobody rebuilt, two are vendor appliances that cannot be signed.

Step 1. How do you make that a hard gate without stopping twelve teams?

  1. Enable enforcement cluster-wide at the weekend and let teams fix what breaks. Breaks 40% of workloads and burns the credibility you need for the next control.
  2. Leave it in warn mode until all violations are fixed. With no deadline the count never reaches zero, and warn-mode findings become noise.
  3. Exempt any workload a team says is critical. That is every workload, and the exemption has no review or expiry.
  4. Enforce by namespace with a dated rollout: publish the violations per team, enforce first where the paved path already signs, give the rest a deadline with help, and carry an explicit, reviewed allow-list for the vendor appliances. Incremental enforcement with named owners and a deadline is what actually lands; the allow-list makes the exception visible rather than pretending.

Step 2. Three teams miss the deadline, citing releases. What now?

  1. Enforce with no exceptions. Blocks releases and makes the next control a political fight.
  2. Quietly exclude their namespaces. An undocumented exemption is exactly what an auditor and an attacker both look for.
  3. Enforce as agreed but offer a time-boxed, logged exception per workload with a named owner and an expiry — so the deadline holds, the release is not blocked, and the debt is visible and dated. Keeps the control credible while acknowledging real delivery pressure.
  4. Extend the deadline for everyone. Teaches that deadlines move, and the teams who did the work are penalised.

Step 3. Six months later?

  1. A wiki page listing exempt workloads. Not enforced, not expiring, not reviewed.
  2. The policy is enforced where it was easy and warn-only elsewhere. That is the state you started in, with more configuration.
  3. Zero standing exceptions except the reviewed vendor allow-list, verification enforced in every namespace, a monthly report of exceptions and their ages, and the same rollout pattern reused for the next control. The durable outcome is the pattern: dry run, publish, deadline, dated exceptions, enforce.
In short

Enforce namespace by namespace with a dated deadline, publish violations per team, and keep a reviewed allow-list for the vendor appliances.

Why

This tests whether you can land a control in a real organisation. The reusable pattern — dry run, publish per team, dated deadline, time-boxed logged exceptions, enforce — is the answer, and the vendor allow-list shows you can be pragmatic without being vague.

The common mistake

Leaving it in warn mode until the count reaches zero. Without a deadline it never does, and warn-mode findings are noise within a sprint.

Read the docs

3 Pick the strongest answer

If one of your hosts is fully compromised, which audit-logging setup would still tell you what happened?

  1. Events shipped off-host within seconds to a separate account with write-once retention, covering authentication, privilege change, key use, secret access and deploys, with alerts on anomalies. Fast, elsewhere, immutable, and covering the events an attacker generates.
  2. Verbose local logs with generous disk retention and nightly backup. An attacker with root edits them, and a nightly backup captures the edited version.
  3. Centralised logs in the same account with the workloads, retained for a year. One compromised role can often reach both the workload and the logs.
  4. Application logs only, since infrastructure events are noisy. Privilege change and key use are exactly the events you need.
In short

Ship events off the host within seconds to a separate account with write-once storage, and alert on unusual patterns.

Why

The design question is "would this record still exist if the thing being recorded was compromised". That forces the three properties: off-host quickly, different trust boundary, and write-once.

Read the docs

4 Find what's broken

You are asked to sign off on this pipeline for a regulated workload. Six lines fail the review. Find all six.

# pipeline and cluster policy (excerpt)
uses: some-org/deploy-action@v3
policy_mode = "warn"
image_ref = "registry.example.com/api:latest"
admission_policy = ["cosign signature verified against the CI identity", "images only from registry.example.com"]
ci_credentials = "long-lived IAM user key in repo secrets"
deploy_method = "CI runs kubectl apply with cluster-admin"
audit_logs = "cluster audit log on the control-plane node, 7 days"
In short

The six problems are the unpinned action, the warn-only policy, the :latest tag, the long-lived IAM key, CI deploying with cluster-admin, and node-local seven-day audit logs.

What's broken
  • Line 6: A long-lived IAM user key in repo secrets is the single most commonly compromised CI credential.
  • Line 7: CI holds cluster-admin and applies directly, so the pipeline is a single point of total compromise and there is no separation between build and deploy.
  • Line 4: The image is referenced by the mutable latest tag, so what runs is not what was built and tested.
  • Line 3: Policy runs in warn mode with no expiry, so the admission rules on line 5 — signature verification included — produce findings and block nothing.
  • Line 2: The third-party action is referenced by a moving tag, so whoever controls v3 can run code in your pipeline with its secrets — a supply-chain hole you scheduled yourself.
  • Line 8: Audit logs live on the control-plane node for 7 days — an attacker with node access edits them, and the retention is shorter than most incident timelines, let alone the regulatory window.
Why

Line 5 is the one line that is right — signature verification against the CI identity plus a registry restriction — and line 3 is why it currently blocks nothing. Each of the six flagged lines is a total-compromise or silent-deploy path on its own.

Read the docs

5 Answer out loud

Design the security posture for a delivery platform that runs regulated workloads — supply chain, gates, identities, audit, detection — and tell me how you would roll it out to teams that are already shipping. Five to seven sentences.

In short

A strong answer fixes credentials and deploy separation first, then pins and verifies artefacts, and ships audit logs off the host.

What a strong answer does
  • coverage: Pinned digests, SBOM, signing with admission verification, blocking gates with logged exceptions, distinct developer/build/deploy identities, federated short-lived credentials, immutable off-account audit, anomaly detection, access reviews.
  • adoption: Dry run, per-team violation reports, dated deadlines, time-boxed logged exceptions, paved path that makes compliance the easy option.
  • judgment: Sequences by leverage — credentials, deploy separation, digests, then verification — and names what is deliberately left for later.
  • communication: Threat-first framing, mechanisms in leverage order, adoption plan, and the evidence each control produces.
Why

Strong answers sequence by leverage, insist on verification and blocking, design audit to outlive the host, and have a credible adoption pattern.

Read the docs

6 Quick recall

You sign every artefact in CI. What is the one thing that has to exist before that signature is worth anything?

In short

Something must verify the signature before the artefact runs, such as an admission policy.

Accepted

verification at admission · verifying the signature before running · signature verification

Why

Verification — an admission policy (or equivalent gate) that refuses unsigned or wrongly-signed artefacts. Signing alone is provenance nobody consults.

That's the last lesson in mission 07 Pick your next mission
Drill · Security as a blocking gate
0:00

Loading…