engineering
Track container base images across a monorepo
Map each monorepo build to the parent image it actually resolved. Use the inventory to see which services need a rebuild after a shared base changes.
TrustIvan · · 10 min read
The monorepo search finds six Dockerfiles that mention the shared application base. A security update to that base triggers a rebuild plan for six services. The plan misses a seventh service whose build template supplies the same parent through an argument. It also includes an old Dockerfile that is present in source control but no longer produces a deployable image. The repository search is useful for finding declarations. The release decision depends on which inputs each build actually used and where its outputs run.
A base image inventory should let a responder move from an affected parent digest to a set of published artifacts and observed workloads. Capture both the declared input and the resolved build evidence. Give records for different platforms, build targets and release channels their own identities. That lets you ask which workloads require investigation or rebuilding without treating every occurrence of a tag or the same commit SHA as the same package.
Identify the jobs that actually emit images
Choose a release commit and an observation window. Start with the CI records of jobs that published images within scope. Include product services, workers, third-party adapters and scheduled tasks with independent release pipelines. For each publishing job, record its workflow source, build definition, build target, builder platform selection and registry destination. Reconcile this list against deployed workload inventory to catch an image published by a maintenance branch or alternate pipeline.
Source inventory finds candidate targets. A shared template can contribute different settings for two jobs in the same commit. A build argument can select an image tag or digest at execution time. A named context can represent a container image or another build target. Read the execution record where the resolver actually chose the parent. A line in the Dockerfile captures what the file asked for before overrides and resolution. Docker Build documentation on named contexts
Separate build outputs from builds that only test. A workflow can construct an intermediate image for unit tests and publish another image for deployment. Capture intermediates if their security posture or contribution to a final artifact is in the review scope. Keep them distinct from a final output that can be deployed. If a platform publishes a registry index and platform manifests, retain the descriptor relationship rather than choosing one digest representation for every purpose. OCI image index specification
Keep the inventory at the right level
Use one build record for an output artifact and platform, then associate all relevant image inputs with it. A multi-stage build can have a compiler stage, an image providing files and a different runtime parent. Keep these input roles visible and tie each resolved digest to evidence from the trusted build. If a worker copied a binary from a build image, the parent’s role remains worth recording even if none of its operating-system package records appear in the final inventory.
Separate the build record from observations of deployment. The same artifact can run in several clusters, or nowhere, with observation times that differ. Two environments can both reference a tag while resolving different artifacts over time. Join the deployed workload with the registry and build record using supported identifiers. Before joining on digest values, verify what each tool is reporting. A registry index digest, platform image manifest digest and image configuration digest all identify different objects. Document the mapping from any locally reported image ID to the appropriate manifest before drawing a coverage conclusion.
The record should give a reviewer these fields for one artifact.
- The repository, source revision, job and build target that emitted it.
- The platform, registry location and immutable output digest, with an index reference if applicable.
- The declared input text, actual resolved reference, input role and build evidence.
- Workload, environment, deployed artifact evidence, owner and observation time.
- The evidence quality or reason verification is blocked if the input or deployment record is incomplete.
Avoid retaining unrelated build parameters. Provenance can expose configuration detail in addition to resolved materials. Review access and data minimization for the records your pipeline produces. Use scoped evidence links and short references where reviewers need to see a full build record. Docker provenance attestation documentation
Reconcile one synthetic monorepo release
Assume a fictional logistics team produces four images from commit R71. Its central base track publishes an index. AMD64 parent B11 and ARM64 parent B12 are distinct child manifests of that base release. Inventory evidence shows an affected library in B11. Security reviewers want to understand which current consumers inherit B11, and whether any shipped files came from an affected build-stage input.
| Target and platform | Resolved inputs | Output | Runtime observation |
|---|---|---|---|
| Dispatch API on AMD64 | B11 runtime and T09 compiler | A31 | Production phase of the deployment is active |
| Dispatch API on ARM64 | B12 runtime and T12 compiler | A32 | Production ARM64 pool reports this manifest |
| Billing replay on AMD64 | B11 runtime through a shared job argument | J08 | Scheduled production launcher still references this artifact |
| Reports on AMD64 | D05 runtime and B11 build-stage source | W20 | Production dashboard runs this artifact and copied-file provenance is pending |
Start with the parent digest from the original finding. The proven direct runtime consumers are Dispatch A31 and Billing J08. Dispatch's ARM64 manifest A32 uses the other platform parent. Verify B12 against its separate supported package or scan evidence before making a release-wide statement. The Reports image used B11 as a build-stage input. Identify the files copied into W20 and review the evidence from that platform build. If the flagged library was copied into the runtime, it needs separate remediation evidence. The mere presence of B11 in a toolchain does not establish a runtime finding.
The fixture also has a production recovery deployment still observed as Dispatch A27. A27 predates R71 and cannot be resolved by looking only at current release jobs. Retrieve its build record before declaring all Dispatch workloads covered. If that record has been pruned, preserve the deployment evidence and mark the parent unknown. Then agree whether the appropriate next step is retrieval of alternative approved evidence or a controlled replacement with known provenance.
Use new parent publication as the start of a change
When the base owner publishes corrected AMD64 parent B18, join the previous resolved digest to both image outputs and current deployments. Route confirmed deployed consumers to their build and release owners. Ask the Billing team to update the shared job input and verify the schedule or a representative authorized run. Ask Dispatch to evaluate both the active and recovery deployments. Give the Reports owner the open copied-file question so they can determine whether and how to rebuild.
Test the rebuild through the same job and platform path that produced the affected output. A local build can show that source changes compile, while the release pipeline might still apply an old override. Capture the new source declaration, the resolved B18 input and the output manifest the pipeline published. Confirm the package evidence in the final image through a comparable scan. Check the workload's observed artifact after rollout. The image digest verification guide walks through closure for the deployment itself.
Keep branches and release trains in view. The default branch may contain the new digest while a hotfix release still builds from an older maintained branch. When a branch continues shipping, give it its own observed input and output records. A retired branch declaration may remain visible as source evidence without becoming an operational change. Use release activity and deployment information to decide which work belongs in an actionable queue.
Set up handling for incomplete or inconsistent data
Missing provenance is a state you can track. A tag that currently points to B18 cannot prove what it resolved to when an earlier artifact was built. Treat the image declaration, registry state now and recorded build resolution as separate observations. If the direct build record is unavailable, look for a supported signed attestation, registry event or archived build report that can be tied to the artifact. Record which source you used and whose approval authorized retrospective confirmation.
When a build record and runtime inventory disagree, compare the observation windows and namespaces first. A pull-policy change, rolling update or newly rescheduled workload can legitimately produce different results over time. Check the artifact object type and platform next. Preserve both observations until the release owner can reconcile the identity and cutover. An inventory importer that overwrites the older result can make the issue harder to investigate.
Assess freshness at each step independently. CI may provide a timely build record while a standby workload appears only during scheduled tests. A job definition can reference J08 even when its latest observed execution used an older publication. Track configured and observed deployment individually where the sources permit it. Keep the effective time for both. That lets an owner tell whether a missing execution result is expected schedule latency or a real coverage gap.
Decide which gaps should delay a release
Agree with the release and security owners on the proof required for new builds. A production job may be expected to publish a build record linked to each supported platform manifest. A historical recovery image could instead get a named follow-up until its next controlled replacement. During rollout of those requirements, record inventory gaps in report-only mode and check whether each flagged build belongs to the production population. Use a representative release with one missing record to verify where an operator would act.
Make the resulting status specific. Suppose Dispatch A41 has the expected base and a passing scan, while the inventory lacks a current runtime observation for the recovery deployment. The artifact can meet the build check while the remediation across Dispatch stays open. Conversely, a runtime observation can confirm A41 was deployed without establishing its parent if the build record is missing. Record both checks and who can clear them. That gives a release owner useful evidence even when one system's summary reports an aggregate pass.
Verify the inventory through a short acceptance test
Ask a second operator to start from B11 with only the recorded sources. They should find the two confirmed runtime consumers, explain why ARM64 is a separate verification question and identify the Reports copied-file investigation. Then remove A27's build evidence from the authorized fixture and check that the operator can identify the unknown parent without losing the deployment record. The exercise evaluates whether somebody can repeat the decision without relying on the person who knew the pipelines.
Repeat after shipping the corrected parent. Give the test inventory new Dispatch output A41 from B18 and leave Billing J08 deployed. Record one permitted production-like rollout and keep a stale configured-launcher entry in the synthetic job record. The inventory should show that the newly rebuilt Dispatch artifact can be verified independently and that Billing still needs a change. Ask someone to count verified workloads from the deployed population and confirm what remains excluded or unresolved.
Review durability too. If a registry retention policy or CI cleanup removes an old attachment, keep an approved evidence record with immutable output and input references where permitted. For a pilot across platforms, compare how each product represents missing provenance, distinct outputs at one revision and parallel platform variants. Verify that decisions remain traceable when a base release adds another consumer. Save one follow-up owner for each gap and note which evidence is still needed before concluding that the scope has been covered. Kubernetes documentation on image references and selection