Start by pivoting from the runtime alert to the container image, then trace back to the originating identity, build event, and repository history. That sequence helps separate normal workload activity from a compromised supply chain path. Containment should focus on preventing new deployments from the tainted image while preserving evidence for root cause analysis and broader exposure assessment.
Why runtime evidence should pull you back through the image, build, and identity chain
When a container looks compromised at runtime, the runtime process tree is only the last visible layer. The more useful question is whether the activity came from a poisoned image, a malicious or abused build path, or an identity that was already authorized to publish the artifact. That distinction changes containment: killing a pod helps only if the image lineage is clean, while a tainted image can repopulate the cluster as soon as orchestration replaces it.
This is why investigators should move from runtime telemetry to image digest, then to the build provenance and the publishing identity. If the image was built from a trusted repository but deployed with unexpected behaviour, the compromise may sit in the runtime environment, injected dependencies, or configuration drift. If the image itself is suspect, the blast radius expands to every environment that pulled the same tag. NHIMG’s Ultimate Guide to NHIs notes that 71% of NHIs are not rotated within recommended time frames, which helps explain why publishing or build identities can become durable compromise paths.
In practice, teams often discover the real weakness only after the cluster has already auto-redeployed the same bad artifact.
How to trace the compromise in practice without losing evidence
Start by pinning the exact runtime instance to an immutable image digest, not just a mutable tag. From there, map the digest to the registry record, build job, commit, and signing or attestation evidence if it exists. The goal is to answer three separate questions: whether the image was altered before deployment, whether the build system was abused, and whether the publishing identity had excessive reach across repositories or environments.
That sequence matters because a compromised container can be caused by different mechanisms that look similar in runtime logs. A malicious dependency in the image usually leaves repository and build artefacts that differ from a clean release. A stolen build credential may produce a valid-looking image with abnormal provenance, especially if the pipeline lacks strong separation between developers, builders, and release identities. If the image was signed, verify the signer identity and the signing workflow, but do not treat a signature alone as proof that the artifact is safe; it only proves continuity with the signing process.
- Preserve the running container state, image digest, and registry metadata before redeploying or garbage-collecting artifacts.
- Compare the deployed digest to the expected release record and reject any tag-only match.
- Trace the build from source commit to pipeline run to registry push, looking for unexpected approvals, secret use, or out-of-hours publication.
- Check whether the originating identity can publish beyond the intended repository, namespace, or environment boundary.
NIST guidance on access control and auditability is useful here because the investigation depends on proving which identity performed which action, not just whether the container executed suspicious code. These controls tend to break down when teams rely on tags, shared build credentials, or unsigned promotion paths because the artifact lineage becomes ambiguous.
Where investigations go wrong when the same image can move faster than the evidence
Tighter containment often increases operational friction, requiring teams to balance rapid redeployment against the need to preserve artifact lineage and credential evidence. The main tradeoff is that fast remediation can erase the very signals needed to determine whether the compromise originated in runtime, the image supply chain, or the publishing identity.
One common edge case is a benign image used across many clusters with environment-specific behaviour injected at deploy time. In that case, the originating image may be clean even though the workload behaved maliciously because a secret, config map, or admission-time mutation altered execution. Another is a legitimate rebuild after base-image updates, where the digest changes but the release process does not fully record why. Current guidance suggests treating these as investigation problems first and cleanup problems second, because otherwise the same weak build path can be reintroduced under a new tag. For broader NHI context on how credential exposure and weak rotation drive repeated compromise, see NHIMG’s 52 NHI Breaches Analysis.
In practice, the hardest cases are not the obvious malicious containers but the ones where a valid identity, a valid build, and a valid image still combine into an untrusted runtime outcome.
Risk and Threat Considerations
The material risk is not only that a container is compromised, but that the same artifact or publishing identity can continue to recreate the compromise across namespaces, clusters, and environments. That turns a single detection into a repeatable supply-chain exposure, especially when tags are mutable, build credentials are long-lived, or provenance is weak.
Failure mechanism: Attackers or insiders exploit trusted build and release paths, then use the legitimate image pipeline to distribute a harmful artifact or to hide malicious changes behind normal deployment activity. If investigators focus only on the runtime instance, they may miss the identity, registry, or build-system weakness that allowed the compromise to recur.
Impact: The same image can be redeployed after cleanup, credentials may need emergency rotation, and trust in the release process can be lost across multiple workloads rather than one isolated pod.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK address the attack and risk surface, while CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| CIS Controls v8 | 8 — Audit Log Management | Investigating image and identity lineage depends on preserved deployment and audit evidence. |
| 6 — Access Control Management | The publishing or build identity may be the compromise path behind the container artifact. | |
| Recommendation — Preserve and centralise image, build, and publish logs before remediation alters evidence. Review and revoke excessive build and release access tied to the compromised image path. | ||
| NIST CSF 2.0 | DE.CM — Security Continuous Monitoring | Runtime compromise detection should connect telemetry to image and provenance monitoring. |
| PR.AA — Identity Management, Authentication, and Access Control | The originating identity and its authority are central to tracing how the artifact was published. | |
| RS.AN — Analysis | The question is about investigative pivoting from runtime activity to root cause analysis. | |
| Recommendation — Correlate runtime alerts with image provenance and deployment telemetry for faster triage. Validate which identity published the image and restrict its release authority. Trace the compromise from runtime symptoms back to build and repository provenance. | ||
| MITRE ATT&CK | T1195 — Supply Chain Compromise | A tainted image or abused build path is a classic supply-chain compromise pattern. |
| T1552 — Unsecured Credentials | Compromised build or release identities often expose or reuse credentials in the pipeline. | |
| Recommendation — Investigate whether the artifact was altered upstream or distributed through a compromised pipeline. Hunt for exposed build, registry, or release credentials tied to the compromised image. | ||
Practitioner Guidance
What to prioritise: Treat digest verification and provenance reconstruction as the first investigative branch, before deep runtime forensics. If the digest is not immutable and traceable, containment decisions are incomplete.
What to verify: Confirm which identity published the artifact, which pipeline job executed the publish step, and whether the expected source commit, approval path, and signing record all line up. A valid-looking deployment record is not enough if the publishing identity had broader rights than intended.
Decision rule: If the same artifact can be redeployed automatically, rotate or disable the originating release identity and block the image path before restoring service. If the issue is confined to runtime mutation, preserve the image and investigate workload-level injection separately.
Practitioner takeaway: The decisive question is not whether the container was hostile at runtime, but whether the trust chain behind the image can reproduce that hostility on demand.
Related resources from NHI Mgmt Group
- How should security teams use runtime capture data to investigate suspicious container activity without overwhelming operations?
- How can security teams tell a compromised cloud identity from normal admin activity?
- How should security teams detect identity-based attacks that use compromised OAuth apps and blend into normal user activity?
- What is the difference between static image security and runtime container security?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on September 9, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org