Skip to main content
IAM Policy Map

AmazonElasticContainerRegistryPublicReadOnly

ReaderAWS managedActiveReviewedShow on mapCompare

Summary

Provides read-only access to Amazon ECR Public repositories. The Amazon ECR Public User Guide says to add it to entities so they can still use the Amazon ECR console.

Permissions imported from the AWS Managed Policy Reference Guide; other sections reviewed against the listed AWS sources.

Identity

ARN
arn:aws:iam::aws:policy/AmazonElasticContainerRegistryPublicReadOnly
Default version
v1
Created
Last edited
Services
ecr-public, sts

Control-plane actions (10)

By access level: 3 List, 7 Read.

Control-plane actions by service
ServiceGrantedAccess levels and limitsGranted by
Elastic Container Registry Public9 of 233 List, 6 Read; 0 restricted, 0 conditionalecr-public:BatchCheckLayerAvailability, ecr-public:DescribeImageTags, ecr-public:DescribeImages, ecr-public:DescribeRegistries, ecr-public:DescribeRepositories, ecr-public:GetAuthorizationToken, ecr-public:GetRegistryCatalogData, ecr-public:GetRepositoryCatalogData, ecr-public:GetRepositoryPolicy
STS1 of 161 Read; 0 restricted, 0 conditionalsts:GetServiceBearerToken
Elastic Container Registry Public: 9 actions
  • ecr-public:BatchCheckLayerAvailability (Read)
  • ecr-public:DescribeImageTags (List)
  • ecr-public:DescribeImages (Read)
  • ecr-public:DescribeRegistries (List)
  • ecr-public:DescribeRepositories (List)
  • ecr-public:GetAuthorizationToken (Read)
  • ecr-public:GetRegistryCatalogData (Read)
  • ecr-public:GetRepositoryCatalogData (Read)
  • ecr-public:GetRepositoryPolicy (Read)
STS: 1 actions
  • sts:GetServiceBearerToken (Read)

Data-plane actions (0)

By access level: none.

This policy grants no actions in this plane.

Excluded and conditional actions

No patterns are excluded by NotAction or Deny statements.

Resource scope and attachment

Resource scope across granted actions: all-resources.

Can be attached: Yes, to users, groups and roles.

Why this tier

  • Grants only List and Read actions.

Guidance

Practical scope

One statement allows 10 actions on Resource "*": ecr-public:GetAuthorizationToken, sts:GetServiceBearerToken, ecr-public:BatchCheckLayerAvailability, ecr-public:GetRepositoryPolicy, ecr-public:DescribeRepositories, ecr-public:DescribeRegistries, ecr-public:DescribeImages, ecr-public:DescribeImageTags, ecr-public:GetRepositoryCatalogData and ecr-public:GetRegistryCatalogData.

Use cases

  • Give users or roles read-only access to Amazon ECR Public repositories, including the console minimum for listing and viewing ECR Public resources.

Best practices

  • AWS managed policies don't grant least privilege permissions. The IAM User Guide says to consider the security risk of granting principals more permissions than they need, and suggests using Access Analyzer to see which permissions principals use, then writing a custom policy or generating one with only the required permissions.

Security considerations

  • It includes ecr-public:GetAuthorizationToken and sts:GetServiceBearerToken, which are not describe or list actions, so it is more than metadata reads.
  • ecr-public:GetRepositoryPolicy lets principals read repository policies on all resources.
  • You cannot change the permissions in an AWS managed policy. If AWS updates the policy, the update affects every user, group and role it is attached to.

Assignment guidance

You can attach this policy to your users, groups and roles. The reference page also links to guidance on creating a permission set using AWS managed policies in IAM Identity Center. The Amazon ECR Public User Guide says to add it to entities so they can still use the Amazon ECR console when you use more restrictive policies.

Same service

Same domain

Frequently asked questions

When should I attach AmazonElasticContainerRegistryPublicReadOnly?
The reference page says you can attach AmazonElasticContainerRegistryPublicReadOnly to your users, groups and roles, and describes it as: provides read-only access to Amazon ECR Public repositories. Attach it where viewing ECR Public repositories is the intended scope.
What does AmazonElasticContainerRegistryPublicReadOnly grant?
It allows ten actions on all resources: ecr-public describe, catalog data and repository policy reads, ecr-public:BatchCheckLayerAvailability, ecr-public:GetAuthorizationToken and sts:GetServiceBearerToken.
What are the security risks of AmazonElasticContainerRegistryPublicReadOnly?
It is read only by name, but it includes GetAuthorizationToken and sts:GetServiceBearerToken and applies to all resources. AWS managed policies don't grant least privilege permissions, and you must consider the security risk of granting principals more permissions than they need. AWS updates to the policy affect every identity it is attached to.

Policy JSON

Download policy.json

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ecr-public:GetAuthorizationToken",
        "sts:GetServiceBearerToken",
        "ecr-public:BatchCheckLayerAvailability",
        "ecr-public:GetRepositoryPolicy",
        "ecr-public:DescribeRepositories",
        "ecr-public:DescribeRegistries",
        "ecr-public:DescribeImages",
        "ecr-public:DescribeImageTags",
        "ecr-public:GetRepositoryCatalogData",
        "ecr-public:GetRegistryCatalogData"
      ],
      "Resource": "*"
    }
  ]
}

Version history

Current version v1, edited by AWS on 2020-12-01. Version history is recorded from 2026-11-11. Earlier versions are in the IAM console under Policy versions.

Attach snippets

AWS CLI

aws iam attach-role-policy --role-name ROLE_NAME --policy-arn arn:aws:iam::aws:policy/AmazonElasticContainerRegistryPublicReadOnly
aws iam attach-user-policy --user-name USER_NAME --policy-arn arn:aws:iam::aws:policy/AmazonElasticContainerRegistryPublicReadOnly
aws iam attach-group-policy --group-name GROUP_NAME --policy-arn arn:aws:iam::aws:policy/AmazonElasticContainerRegistryPublicReadOnly

CloudFormation

Resources:
  ExampleRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument: {}  # replace with your trust policy
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/AmazonElasticContainerRegistryPublicReadOnly

Terraform

resource "aws_iam_role_policy_attachment" "amazonelasticcontainerregistrypublicreadonly" {
  role       = aws_iam_role.example.name
  policy_arn = "arn:aws:iam::aws:policy/AmazonElasticContainerRegistryPublicReadOnly"
}

CDK (TypeScript)

role.addManagedPolicy(
  iam.ManagedPolicy.fromAwsManagedPolicyName("AmazonElasticContainerRegistryPublicReadOnly"),
);

Sources