Registries: access control, retention, immutability and pull-through caches
Architect enterprise artifact registries: configure role-based access control, design intelligent lifecycle retention policies, enforce immutability, and implement pull-through proxy caches.
Contentsand lesson path
On this page
- Enterprise Registry Topologies and Least-Privilege Access
- Lifecycle Retention Policies: Balancing Storage Costs and Rollback Safety
- Pull-Through Caches: Resilience, Rate Limiting, and Security
- Check your understanding
- Apply it
- Review prompt
Lessons of Artifact Management
- Artifacts, versions and the build-once rule Concept · 15 min
- Mutable names, immutable identities: tags, checksums and digests Worked example · 15 min
- Lab: publish a versioned package from CI Lab · 25 min
- Registries: access control, retention, immutability and pull-through caches Concept · 20 min
- Promoting a release to production without rebuilding it Worked example · 20 min
- Check: trace a deployed artifact back to its commit Knowledge check · 6 questions
What you will learn
- Publish build outputs from CI to a package or container registry with scoped credentials, retention rules and immutable versions.
01. Enterprise Registry Topologies and Least-Privilege Access
In modern enterprise software delivery, the artifact registry serves as the critical bridge connecting continuous integration pipelines with production deployment targets. Registries (such as Harbor, JFrog Artifactory, Sonatype Nexus, GitHub Packages, and cloud-native solutions like AWS ECR and GCP Artifact Registry) store software deliverables ranging from OCI container images and Helm charts to language-specific packages (npm, PyPI, Maven, Cargo).
Because the registry holds production binaries, its Role-Based Access Control (RBAC) decides who can change what runs in production. Give each kind of client only the rights it needs:
-
Continuous Integration Runners (Push to Their Own Repositories): Build agents need credentials that can push new versions to their own repository namespaces, plus the read access a push needs there (the lab in lesson 03 gives
ci-publisherread and create). They should have no access to unrelated packages and no right to change repository settings or delete versions. -
Production Runtime Clusters (Read-Only / Pull-Only): Production Kubernetes worker nodes and server fleets need read-only pull credentials. Write permissions on compute clusters are dangerous: an attacker who breaks into a container could overwrite registry images and spread to every service that pulls them.
-
Human Developers (Audited Read Access): Engineers should pull verified artifacts via single sign-on (SSO) backed credentials. Block direct uploads from developer workstations, so that every published package comes from an audited CI pipeline.
-
Multi-Region Geo-Replication: Large enterprises running global infrastructure configure registries with active-active geo-replication. When a pipeline pushes an image in
us-east-1, the registry asynchronously replicates layers across regional object stores (eu-west-1,ap-southeast-1). This gives low-latency image pulls during worldwide deployments and a copy to fall back on if a region has an outage. Replication is asynchronous, so an image pushed seconds before the outage may not have reached the other regions yet.
02. Lifecycle Retention Policies: Balancing Storage Costs and Rollback Safety
A team that builds dozens of images a day can fill a registry with large amounts of storage within months, and storage costs money. Cleanup is necessary, but a careless cleanup rule can take production down.
Consider what happens if an organization configures a simplistic time-based rule: "Delete every artifact older than 30 days." If a stable, mission-critical service has not been modified for two months, its production image is silently deleted from the registry. At the next autoscaling event or node replacement, Kubernetes tries to pull the image, gets an HTTP 404 error, the new pods stay in ImagePullBackOff, and the service loses capacity or goes down.
To control storage cost without deleting anything that is still needed, combine several retention rules:
-
Prune Ephemeral Branch Builds Aggressively: Images built for pull requests and short-lived feature branches should be retained for only 7 to 14 days or purged immediately upon PR merge.
-
Protect Semantic Release Tags Indefinitely: Artifacts matching formal release tag regex patterns (
v*.*.*,release-*) should be retained indefinitely or archived to low-cost cold storage (such as AWS S3 Glacier). -
Active Deployment Protection: Registries do not know what is running in your clusters, and common cleanup features (ECR lifecycle policies, Artifact Registry cleanup policies, scheduled GHCR clean-up jobs) do not query them. Protect live images yourself: have the deploy pipeline add a protected tag (for example
prod-2026-10-28) or record the deployed digest, and write the cleanup rules so they never match those tags or digests, regardless of age. -
Preserve N Recent Releases for Rollback: Keep at least the last several production releases (for example 5 to 10), so that a rollback target is still in the registry during an incident.
03. Pull-Through Caches: Resilience, Rate Limiting, and Security
Enterprise deployments frequently rely on public base images (python:3.12-slim, alpine:3.24, ubuntu:24.04) and upstream open-source libraries. Downloading them straight from public registries (such as Docker Hub or npmjs.org) on every build or node start-up causes three problems:
-
Public Registry Rate Limits: Commercial registries enforce strict anonymous download rate limits (such as Docker Hub's 100 pulls per 6 hours). When a cluster behind one NAT address scales out 50 worker nodes at once, those pulls can exhaust the limit, and new nodes cannot start pods during the traffic spike that caused the scale-out.
-
Upstream Outages and Network Latency: If a public registry experiences an outage or transient network partition, internal deployments and CI pipelines that depend on it stop.
-
Supply Chain Poisoning: Direct public downloads bypass your own checks, so developers can pull upstream packages with known vulnerabilities or a malicious release.
To resolve these challenges, enterprise registries operate Pull-Through Caches (Remote Proxy Repositories). When an internal runner or cluster requests docker.io/library/alpine:3.24, the internal proxy checks its local cache. On a hit, it serves the image from the local network. On a miss, the proxy downloads the image from upstream, stores the layers and serves the request; products such as Harbor and Artifactory can also scan what they cache. If public internet access is lost, deployments of images that are already in the cache keep working; images that were never pulled through the cache cannot be fetched until the upstream is reachable again.
Additionally, modern registries integrate with cryptographic signing frameworks such as Cosign and Sigstore. As images are mirrored or produced, pipelines attach detached cryptographic signatures and Software Bill of Materials (SBOM) manifests. Production clusters with admission controllers (like Kyverno or the Sigstore Policy Controller) verify these signatures before admitting pods, so an image that your pipeline did not sign is rejected.
04. Check your understanding
05. Apply it
Implement these enterprise registry configurations across your infrastructure:
- Isolate Push and Pull Credentials: Give CI jobs push access to their own repositories only, and worker nodes read-only access, so a leaked credential can do little.
- Protect Released Artifacts from Deletion: Configure retention rules that explicitly exempt semver tags (
v*.*.*) from age-based cleanup. - Protect What Is Deployed: Have the deploy pipeline tag or record each deployed digest, and write cleanup rules that never match those tags.
- Deploy Pull-Through Caches for Public Mirrors: Proxy Docker Hub and public package registries to avoid rate limits and survive outages.
- Automate Vulnerability Scanning on Ingest: Enable automated CVE scanning on image upload so that compromised dependencies are flagged immediately.
- Configure Cross-Region Replication: Replicate images across geographic zones for fast local pulls and a fallback copy if a region fails; check how far replication lags behind pushes.
06. Review prompt
Detail the principle of least privilege as applied to continuous integration runners and production orchestrators interacting with artifact registries. Explain how a simple time-based retention rule can break production deployments, and describe what a pull-through cache does and does not protect against.
References
Your progress
Reading state
Sign in to save that you finished reading this lesson.
Prove this skill
6 questions · about 5 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.