> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-private-ecr-repository-policy-is-overly-permissive.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# AWS Private ECR repository policy is overly permissive

### Synopsis

| Field               | Value                                                  |
| ------------------- | ------------------------------------------------------ |
| Rule Type           | Detection                                              |
| Finding Type        | AWS Private ECR repository policy is overly permissive |
| Finding ID          | 60000321                                               |
| Generates a Finding | This detection rule also generates a finding           |
| Severity            | Medium                                                 |
| Category            | CONFIGURATION                                          |
| Cloud Providers     | AWS                                                    |
| Platform Module     | CSPM                                                   |
| Asset Types         | CONTAINER\_IMAGE\_REPOSITORY                           |

### Description

Overly permissive AWS Private ECR repository policies allow unauthorized access to sensitive Docker images, potentially leading to data breaches or unauthorized deployments. ECR repositories store container images, often containing application code and credentials. A misconfigured policy grants excessive access, exposing these assets to attackers.

The ECR registry policy controls access to container images. A permissive policy, such as allowing access from any IP address or granting 'pull' and 'push' permissions broadly, significantly increases the attack surface. Attackers can exploit this to download sensitive images or inject malicious code into the repository, compromising applications and data.

The impact of this misconfiguration ranges from data breaches and intellectual property theft to unauthorized deployments of malicious applications, potentially disrupting services or causing financial loss. Restricting access to only authorized users and services is crucial to maintaining the integrity and confidentiality of container images.

Implement least privilege access control. Explicitly define allowed principals (e.g., IAM users, roles, or specific IP addresses) and grant only necessary permissions ('pull' for consumers, 'push' for maintainers). Regularly review and audit ECR repository policies to identify and address overly permissive configurations. Employ strong authentication mechanisms and monitor access logs for suspicious activity.

### Remediation

1. Log in to the AWS Console
2. In the console, select the specific region from region drop down on the top right corner, for which the alert is generated.
3. Navigate to 'ECR' dashboard from 'Services' dropdown
4. Go to 'Repository', from the left panel
5. Select the repository for which alert is being generated
6. Select the 'Permissions' option from left menu below 'repositores'
7. Click on 'Edit policy JSON' to modify the JSON so that Principal is restrictive
8. After modifications, click on 'Save'.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/posture-rules/cloud-saas-active-directory-posture-rules/cortex-posture-query-based-rules/detection-rules-by-name/aws-private-ecr-repository-policy-is-overly-permissive.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
