mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-17 07:11:47 -08:00
Translated ['src/README.md', 'src/banners/hacktricks-training.md', 'src/
This commit is contained in:
@@ -6,49 +6,48 @@
|
||||
|
||||
### ECR
|
||||
|
||||
#### Basic Information
|
||||
#### Informazioni di base
|
||||
|
||||
Amazon **Elastic Container Registry** (Amazon ECR) is a **managed container image registry service**. It is designed to provide an environment where customers can interact with their container images using well-known interfaces. Specifically, the use of the Docker CLI or any preferred client is supported, enabling activities such as pushing, pulling, and managing container images.
|
||||
Amazon **Elastic Container Registry** (Amazon ECR) è un **servizio di registrazione di immagini di container gestito**. È progettato per fornire un ambiente in cui i clienti possono interagire con le loro immagini di container utilizzando interfacce ben note. In particolare, è supportato l'uso del Docker CLI o di qualsiasi client preferito, consentendo attività come il caricamento, il download e la gestione delle immagini di container.
|
||||
|
||||
ECR is compose by 2 types of objects: **Registries** and **Repositories**.
|
||||
ECR è composto da 2 tipi di oggetti: **Registries** e **Repositories**.
|
||||
|
||||
**Registries**
|
||||
|
||||
Every AWS account has 2 registries: **Private** & **Public**.
|
||||
Ogni account AWS ha 2 registri: **Privati** e **Pubblici**.
|
||||
|
||||
1. **Private Registries**:
|
||||
1. **Registri Privati**:
|
||||
|
||||
- **Private by default**: The container images stored in an Amazon ECR private registry are **only accessible to authorized users** within your AWS account or to those who have been granted permission.
|
||||
- The URI of a **private repository** follows the format `<account_id>.dkr.ecr.<region>.amazonaws.com/<repo-name>`
|
||||
- **Access control**: You can **control access** to your private container images using **IAM policies**, and you can configure fine-grained permissions based on users or roles.
|
||||
- **Integration with AWS services**: Amazon ECR private registries can be easily **integrated with other AWS services**, such as EKS, ECS...
|
||||
- **Other private registry options**:
|
||||
- The Tag immutability column lists its status, if tag immutability is enabled it will **prevent** image **pushes** with **pre-existing tags** from overwriting the images.
|
||||
- The **Encryption type** column lists the encryption properties of the repository, it shows the default encryption types such as AES-256, or has **KMS** enabled encryptions.
|
||||
- The **Pull through cache** column lists its status, if Pull through cache status is Active it will cache **repositories in an external public repository into your private repository**.
|
||||
- Specific **IAM policies** can be configured to grant different **permissions**.
|
||||
- The **scanning configuration** allows to scan for vulnerabilities in the images stored inside the repo.
|
||||
- **Privati per impostazione predefinita**: Le immagini di container memorizzate in un registro privato di Amazon ECR sono **accessibili solo agli utenti autorizzati** all'interno del tuo account AWS o a coloro a cui è stata concessa l'autorizzazione.
|
||||
- L'URI di un **repository privato** segue il formato `<account_id>.dkr.ecr.<region>.amazonaws.com/<repo-name>`
|
||||
- **Controllo accessi**: Puoi **controllare l'accesso** alle tue immagini di container private utilizzando **politiche IAM**, e puoi configurare permessi dettagliati basati su utenti o ruoli.
|
||||
- **Integrazione con i servizi AWS**: I registri privati di Amazon ECR possono essere facilmente **integrati con altri servizi AWS**, come EKS, ECS...
|
||||
- **Altre opzioni per i registri privati**:
|
||||
- La colonna dell'immutabilità dei tag elenca il suo stato, se l'immutabilità dei tag è abilitata, **prevenirà** i **push** di immagini con **tag preesistenti** di sovrascrivere le immagini.
|
||||
- La colonna del **tipo di crittografia** elenca le proprietà di crittografia del repository, mostra i tipi di crittografia predefiniti come AES-256, o ha crittografie abilitate **KMS**.
|
||||
- La colonna del **Pull through cache** elenca il suo stato, se lo stato del Pull through cache è Attivo, memorizzerà nella cache **repository in un repository pubblico esterno nel tuo repository privato**.
|
||||
- Politiche **IAM specifiche** possono essere configurate per concedere diverse **autorizzazioni**.
|
||||
- La **configurazione della scansione** consente di scansionare le vulnerabilità nelle immagini memorizzate all'interno del repository.
|
||||
|
||||
2. **Public Registries**:
|
||||
2. **Registri Pubblici**:
|
||||
|
||||
- **Public accessibility**: Container images stored in an ECR Public registry are **accessible to anyone on the internet without authentication.**
|
||||
- The URI of a **public repository** is like `public.ecr.aws/<random>/<name>`. Although the `<random>` part can be changed by the admin to another string easier to remember.
|
||||
- **Accessibilità pubblica**: Le immagini di container memorizzate in un registro pubblico ECR sono **accessibili a chiunque su Internet senza autenticazione.**
|
||||
- L'URI di un **repository pubblico** è simile a `public.ecr.aws/<random>/<name>`. Anche se la parte `<random>` può essere cambiata dall'amministratore in un'altra stringa più facile da ricordare.
|
||||
|
||||
**Repositories**
|
||||
|
||||
These are the **images** that in the **private registry** or to the **public** one.
|
||||
Queste sono le **immagini** che si trovano nel **registro privato** o in quello **pubblico**.
|
||||
|
||||
> [!NOTE]
|
||||
> Note that in order to upload an image to a repository, the **ECR repository need to have the same name as the image**.
|
||||
> Nota che per caricare un'immagine in un repository, il **repository ECR deve avere lo stesso nome dell'immagine**.
|
||||
|
||||
#### Registry & Repository Policies
|
||||
#### Politiche di Registry & Repository
|
||||
|
||||
**Registries & repositories** also have **policies that can be used to grant permissions to other principals/accounts**. For example, in the following repository policy image you can see how any user from the whole organization will be able to access the image:
|
||||
**Registries e repositories** hanno anche **politiche che possono essere utilizzate per concedere autorizzazioni ad altri principi/account**. Ad esempio, nella seguente immagine della politica del repository puoi vedere come qualsiasi utente dell'intera organizzazione sarà in grado di accedere all'immagine:
|
||||
|
||||
<figure><img src="../../../images/image (280).png" alt=""><figcaption></figcaption></figure>
|
||||
|
||||
#### Enumeration
|
||||
|
||||
#### Enumerazione
|
||||
```bash
|
||||
# Get repos
|
||||
aws ecr describe-repositories
|
||||
@@ -68,8 +67,7 @@ aws ecr-public describe-repositories
|
||||
aws ecr get-registry-policy
|
||||
aws ecr get-repository-policy --repository-name <repo_name>
|
||||
```
|
||||
|
||||
#### Unauthenticated Enum
|
||||
#### Enum non autenticato
|
||||
|
||||
{{#ref}}
|
||||
../aws-unauthenticated-enum-access/aws-ecr-unauthenticated-enum.md
|
||||
@@ -77,7 +75,7 @@ aws ecr get-repository-policy --repository-name <repo_name>
|
||||
|
||||
#### Privesc
|
||||
|
||||
In the following page you can check how to **abuse ECR permissions to escalate privileges**:
|
||||
Nella pagina seguente puoi controllare come **abusare dei permessi ECR per escalare i privilegi**:
|
||||
|
||||
{{#ref}}
|
||||
../aws-privilege-escalation/aws-ecr-privesc.md
|
||||
@@ -89,18 +87,14 @@ In the following page you can check how to **abuse ECR permissions to escalate p
|
||||
../aws-post-exploitation/aws-ecr-post-exploitation.md
|
||||
{{#endref}}
|
||||
|
||||
#### Persistence
|
||||
#### Persistenza
|
||||
|
||||
{{#ref}}
|
||||
../aws-persistence/aws-ecr-persistence.md
|
||||
{{#endref}}
|
||||
|
||||
## References
|
||||
## Riferimenti
|
||||
|
||||
- [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/Welcome.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/Welcome.html)
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user