Security in Container registry
Who may push, pull and manage what (IAM), what is audited, and what a public repository exposes.
IAM actions
Every request, through the registry, the API, the CLI, Terraform or the console, is checked against
your IAM policies. A repository's resource name is
rn:ews::<organization id>:ecr:repository/<repository id>; registry-wide settings (signing,
pull-through cache, storage quota, aliases) are checked on rn:ews::<organization id>:ecr:*, and
the lifecycle default on rn:ews::<organization id>:ecr:lifecycle-default/image.
| Action | Access | What it allows |
|---|---|---|
ecr:DescribeRepositories | Read | List and describe repositories |
ecr:CreateRepository | Write | Create a container repository |
ecr:UpdateRepository | Write · destructive | Change repository settings, including public/private visibility |
ecr:DeleteRepository | Write · destructive | Delete a container repository |
ecr:ListImages | Read | List images and tags in a repository |
ecr:DescribeImages | Read | Describe image details |
ecr:DeleteImage | Write · destructive | Delete an image or tag |
ecr:PushImage | Write · destructive | Push images to a repository (docker push) |
ecr:PullImage | Read · sensitive | Pull images from a repository (docker pull) |
ecr:GetAuthorizationToken | Write | Mint a short-lived login token for docker login |
ecr:GetLifecyclePolicy | Read | Read a repository's lifecycle policy and preview what it would expire |
ecr:PutLifecyclePolicy | Write · destructive | Set the lifecycle policy that expires images in a repository |
ecr:DeleteLifecyclePolicy | Write · destructive | Remove a repository's lifecycle policy |
ecr:RestoreExpiredItem | Write | Bring back an image a lifecycle rule expired, while it is still restorable (with the tags nothing has taken since) |
ecr:ScanImage | Write | Trigger a vulnerability scan on an image |
ecr:GetScanResults | Read | View vulnerability scan results |
ecr:GetRegistryStorage | Read | Show what the registry stores, per repository, against the quotas |
ecr:PutRegistryStorageQuota | Write | Set or remove the organization's registry storage quota |
ecr:DescribeRegistryAliases | Read | List the registry aliases: references like ghcr.io/acme in workflow files that CI jobs send to this registry instead |
ecr:PutRegistryAliases | Write | Set the registry aliases: which other-registry owners (ghcr.io/acme) CI jobs send to which namespace of this registry |
ecr:DescribePullThroughCacheRules | Read | List the pull-through cache rules and the upstream each mirrors |
ecr:CreatePullThroughCacheRule | Write | Mirror an upstream registry (Docker Hub, GHCR, …) under a prefix |
ecr:UpdatePullThroughCacheRule | Write | Change a pull-through cache rule's upstream login |
ecr:DeletePullThroughCacheRule | Write · destructive | Delete a pull-through cache rule (cached images stay) |
ecr:BatchImportUpstreamImage | Write | Bring an image in from the upstream on a pull through a cache rule (stores it in the registry) |
ecr:DescribeImageSignatures | Read | Verify an image's cosign and notation signatures against the trusted keys |
ecr:GetSigningPolicy | Read | Read the signing policy: whether only signed images deploy, and the trusted keys |
ecr:PutSigningPolicy | Write | Turn "only signed images deploy" on or off for the organization |
ecr:CreateSigningKey | Write | Trust a cosign public key or a notation certificate |
ecr:DeleteSigningKey | Write · destructive | Stop trusting a signing key |
Generated from the service’s IAM descriptor. Sensitive reads hand over secret material or source code and are recorded in the audit log like writes; destructive writes delete, overwrite or revoke.
- A policy names one repository by its id, or all of them; there are no name prefixes such as
team/*. docker pushneedsecr:PushImageon the repository; to a name that has no repository yet,ecr:CreateRepositoryon the registry instead.docker pullneedsecr:PullImage, unless the repository is public and no credentials are sent.ecr:PullImageis marked sensitive and is not in the read-only policies.- A registry delete (
DELETE /v2/<repository>/manifests/<reference>) needsecr:DeleteImage, orecr:PushImage. - Bringing an image in through a pull-through cache needs
ecr:BatchImportUpstreamImageon the registry. ecr:GetAuthorizationTokencounts as a write: a login token carries your registry rights for 12 hours.- The console's repository pages need
ecr:DescribeRepositorieson the repository; without it they answer 404. Its Images tab lists images with that permission alone, while the API's image list needsecr:ListImages.
Audit
A write through the API that reaches its permission check is recorded in the audit log, allowed or denied; issuing a login token counts as a write. A request refused before that, for a malformed id or body, is not recorded. In the registry protocol, creating a repository by a push and bringing an image in through a pull-through cache are recorded; pushes, pulls and deletes are not. See Audit log.
Public repositories
A public repository serves anonymous pulls only. An anonymous registry token names that one
repository, grants pull and nothing else, and reaches only the layers its own images reference.
Every write without credentials is refused with DENIED anonymous access is read-only.
Isolation
The registry host names your organization; a credential of another organization is refused. A layer is served from a repository only if that repository holds it, whatever its digest, so a digest from a build log reveals nothing in another repository.