Join our Newsletter — 33% off our NHI Course
Home› Guides› If your artefact and container registry is compromised:…
Guide Incident Response & Forensics

If your artefact and container registry is compromised: containment, credential rotation and rebuild playbook

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 11 November 2026 12 min read
On this page

A compromised artefact or container registry lets an attacker swap what your clusters, servers and customers install, while every deployment still points at a name you trust. Registries hold the images and packages that production pulls, the push credentials your pipelines use, the pull secrets spread across clusters and the caches that proxy public sources. The urgent questions are which artefacts can still be trusted, which credentials must be rotated, and how to rebuild without redeploying the attacker's content. This playbook is for platform, DevOps and incident response teams running a self-hosted or cloud registry for container images, language packages or build outputs. It is vendor-neutral and assumes OCI-style registries where content is addressed by digest. Preventive design is in the Container Registry Security Guide and Securing the artefact and container registry itself.

Key takeaways

  • Freeze writes before you investigate. Stop pushes, tag moves and deletions so evidence stays intact and the attacker cannot keep replacing content.
  • Trust digests and signatures, not tags. A tag is a movable pointer; a digest is a hash of content. Compare what each tag points at now with your build records and signatures.
  • Verification by the consumer is what saves you. SLSA's distribution channel threat assumes the registry itself can be modified, and the mitigation is verifying provenance or signatures at deploy time.
  • The registry is full of machine credentials. Robot accounts, pipeline push tokens, cluster pull secrets, replication and webhook credentials and storage keys all need rotation.
  • Rebuild from source, not from the registry. Re-push artefacts from a verified build, not by copying what is currently stored.

Scope: what a registry compromise covers

Entry pointTypical causeWhat the attacker can doATT&CK
Registry administrator accountPhished admin, reused password, no MFAChange permissions, create robot accounts, disable scanning or signing policy, delete evidenceT1078.004 Cloud Accounts, T1685 Disable or Modify Tools
Push token or robot accountToken leaked from CI, a workstation or a public imagePush or overwrite images and packages under trusted namesT1525 Implant Internal Image, T1195.002 Compromise Software Supply Chain
Pull secret or read tokenCopied from a cluster or developer machineDownload private images and the secrets baked into themT1552.007 Container API (where reached through it)
Registry host or storage backendUnpatched server, exposed storage bucket keyModify stored blobs and metadata directly, outside the registry's audit logT1525
Pull-through cache or remote proxyUpstream poisoned or cache configuration changedServe a malicious upstream artefact to internal consumersT1195.002
Replication, webhook or scanner integrationOver-privileged integration credentialsSpread content to other regions or registries, trigger deploymentsT1098.001 Additional Cloud Credentials

If the incident started in the build system, run the CI/CD Pipeline Compromise Playbook alongside this one. A pipeline that pushed poisoned artefacts with valid credentials looks like legitimate publication to the registry.

How the compromise shows up

  • Tag moved without a build: a release tag now points at a digest no pipeline run produced.
  • Pushes from unexpected identities or networks: robot accounts used from outside CI runner addresses, or human accounts pushing to release repositories.
  • New robot accounts, access tokens or permission changes in the registry audit log.
  • Signature or admission failures: admission controllers rejecting images that fail signature or provenance checks, or a sudden switch of policy from enforce to audit.
  • Scanning or retention policy changes: vulnerability scanning switched off, immutability removed, or deletion enabled on release repositories.
  • External signals: a vendor advisory, a public report of a poisoned image, or downstream customers reporting unexpected behaviour. The Checkmarx KICS supply chain attack reached users through poisoned images published under a trusted name.

Triage: the first hour

  1. Freeze writes: set affected repositories read-only or revoke push permissions for all non-responder identities. Disable tag deletion and manifest deletion if the registry allows it; under the OCI Distribution Specification a registry with deletion disabled answers 400 or 405 to delete requests.
  2. Snapshot the state: export the audit log, the list of repositories, every tag with its current digest and timestamps, robot accounts, tokens, permissions and integration settings. Hash the exports.
  3. Preserve storage: snapshot the storage backend and database, so blobs changed outside the API can be found later.
  4. Pause automated promotion: stop pipelines and GitOps controllers that deploy on tag change, so a moved tag cannot reach production during triage.
  5. Decide fail-closed for deploys: if you run admission control that verifies signatures, keep it in enforce mode; if you do not, freeze deployments of affected repositories until integrity is proved.

