AmazonEC2ContainerRegistryReadOnly
Summary
Provides read-only access to Amazon EC2 Container Registry repositories. The Amazon ECR User Guide says it includes listing repositories and images and pulling images with the Docker CLI.
Permissions imported from the AWS Managed Policy Reference Guide; other sections reviewed against the listed AWS sources.
Identity
- ARN
arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly- Default version
- v3
- Created
- Last edited
- Services
- ecr
Control-plane actions (12)
By access level: 2 List, 10 Read.
| Service | Granted | Access levels and limits | Granted by |
|---|---|---|---|
| Elastic Container Registry | 12 of 65 | 2 List, 10 Read; 0 restricted, 0 conditional | ecr:BatchCheckLayerAvailability, ecr:BatchGetImage, ecr:DescribeImageScanFindings, ecr:DescribeImages, ecr:DescribeRepositories, ecr:GetAuthorizationToken, ecr:GetDownloadUrlForLayer, ecr:GetLifecyclePolicy, ecr:GetLifecyclePolicyPreview, ecr:GetRepositoryPolicy, ecr:ListImages, ecr:ListTagsForResource |
Elastic Container Registry: 12 actions
- ecr:BatchCheckLayerAvailability (Read)
- ecr:BatchGetImage (Read)
- ecr:DescribeImageScanFindings (Read)
- ecr:DescribeImages (List)
- ecr:DescribeRepositories (Read)
- ecr:GetAuthorizationToken (Read)
- ecr:GetDownloadUrlForLayer (Read)
- ecr:GetLifecyclePolicy (Read)
- ecr:GetLifecyclePolicyPreview (Read)
- ecr:GetRepositoryPolicy (Read)
- ecr:ListImages (List)
- ecr:ListTagsForResource (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 on Resource "*" allows 12 actions: ecr:GetAuthorizationToken, ecr:BatchCheckLayerAvailability, ecr:GetDownloadUrlForLayer, ecr:GetRepositoryPolicy, ecr:DescribeRepositories, ecr:ListImages, ecr:DescribeImages, ecr:BatchGetImage, ecr:GetLifecyclePolicy, ecr:GetLifecyclePolicyPreview, ecr:ListTagsForResource and ecr:DescribeImageScanFindings. It has no upload, create, delete or policy-changing actions.
Use cases
- Let users or roles list Amazon ECR repositories and images and pull images, without changing anything.
Best practices
- AWS managed policies don't grant least privilege permissions. The IAM User Guide suggests using IAM Access Analyzer to see which permissions principals actually use, then writing a custom policy or generating one with only the required permissions.
Security considerations
- The policy grants no write actions, but it applies to all resources, so principals can pull images from every repository in the account.
- 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 User Guide says you can attach it to your IAM identities. It fits where read-only access to Amazon ECR is intended.
Related policies
Same service
- AmazonBraketJobsExecutionPolicy
- AmazonEC2ContainerRegistryFullAccess
- AmazonEC2ContainerRegistryPowerUser
- AmazonEC2ContainerRegistryPullOnly
- AmazonEC2ContainerServiceforEC2Role
- AmazonECSTaskExecutionRolePolicy
- AmazonEKSFargatePodExecutionRolePolicy
- AWSAppRunnerServicePolicyForECRAccess
Same domain
- AmazonEC2ContainerServiceAutoscaleRole
- AmazonEC2ContainerServiceEventsRole
- AmazonECSInstanceRolePolicyForManagedInstances
- AmazonEKSMCPReadOnlyAccess
- AmazonEKSWorkerNodeMinimalPolicy
- AmazonElasticContainerRegistryPublicFullAccess
- AmazonElasticContainerRegistryPublicPowerUser
- AmazonElasticContainerRegistryPublicReadOnly
Frequently asked questions
- When should I attach AmazonEC2ContainerRegistryReadOnly?
- The Amazon ECR User Guide says you can attach it to your IAM identities, and that it grants read-only permissions to Amazon ECR, including listing repositories and images and pulling images with the Docker CLI. Attach it where that scope is intended.
- What does AmazonEC2ContainerRegistryReadOnly grant?
- It allows 12 read and pull actions on all resources, including ecr:GetAuthorizationToken, ecr:BatchGetImage, ecr:GetDownloadUrlForLayer, ecr:DescribeRepositories and ecr:ListImages. It has no upload, create, delete or policy-changing actions.
- What are the security risks of AmazonEC2ContainerRegistryReadOnly?
- The policy grants no write actions, but it applies to all resources and includes pulling images from every repository. 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
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:GetDownloadUrlForLayer",
"ecr:GetRepositoryPolicy",
"ecr:DescribeRepositories",
"ecr:ListImages",
"ecr:DescribeImages",
"ecr:BatchGetImage",
"ecr:GetLifecyclePolicy",
"ecr:GetLifecyclePolicyPreview",
"ecr:ListTagsForResource",
"ecr:DescribeImageScanFindings"
],
"Resource": "*"
}
]
}
Version history
Current version v3, edited by AWS on 2019-12-10. 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/AmazonEC2ContainerRegistryReadOnly
aws iam attach-user-policy --user-name USER_NAME --policy-arn arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
aws iam attach-group-policy --group-name GROUP_NAME --policy-arn arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnlyCloudFormation
Resources:
ExampleRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument: {} # replace with your trust policy
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnlyTerraform
resource "aws_iam_role_policy_attachment" "amazonec2containerregistryreadonly" {
role = aws_iam_role.example.name
policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
}CDK (TypeScript)
role.addManagedPolicy(
iam.ManagedPolicy.fromAwsManagedPolicyName("AmazonEC2ContainerRegistryReadOnly"),
);Sources
- AmazonEC2ContainerRegistryReadOnly (AWS Managed Policy Reference Guide) (retrieved ; supports summary, practicalScope, securityConsiderations, assignmentGuidance, faqs, useCases)
- AWS managed policies for Amazon ECR (retrieved ; supports summary, useCases, assignmentGuidance, faqs)
- Managed policies and inline policies (IAM User Guide) (retrieved ; supports securityConsiderations, faqs)
- AWS managed policies for job functions (IAM User Guide) (retrieved ; supports bestPractices, faqs)