advanced24 min studyLesson 440 in Engineering

Rebuild trust after a builder compromise

Scope affected artifacts, separate credential containment from artifact revocation, and reconstruct approved releases without trusting the compromised production path.

On this page

What you’ll understand

  • Distinguish known affected outputs from an uncertain candidate scope.
  • Plan containment, replacement, and deployment reevaluation as separate work.
  • Explain why new signatures alone do not repair compromised output.

An attacker gained control of a builder that could publish inference images and sign their provenance. The resulting signatures may be valid and the provenance may claim the expected source. Recovery cannot rely on those claims alone to clear the same builder's outputs. It needs a controlled containment path, an evidence-based candidate scope, and reconstruction through a restored trust boundary. Reissuing a key or changing a release tag does not remove harmful bytes already running in a service.

Contain authorities while preserving evidence

Restrict the compromised builder's ability to issue new outputs, access secrets, publish artifacts, or create trusted assertions, using the incident's authorized response procedures. Preserve relevant logs, artifact identities, configuration, and access evidence so investigation remains possible. Credential rotation addresses future use of those credentials; artifact blocklisting or changed admission policy addresses acceptance of particular outputs. These are related but different controls. A previously signed artifact can remain deployed after key rotation, while an unaffected artifact might require a carefully justified policy path if an authority is broadly distrusted.

Build a candidate set from the earliest plausible compromise time, affected builder modes, accessible credentials, and downstream consumers. Detection time is not automatically the start of attacker access. Use independent sources such as registry records, deployment inventories, source-control history, and retained artifacts where available. Provenance generated by the compromised builder can help locate claims to investigate, but cannot by itself prove the claims true. Mark uncertain boundaries explicitly and expand investigation when evidence is incomplete. An absence of suspicious log entries is weak reassurance if the attacker could alter those logs.

∣A∪D∣=∣A∣+∣D∣−∣A∩D∣|A\cup D|=|A|+|D|-|A\cap D|
A is a set of directly affected or candidate artifact identities and D a downstream candidate set defined for the investigation. Counts are numbers of distinct artifacts, not probabilities; this set union does not prove either input set is complete.↔ Scroll wide equations horizontally.

Reconstruct from a restored input and execution boundary

Establish a clean build environment with reviewed source identities, approved dependency artifacts, and toolchain inputs whose trust is justified independently of the compromised path. Reusing an untrusted output cache or a base image produced by the attacker can carry the compromise into a new build. Reevaluate the controls that failed, including who can alter build definitions and which platform component generates provenance. A freshly created machine is not sufficient if it automatically downloads the same compromised inputs. Record the actual trust boundary and retained evidence for replacement artifacts.

Run the relevant integrity, provenance, reproducibility, and behavioral checks for the replacement release, recognizing that each answers a different question. A new signature on an old suspect binary changes attribution, not its behavior. Byte-identical rebuilding may help compare a known source and output, but matching a common compromised toolchain is not independent exoneration. Generate replacement attestations through the restored authority and update inventory bindings. Decide which existing deployments need replacement or containment using actual running identities, not merely the current value of a release tag or the success of new admission checks.

W(t)=max⁡ ⁣(0,W0+(λ−μ)t)W(t)=\max\!\left(0,W_0+(\lambda-\mu)t\right)
This illustrative fluid recovery-work backlog uses W_0 jobs and fixed arrival and completion rates λ and μ in jobs/s over elapsed seconds t. It assumes uniform divisible work and does not model artifact trust, dependency constraints, or variable build durations.↔ Scroll wide equations horizontally.

Restore service with an explicitly approved recovery state

A rollback target must be a known approved artifact compatible with the current environment and data, not merely a tag called previous. Confirm that the target lies outside the investigated compromise path or has been independently cleared under the response policy. Track replacement and retirement across production, staging, mirrors, caches, and scheduled jobs as relevant. Monitor for unauthorized publishing or identity use after containment. Keep unresolved candidates visible rather than declaring success when one new release is signed. Recovery is complete only against a stated scope and acceptance criteria whose evidence can be reviewed.

The queue lab can illustrate capacity planning for the reconstruction workload. For each separate run, Reset, set both λ and μ, predict, then Play or Step. With λ=4,μ=2 the initial four-job backlog grows by two jobs per second; with λ=2,μ=4 a fresh four-job backlog drains in two seconds. Control changes are separate fixed-rate runs, not a live intervention on the previous backlog. This exact fluid calculation cannot identify compromised artifacts or clear replacements. It helps show that a response plan needs sufficient completion capacity alongside the independent checks that make each completed job meaningful.

Count candidates and keep unresolved work visible

A fictional investigation identifies six direct candidate artifacts and five downstream candidates, with two identities appearing in both sets. Assume those sets define the current investigation scope, which may expand. Seven distinct candidates have completed the stated replacement or independent-clearance criteria.

  1. The current union contains 6+5−2=9 distinct candidates. Counting eleven would double-count the two shared identities.

  2. Seven of those nine have completed the specified criteria, leaving two unresolved. The completion fraction is 7/9≈77.78% within this current nonempty candidate set.

  3. Keep the two unresolved candidates contained or handled under the response policy, and investigate whether the candidate scope itself is complete. A 77.78% work-completion figure is not a probability that the remaining deployments are safe.

The result

The current scope has nine candidates, seven completed and two unresolved. Neither rotating credentials nor signing one replacement automatically closes those remaining artifact decisions.

Explore the model

Interactive lab

Interactive lab · queue

Budget reconstruction capacity without substituting it for trust

For each separate run: Reset, set both λ and μ, predict, then Play or Step. Compare λ=4,μ=2 with λ=2,μ=4. A fresh four-job fluid backlog grows at 2 jobs/s in the first run and reaches zero at 2 seconds in the second. This is not a compromise detector or real build-duration simulator.

Budget reconstruction capacity without substituting it for trustFluid backlog starts at 4 and follows max(0, 4 + (λ − μ)t). The separate M/M/1 residence-time formula assumes Poisson arrivals, exponential service and λ < μ. Current readings: Fluid backlog: 4; Net rate · λ − μ: −1 /s; M/M/1 mean residence: 1 s. All parameters are adjustable with the labeled controls below.02.557.51001.534.56Elapsed time · sFluid backlogλ < μ
Fluid backlogCurrent time
Fluid backlog
4
Net rate · λ − μ
−1 /s
M/M/1 mean residence
1 s
t = 0 s

Fluid backlog starts at 4 and follows max(0, 4 + (λ − μ)t). The separate M/M/1 residence-time formula assumes Poisson arrivals, exponential service and λ < μ. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forCompletion capacity supports recovery operations. Each completed replacement still needs the defined independent trust and deployment checks.

Check your understanding

Why is signing a suspect binary with a new key insufficient recovery?

Try it yourself

An investigation has eight direct candidate artifacts and seven downstream candidates, with three shared identities. Nine distinct candidates have completed the stated recovery criteria. How many are in the current scope and how many remain unresolved?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Take the union before subtracting completed distinct identities.

Compare with the solution

The union is 8+7−3=12 candidates. Nine completed leaves three unresolved. The 75% completion fraction describes work against the current scope only; incomplete scope evidence or uncleared artifacts must remain explicit in the incident status.

Take it with you

  • Contain credentials, artifact acceptance, and existing deployments through distinct controls.
  • Rebuild from independently justified inputs and a restored execution boundary.
  • Scope uncertainty and unresolved candidates remain visible throughout recovery.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.