Proving which artefacts you can still trust

Integrity checking relies on the fact that a digest is a hash of the content. The OCI Distribution Specification requires clients to verify each layer's digest against the manifest, so if you know the right manifest digest, you know the right content.

Evidence you holdHow to use itConfidence
Signatures from a key or identity the attacker did not controlVerify every release digest against the expected signer identity and issuerHigh, if signing keys or identities were outside the registry and pipeline
Build provenance attestationsCheck the provenance subject hash matches the artefact and the builder and source are as expectedHigh (SLSA mitigation for tampering after build)
Digests recorded in deployment manifests in GitCompare the digest each tag now points to with the digest deployed and committedMedium to high, depends on Git integrity
CI build logs with output digestsMatch pushed digests to build runsMedium; logs may be in the attacker's reach
Tags and timestamps onlyTreat as unverifiedLow
  • SLSA framing: SLSA calls this the distribution channel threat: an adversary modifies the package on the registry through an administrative interface or infrastructure compromise. It is mitigated by the consumer verifying provenance or a verification summary from a trusted issuer, not by trusting the registry. See the SLSA and Build Provenance Guide.
  • Signing keys: if signing keys were stored in the registry, in pipeline variables the attacker could read, or were used by a compromised robot account, signatures stop being evidence. Rotate the key and treat artefacts signed during the exposure window as unverified. See the Compromised Code Signing Certificate Playbook and the Sigstore Guide.
  • Running workloads: list the image digests actually running in clusters and hosts and compare them with the verified set. A malicious image already pulled keeps running after the registry is clean (T1610 Deploy Container).

Containment by priority

  1. Remove attacker access: disable unknown admin and robot accounts, revoke all access tokens created or used in the suspect window, and reduce administrators to named responders.
  2. Quarantine suspect artefacts: move or block unverified digests rather than deleting them, so you keep evidence and stop pulls.
  3. Repoint tags to verified digests: only after verification, and with two-person approval.
  4. Close side doors: disable replication rules, webhooks and pull-through cache upstreams that were added or changed, and purge caches that may hold poisoned upstream content.
  5. Stop affected workloads: scale down or redeploy workloads running unverified digests in production, starting with internet-facing and privileged ones.
  6. Protect the logs: confirm audit logs stream to a store registry administrators cannot alter.

Credential rotation inventory

CredentialWhere it livesRotation actionBetter pattern afterwards
Pipeline push tokens and robot accountsCI secrets, runner hostsRevoke all, issue new per pipeline with push scope to one repositoryOIDC federation from CI so no long-lived push secret exists
Cluster and host pull secretsKubernetes secrets, node configuration, host credential helpersRevoke and redeploy cluster by clusterWorkload identity or node identity with read-only scope
Developer access tokensWorkstations, credential helpers, shell historyRevoke all; reissue with expirySSO-backed short-lived tokens
Admin accounts and API keysRegistry, identity providerReset, re-enrol phishing-resistant MFA, revoke sessionsSSO only, break-glass account in a vault
Replication, webhook and scanner credentialsRegistry integrations, other registriesRevoke and reissue with minimum scopeOne credential per integration, owner and expiry
Storage backend keys and database credentialsRegistry configurationRotate; check storage access logsRegistry-only identity, no human access to storage
Signing keys (if exposed)KMS, HSM, CIRotate, re-sign verified artefacts, update verification policyKeyless or KMS-held keys outside the registry
Secrets baked into imagesImage layersRotate every secret found in images an attacker could pullNo secrets in images; inject at runtime

Read access matters too: an attacker who could pull private images may hold any secret baked into them. The Docker Hub breach of 2019 exposed GitHub and Bitbucket tokens linked to around 190,000 accounts, and the tokens needed revoking on the code hosts as well. See How to find hard-coded secrets in container images and the Workload Identity Federation Guide.

Eradication and rebuild

  1. Rebuild or patch the registry service: for a self-hosted registry, rebuild hosts from a trusted image on a supported version and restore configuration from a reviewed export, not from the live system. For a cloud registry, confirm with the provider whether their side was involved.
  2. Rebuild release artefacts from source: run clean builds from verified source commits on a trusted builder, sign them with new or verified keys, generate provenance and push to fresh repositories or freshly reviewed ones.
  3. Re-baseline policy: restore immutability on release tags, disable deletion on release repositories, re-enable scanning and set admission control to enforce signature and provenance checks.
  4. Clean downstream: redeploy every workload from verified digests, purge proxy caches and mirrors, and notify internal teams that pulled during the window to clear local caches.
  5. Hunt for follow-on activity: look at what malicious images did when they ran: outbound connections, credential access in clusters and new cloud identities.

