Translated ['src/README.md', 'src/banners/hacktricks-training.md', 'src/

This commit is contained in:
Translator
2024-12-31 20:20:29 +00:00
parent 77a009d308
commit 4bcd54c1b6
245 changed files with 9959 additions and 12700 deletions

View File

@@ -4,31 +4,30 @@
## ECS
### Basic Information
### Grundinformationen
Amazon **Elastic Container Services** or ECS provides a platform to **host containerized applications in the cloud**. ECS has two **deployment** methods, **EC2** instance type and a **serverless** option, **Fargate**. The service **makes running containers in the cloud very easy and pain free**.
Amazon **Elastic Container Services** oder ECS bietet eine Plattform, um **containerisierte Anwendungen in der Cloud zu hosten**. ECS hat zwei **Bereitstellungsmethoden**, **EC2** Instanztyp und eine **serverlose** Option, **Fargate**. Der Dienst **macht das Ausführen von Containern in der Cloud sehr einfach und schmerzfrei**.
ECS operates using the following three building blocks: **Clusters**, **Services**, and **Task Definitions**.
ECS funktioniert mit den folgenden drei Bausteinen: **Cluster**, **Dienste** und **Aufgabendefinitionen**.
- **Clusters** are **groups of containers** that are running in the cloud. As previously mentioned, there are two launch types for containers, EC2 and Fargate. AWS defines the **EC2** launch type as allowing customers “to run \[their] containerized applications on a cluster of Amazon EC2 instances that \[they] **manage**. **Fargate** is similar and is defined as \[allowing] you to run your containerized applications **without the need to provision and manage** the backend infrastructure”.
- **Services** are created inside a cluster and responsible for **running the tasks**. Inside a service definition **you define the number of tasks to run, auto scaling, capacity provider (Fargate/EC2/External),** **networking** information such as VPCs, subnets, and security groups.
- There **2 types of applications**:
- **Service**: A group of tasks handling a long-running computing work that can be stopped and restarted. For example, a web application.
- **Task**: A standalone task that runs and terminates. For example, a batch job.
- Among the service applications, there are **2 types of service schedulers**:
- [**REPLICA**](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html): The replica scheduling strategy places and **maintains the desired number** of tasks across your cluster. If for some reason a task shut down, a new one is launched in the same or different node.
- [**DAEMON**](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html): Deploys exactly one task on each active container instance that has the needed requirements. There is no need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies.
- **Task Definitions** are responsible for **defining what containers will run** and the various parameters that will be configured with the containers such as **port mappings** with the host, **env variables**, Docker **entrypoint**...
- Check **env variables for sensitive info**!
- **Cluster** sind **Gruppen von Containern**, die in der Cloud ausgeführt werden. Wie bereits erwähnt, gibt es zwei Starttypen für Container, EC2 und Fargate. AWS definiert den **EC2** Starttyp als die Möglichkeit für Kunden, „ihre containerisierten Anwendungen auf einem Cluster von Amazon EC2-Instanzen, die sie **verwalten**, auszuführen“. **Fargate** ist ähnlich und wird definiert als \[ermöglicht] Ihnen, Ihre containerisierten Anwendungen **ohne die Notwendigkeit, die Backend-Infrastruktur bereitzustellen und zu verwalten** auszuführen“.
- **Dienste** werden innerhalb eines Clusters erstellt und sind verantwortlich für **das Ausführen der Aufgaben**. Innerhalb einer Dienstdefinition **definieren Sie die Anzahl der auszuführenden Aufgaben, die automatische Skalierung, den Kapazitätsanbieter (Fargate/EC2/Extern),** **Netzwerkinformationen** wie VPCs, Subnetze und Sicherheitsgruppen.
- Es gibt **2 Arten von Anwendungen**:
- **Dienst**: Eine Gruppe von Aufgaben, die eine lang laufende Rechenarbeit verwaltet, die gestoppt und neu gestartet werden kann. Zum Beispiel eine Webanwendung.
- **Aufgabe**: Eine eigenständige Aufgabe, die ausgeführt und beendet wird. Zum Beispiel ein Batch-Job.
- Unter den Dienstanwendungen gibt es **2 Arten von Dienstplanern**:
- [**REPLICA**](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html): Die Replikationsplanungsstrategie platziert und **pflegt die gewünschte Anzahl** von Aufgaben in Ihrem Cluster. Wenn aus irgendeinem Grund eine Aufgabe heruntergefahren wird, wird eine neue auf demselben oder einem anderen Knoten gestartet.
- [**DAEMON**](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html): Setzt genau eine Aufgabe auf jeder aktiven Containerinstanz ein, die die benötigten Anforderungen hat. Es ist nicht erforderlich, eine gewünschte Anzahl von Aufgaben, eine Aufgabenplatzierungsstrategie oder Service-Auto-Skalierungsrichtlinien anzugeben.
- **Aufgabendefinitionen** sind verantwortlich für **die Definition, welche Container ausgeführt werden** und die verschiedenen Parameter, die mit den Containern konfiguriert werden, wie **Portzuordnungen** mit dem Host, **Umgebungsvariablen**, Docker **Einstiegspunkt**...
- Überprüfen Sie **Umgebungsvariablen auf sensible Informationen**!
### Sensitive Data In Task Definitions
### Sensible Daten in Aufgabendefinitionen
Task definitions are responsible for **configuring the actual containers that will be running in ECS**. Since task definitions define how containers will run, a plethora of information can be found within.
Aufgabendefinitionen sind verantwortlich für **die Konfiguration der tatsächlichen Container, die in ECS ausgeführt werden**. Da Aufgabendefinitionen definieren, wie Container ausgeführt werden, kann eine Fülle von Informationen darin gefunden werden.
Pacu can enumerate ECS (list-clusters, list-container-instances, list-services, list-task-definitions), it can also dump task definitions.
### Enumeration
Pacu kann ECS auflisten (list-clusters, list-container-instances, list-services, list-task-definitions), es kann auch Aufgabendefinitionen dumpen.
### Aufzählung
```bash
# Clusters info
aws ecs list-clusters
@@ -52,7 +51,6 @@ aws ecs describe-tasks --cluster <cluster> --tasks <tasks>
## Look for env vars and secrets used from the task definition
aws ecs describe-task-definition --task-definition <TASK_NAME>:<VERSION>
```
### Unauthenticated Access
{{#ref}}
@@ -61,7 +59,7 @@ aws ecs describe-task-definition --task-definition <TASK_NAME>:<VERSION>
### Privesc
In the following page you can check how to **abuse ECS permissions to escalate privileges**:
Auf der folgenden Seite können Sie überprüfen, wie man **ECS-Berechtigungen missbraucht, um Privilegien zu eskalieren**:
{{#ref}}
../aws-privilege-escalation/aws-ecs-privesc.md
@@ -80,7 +78,3 @@ In the following page you can check how to **abuse ECS permissions to escalate p
{{#endref}}
{{#include ../../../banners/hacktricks-training.md}}