mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-18 15:45:54 -08:00
Translated ['src/README.md', 'src/banners/hacktricks-training.md', 'src/
This commit is contained in:
@@ -4,22 +4,21 @@
|
||||
|
||||
## Amazon MSK
|
||||
|
||||
**Amazon Managed Streaming for Apache Kafka (Amazon MSK)** is a service that is fully managed, facilitating the development and execution of applications processing streaming data through **Apache Kafka**. Control-plane operations, including creation, update, and deletion of **clusters**, are offered by Amazon MSK. The service permits the utilization of Apache Kafka **data-plane operations**, encompassing data production and consumption. It operates on **open-source versions of Apache Kafka**, ensuring compatibility with existing applications, tooling, and plugins from both partners and the **Apache Kafka community**, eliminating the need for alterations in the application code.
|
||||
**Amazon Managed Streaming for Apache Kafka (Amazon MSK)** ist ein vollständig verwalteter Dienst, der die Entwicklung und Ausführung von Anwendungen erleichtert, die Streaming-Daten über **Apache Kafka** verarbeiten. Die Steuerungsebene, einschließlich Erstellung, Aktualisierung und Löschung von **Clustern**, wird von Amazon MSK angeboten. Der Dienst ermöglicht die Nutzung von Apache Kafka **Datenebene-Operationen**, die die Datenproduktion und -konsumtion umfassen. Er basiert auf **Open-Source-Versionen von Apache Kafka**, was die Kompatibilität mit bestehenden Anwendungen, Tools und Plugins sowohl von Partnern als auch aus der **Apache Kafka-Community** gewährleistet und die Notwendigkeit von Änderungen im Anwendungscode beseitigt.
|
||||
|
||||
In terms of reliability, Amazon MSK is designed to **automatically detect and recover from prevalent cluster failure scenarios**, ensuring that producer and consumer applications persist in their data writing and reading activities with minimal disruption. Moreover, it aims to optimize data replication processes by attempting to **reuse the storage of replaced brokers**, thereby minimizing the volume of data that needs to be replicated by Apache Kafka.
|
||||
In Bezug auf die Zuverlässigkeit ist Amazon MSK so konzipiert, dass es **automatisch verbreitete Clusterfehler-Szenarien erkennt und sich davon erholt**, sodass Produzenten- und Konsumenten-Anwendungen ihre Daten Schreib- und Leseaktivitäten mit minimalen Unterbrechungen fortsetzen können. Darüber hinaus zielt es darauf ab, die Datenreplikationsprozesse zu optimieren, indem es versucht, den Speicher von ersetzten Brokern **wiederzuverwenden**, wodurch das Volumen der Daten, die von Apache Kafka repliziert werden müssen, minimiert wird.
|
||||
|
||||
### **Types**
|
||||
### **Typen**
|
||||
|
||||
There are 2 types of Kafka clusters that AWS allows to create: Provisioned and Serverless.
|
||||
Es gibt 2 Arten von Kafka-Clustern, die AWS erstellen lässt: Bereitgestellt und Serverlos.
|
||||
|
||||
From the point of view of an attacker you need to know that:
|
||||
Aus der Sicht eines Angreifers müssen Sie wissen, dass:
|
||||
|
||||
- **Serverless cannot be directly public** (it can only run in a VPN without any publicly exposed IP). However, **Provisioned** can be configured to get a **public IP** (by default it doesn't) and configure the **security group** to **expose** the relevant ports.
|
||||
- **Serverless** **only support IAM** as authentication method. **Provisioned** support SASL/SCRAM (**password**) authentication, **IAM** authentication, AWS **Certificate** Manager (ACM) authentication and **Unauthenticated** access.
|
||||
- Note that it's not possible to expose publicly a Provisioned Kafka if unauthenticated access is enabled
|
||||
- **Serverlos kann nicht direkt öffentlich sein** (es kann nur in einem VPN ohne öffentlich exponierte IP betrieben werden). **Bereitgestellt** kann jedoch so konfiguriert werden, dass es eine **öffentliche IP** erhält (standardmäßig geschieht dies nicht) und die **Sicherheitsgruppe** so konfiguriert wird, dass die relevanten Ports **exponiert** werden.
|
||||
- **Serverlos** **unterstützt nur IAM** als Authentifizierungsmethode. **Bereitgestellt** unterstützt SASL/SCRAM (**Passwort**) Authentifizierung, **IAM** Authentifizierung, AWS **Zertifikat** Manager (ACM) Authentifizierung und **unauthentifizierten** Zugriff.
|
||||
- Beachten Sie, dass es nicht möglich ist, ein bereitgestelltes Kafka öffentlich zu exponieren, wenn der unauthentifizierte Zugriff aktiviert ist.
|
||||
|
||||
### Enumeration
|
||||
|
||||
```bash
|
||||
#Get clusters
|
||||
aws kafka list-clusters
|
||||
@@ -43,9 +42,7 @@ aws kafka describe-configuration-revision --arn <config-arn> --revision <version
|
||||
# If using SCRAN authentication, get used AWS secret name (not secret value)
|
||||
aws kafka list-scram-secrets --cluster-arn <cluster-arn>
|
||||
```
|
||||
|
||||
### Kafka IAM Access (in serverless)
|
||||
|
||||
### Kafka IAM-Zugriff (in serverless)
|
||||
```bash
|
||||
# Guide from https://docs.aws.amazon.com/msk/latest/developerguide/create-serverless-cluster.html
|
||||
# Download Kafka
|
||||
@@ -75,7 +72,6 @@ kafka_2.12-2.8.1/bin/kafka-console-producer.sh --broker-list $BS --producer.conf
|
||||
# Read messages
|
||||
kafka_2.12-2.8.1/bin/kafka-console-consumer.sh --bootstrap-server $BS --consumer.config client.properties --topic msk-serverless-tutorial --from-beginning
|
||||
```
|
||||
|
||||
### Privesc
|
||||
|
||||
{{#ref}}
|
||||
@@ -90,14 +86,10 @@ kafka_2.12-2.8.1/bin/kafka-console-consumer.sh --bootstrap-server $BS --consumer
|
||||
|
||||
### Persistence
|
||||
|
||||
If you are going to **have access to the VPC** where a Provisioned Kafka is, you could **enable unauthorised access**, if **SASL/SCRAM authentication**, **read** the password from the secret, give some **other controlled user IAM permissions** (if IAM or serverless used) or persist with **certificates**.
|
||||
Wenn Sie **Zugriff auf das VPC** haben, in dem ein Provisioned Kafka ist, könnten Sie **unauthorisierten Zugriff aktivieren**, wenn **SASL/SCRAM-Authentifizierung**, **das Passwort** aus dem Geheimnis **lesen**, einigen **anderen kontrollierten Benutzern IAM-Berechtigungen** geben (wenn IAM oder serverlos verwendet wird) oder mit **Zertifikaten** persistieren.
|
||||
|
||||
## References
|
||||
|
||||
- [https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html](https://docs.aws.amazon.com/msk/latest/developerguide/what-is-msk.html)
|
||||
|
||||
{{#include ../../../banners/hacktricks-training.md}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user