Recovery, testing and rollback

  • Staged unfreeze: re-enable pushes for one pipeline at a time with its new federated identity, confirm signatures and provenance are produced and verified, then widen.
  • Admission tests: try to deploy an unsigned test image and an image with a mismatched provenance; both must be rejected. See the Kubernetes Admission Control Guide.
  • Rollback point: keep the list of verified digests per release as the known-good set, so a bad recovery step can be reverted by pinning to it.
  • Residual monitoring: alert on any use of revoked tokens and on pushes from identities outside the new federated set.

Small and large organisations

DecisionSmall team, one registryLarge estate, many registries and clusters
Scope of rebuildRebuild every release artefact from sourceRebuild by risk tier: internet-facing and privileged first, verified-signature artefacts last
Pull secret rotationRotate all at onceRotate per cluster with a tracking list; federate as you go
Customer impactNotify customers who pulled public images in the windowPublish an advisory listing affected digests and verified replacements

Evidence and notification

  • Preserve: audit logs, tag-to-digest exports before and after containment, quarantined artefacts, storage snapshots, registry host images, CI logs for the window and identity provider sign-ins for admin accounts.
  • Customers and users: if you publish images or packages externally, tell consumers which digests are affected and which verified digests replace them. Under NIST SP 800-61 Rev. 3, coordination with affected third parties is part of response (CSF 2.0 RS.MA-01). Legal duties vary; see the Cyber Incident Reporting Requirements Map.

Detection and measurement

  1. Share of production workloads running digests that verify against signature and provenance policy (target 100%).
  2. Release tags that are immutable (target 100%).
  3. Long-lived push tokens remaining after migration to federation (target zero).
  4. Time to answer "which digests did tag X point to, and when", measured in exercises.
  5. Pushes by identities outside the approved federated set (target zero; each one investigated).
  6. Revoked credentials seen in use after rotation (target zero).

Framework mapping

AreaNIST SP 800-53 Rev. 5NIST CSF 2.0ATT&CK addressed
Artefact integrity and signaturesSI-7, SI-7(15), CM-14RS.AN-03T1525, T1195.002
Provenance and component authenticitySR-4, SR-11RC.RP-02T1195.002
Registry credentials and robot accountsIA-5, AC-6RS.MI-02T1078.004, T1098.001
Audit log protectionAU-9RS.MI-01T1685
Incident handling and recoveryIR-4, CP-10RS.MA-01T1610

NIST SP 800-204D sets out how to build these supply chain controls into CI/CD pipelines, including artefact attestations.

Common failure patterns

  • Deleting suspect images first: evidence is lost and you cannot show customers what was served.
  • Verifying tags instead of digests: the attacker moves the tag back after you check it.
  • Signing keys in the same blast radius: keys held in pipeline variables or the registry make signatures worthless after compromise.
  • Rotating push tokens but not pull secrets: read access to private images keeps leaking embedded secrets.
  • Forgetting caches and mirrors: poisoned content keeps being served from a pull-through cache after the main repository is clean.
  • Leaked storage credentials: blobs changed directly in storage never appear in the registry audit log; the Codecov breach began with a leaked cloud storage credential used to alter a distributed script.

Practitioner checklist

  • Freeze pushes, tag changes and deletions on affected repositories and pause automated promotion.
  • Export audit logs, tag-to-digest maps, accounts and tokens, and snapshot storage, before changing anything.
  • Verify every release digest against signatures and provenance from identities outside the blast radius.
  • Quarantine unverified digests and redeploy workloads from verified ones.
  • Revoke and reissue push tokens, pull secrets, admin keys, integration and storage credentials.
  • Rotate signing keys if exposed and any secrets baked into images an attacker could pull.
  • Rebuild artefacts from source on a trusted builder and enforce admission checks.
  • Purge proxy caches and mirrors and inform consumers of affected and replacement digests.

Standards and references

Related NHI Mgmt Group resources: Container Registry Security Guide · CI/CD Pipeline Compromise Playbook · Kubernetes Cluster Compromise Playbook · Software Supply Chain Security Guide · If your secrets manager is compromised

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 11 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org