PIVTR-D
RGoogle Cloud playbook · Pipelines and supply chain

Container image tampering in Artifact Registry

The attacker has an identity that can write to an Artifact Registry repository, often a CI service account or a leaked key. They push a modified image under an existing tag or add a new one, and the next deployment or pod restart pulls a miner, a backdoor or code that reads the workload's credentials. Remove the writer's push access and stop the workloads that run the suspect digest first.

Look here

LogSearch for
Admin Activity audit log, Artifact RegistryTag and repository changes on artifactregistry.googleapis.com. Compare the time of tag changes and manifest pushes with your release times: google.devtools.artifactregistry.v1.ArtifactRegistry.CreateTag, DeleteTag, UpdateRepository, CreateRepository, DeleteRepository, SetIamPolicy, Docker-CreateOnPush
Admin Activity audit log, Artifact RegistryEvery Artifact Registry entry in the window: gcloud logging read 'protoPayload.serviceName="artifactregistry.googleapis.com"' --project=<project> --freshness=30d
Data Access audit log, image pushWhich principal pushed and from which address. Data Access logs are off by default and must be enabled for Artifact Registry before the incident: Docker-StartUpload, Docker-FinishUpload and Docker-PutManifest (DATA_WRITE)
Data Access audit log, image pullWhich principals pulled the suspect digest and when, once you know it: Docker-GetManifest, Docker-ServeBlob, Docker-HeadManifest and Docker-HeadBlob (DATA_READ)
Repository contentsImages with digests and tags. Compare digests with the build record for the release: gcloud artifacts docker images list <location>-docker.pkg.dev/<project>/<repo> --include-tags
Repository contentsTags on one image: gcloud artifacts docker tags list <location>-docker.pkg.dev/<project>/<repo>/<image>
Repository IAMroles/artifactregistry.writer or roles/artifactregistry.repoAdmin granted to unexpected principals, or to allUsers or allAuthenticatedUsers: gcloud artifacts repositories get-iam-policy <repo> --location=<location>
Artifact AnalysisUnexpected packages or new findings on a new image, which point to tampering. Automatic vulnerability scans run on push when scanning is on for the repository. The setting is --allow-vulnerability-scanning on gcloud artifacts repositories update
Running workloads, GKEThe image digest each pod runs: kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{.status.containerStatuses[*].imageID}{"\n"}{end}'
Running workloads, Cloud RunThe image and digest of each service: gcloud run services describe <service> --region=<region> --format=json

Contain

#Item
1Record the repository contents, tag list and IAM policy as evidence. Save the manifest of the suspect image before any delete
2Remove push access from the identity that wrote the image. If it is a service account, disable it and its keys, following leaked service account keys: gcloud artifacts repositories remove-iam-policy-binding <repo> --location=<location> --member='<type>:<member>' --role=roles/artifactregistry.writer
3List every workload that runs the suspect digest, using the commands above, and record the namespaces, services and revisions
4Scale GKE deployments that run it to zero, after saving pod details: kubectl scale deployment <name> --replicas=0
5Deploy a known-good digest to each affected Cloud Run service: gcloud run deploy <service> --image=<image>@sha256:<digest> --region=<region>
6Point every deployment at a digest from the last verified build, in the form image@sha256:<digest>
7Treat every workload that ran the image as compromised, and follow stolen workload credentials for the service accounts they used
8Remove the tampered image and any attacker tags once evidence is saved destructive: gcloud artifacts docker images delete <location>-docker.pkg.dev/<project>/<repo>/<image>@sha256:<digest> --delete-tags

Eradicate and recover

#Item
1Rebuild the affected images from source at a known-good commit in a clean build environment, and push them under new tags. Check the build pipeline for tampering with CI/CD abuse
2Turn on immutable tags for Docker repositories that contain release images. Tags then cannot move to a different digest or be deleted, and tagged images cannot be deleted: gcloud artifacts repositories update <repo> --location=<location> --immutable-tags
3Enable Binary Authorization on the GKE clusters and Cloud Run services that pull from the repository, with a policy that requires an attestation from your build system. Start with dry-run mode to see what a policy would block
4Restrict repository write roles to the build service account, and grant read roles to workloads on the specific repository
5Enable vulnerability scanning and Data Access audit logs for Artifact Registry so the next push and pull are recorded
6Rotate secrets that the tampered image could read at runtime, using the scope in Scope
Watch out
  • Data Access audit logs for Artifact Registry are off by default. Without them, pushes and pulls are unrecorded, and you identify the pusher only from other records such as CI logs. Tag changes are Admin Activity and always logged.
  • A running pod keeps the image it already pulled. Deleting the image from the registry does not stop it, and a restart on a node without the cached layers fails until a known-good digest is set.
  • Binary Authorization checks images at deploy time. Its continuous validation only writes log entries for running pods that violate the policy, and does not stop them. Breakglass overrides enforcement, so review breakglass use in the audit logs.
  • Tags name images. A tag such as latest can point to a different digest tomorrow, so every check must compare digests.

Google Cloud documentation: Artifact Registry audit logging; gcloud reference for artifacts repositories update and artifacts docker images list; Artifact Registry vulnerability scanning; Binary Authorization overview. Checked September 2026.

Adapts material from Dynamic Incident Response: A Framework for Security Teams by Joshua Wright, © 2026 The Escal Institute of Advanced Technologies, Inc. d/b/a SANS Institute, licensed under CC BY 4.0. Figures reproduced under that license. Changes were made. Not published by, endorsed by, or affiliated with the SANS Institute.