Skip to content

Lesson 8 of 9 · 24m

Tagging, Immutability, and Promotion Discipline

Use version tags, immutable digests, environment promotion, retention, and rollback rules that prevent mutable-release attacks and accidental drift.

Teams often focus on publishing artifacts and forget the second half of the lifecycle: moving the same artifact safely through dev, staging, production, retention, and rollback. If every environment rebuilds or repulls a mutable tag, you do not have promotion. You have four chances to ship four different things.

Build once, promote by digest

The disciplined path is simple:

build artifact once in release CI
scan, sign, attach SBOM and provenance
push digest to dev
promote the same digest to staging
promote the same digest to production
retain digest according to rollback policy

In practice:

IMAGE='ghcr.io/acme/payments-api@sha256:3b8f4e4d...'
cosign verify "$IMAGE" --certificate-oidc-issuer https://token.actions.githubusercontent.com   --certificate-identity-regexp '^https://github.com/acme/payments-api/'
crane copy "$IMAGE" registry.prod.example.com/acme/payments-api:v2.4.1

Copying the digest is safer than rebuilding from the same commit because build environments are not perfectly reproducible.

Tags are pointers, not releases

Mutable tags such as latest, stable, and even v2 are operational conveniences. Never use them as evidence. Immutable tags help humans, but unless registry policy prevents overwrite, they are still policy rather than mathematics.

human label:    v2.4.1
artifact truth: sha256:3b8f4e4d...

Release notes and deployment manifests should carry both. When they disagree, trust the digest and investigate the tag.

Retention is a security decision

Deleting old artifacts too aggressively destroys rollback options and forensic evidence. Keeping everything forever expands storage cost and vulnerability exposure. Write retention rules by class:

production releases: retain 18 months
release candidates: retain 90 days
pull request images: retain 14 days
artifacts under investigation: legal/security hold

Do not let registry garbage collection delete a digest still referenced by production or a customer support bundle.

Rollback must use the same controls

A rollback is a release. Verify the old artifact before redeploying it. Attackers love incident pressure because teams bypass process to restore service. If the rollback artifact predates your signing program, use an explicit exception and document the risk instead of silently disabling verification.

Protect deletion and overwrite permissions

Registry roles often distinguish push, delete, overwrite, and repository administration. Separate them. CI usually needs push to a staging repository, not delete in production. Require approvals or separate identities for overwrite operations, and alert when a versioned tag changes digest.

Field notes

  • A missing artifact during rollback is an availability incident caused by lifecycle policy, not bad luck.
  • Never republish the same semantic version with different bytes; create a new patch version and document the correction.
  • Replication between registries must preserve digests and signatures; verify after copy.
  • Retention automation should understand manifest lists and referrers, or it may delete attestations while keeping images.
  • Promotion pipelines need audit logs that connect artifact digest, actor, approval, source commit, and target environment.

Was this lesson helpful?

Sign in to rate