| name | cis-eks-v160-5.1.2 |
| description | Minimize user access to Amazon ECR (Manual) |
| category | cis-eks |
| version | 1.6.0 |
| author | cyberstrike-official |
| tags | ["cis","eks","kubernetes","aws","ecr","iam","access-control","least-privilege"] |
| cis_id | 5.1.2 |
| cis_benchmark | CIS Amazon Elastic Kubernetes Service (EKS) Benchmark v1.6.0 |
| tech_stack | ["kubernetes","aws","eks"] |
| cwe_ids | [] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
5.1.2 Minimize user access to Amazon ECR (Manual)
Profile Applicability
Description
Restrict user access to Amazon ECR, limiting interaction with build images to only authorized personnel and service accounts.
Rationale
Weak access control to Amazon ECR may allow malicious users to replace built images with vulnerable containers.
Impact
Care should be taken not to remove access to Amazon ECR for accounts that require this for their operation.
Audit Procedure
Review IAM policies associated with Amazon ECR to ensure that access is restricted to only authorized users and service accounts.
Remediation
Before you use IAM to manage access to Amazon ECR, you should understand what IAM features are available to use with Amazon ECR. To get a high-level view of how Amazon ECR and other AWS services work with IAM, see AWS Services That Work with IAM in the IAM User Guide.
Topics:
- Amazon ECR Identity-Based Policies
- Amazon ECR Resource-Based Policies
- Authorization Based on Amazon ECR Tags
- Amazon ECR IAM Roles
Amazon ECR Identity-Based Policies
With IAM identity-based policies, you can specify allowed or denied actions and resources as well as the conditions under which actions are allowed or denied. Amazon ECR supports specific actions, resources, and condition keys.
Actions: The Action element of an IAM identity-based policy describes the specific action or actions that will be allowed or denied by the policy. Policy actions usually have the same name as the associated AWS API operation. The action is used in a policy to grant permissions to perform the associated operation.
Policy actions in Amazon ECR use the following prefix before the action: ecr:. For example, to grant someone permission to create an Amazon ECR repository with the Amazon ECR CreateRepository API operation, you include the ecr:CreateRepository action in their policy.
To specify multiple actions in a single statement, separate them with commas as follows:
"Action": [ "ecr:action1", "ecr:action2" ]
You can specify multiple actions using wildcards (*). For example, to specify all actions that begin with the word Describe, include the following action: