mirror of
https://github.com/HackTricks-wiki/hacktricks-cloud.git
synced 2026-01-13 05:16:32 -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)** is 'n diens wat ten volle bestuur word, wat die ontwikkeling en uitvoering van toepassings wat stroomdata verwerk deur **Apache Kafka** fasiliteer. Beheer-vlak operasies, insluitend die skep, opdateer en verwyder van **clusters**, word deur Amazon MSK aangebied. Die diens laat die gebruik van Apache Kafka **data-vlak operasies** toe, wat data produksie en verbruik insluit. Dit werk op **oop-bron weergawes van Apache Kafka**, wat verseker dat dit versoenbaar is met bestaande toepassings, gereedskap en plugins van beide vennote en die **Apache Kafka-gemeenskap**, wat die behoefte aan veranderinge in die toepassingskode uitskakel.
|
||||
|
||||
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.
|
||||
Wat betroubaarheid betref, is Amazon MSK ontwerp om **outomaties algemene cluster-faal scenario's te detecteer en te herstel**, wat verseker dat produsent- en verbruiker-toepassings voortgaan met hul data skryf- en leesaktiwiteite met minimale onderbreking. Boonop poog dit om data replikasie prosesse te optimaliseer deur te probeer om die **berging van vervangde brokers te hergebruik**, wat die volume van data wat deur Apache Kafka gerepliseer moet word, minimaliseer.
|
||||
|
||||
### **Types**
|
||||
### **Tipes**
|
||||
|
||||
There are 2 types of Kafka clusters that AWS allows to create: Provisioned and Serverless.
|
||||
Daar is 2 tipes Kafka-clusters wat AWS toelaat om te skep: Provisioned en Serverless.
|
||||
|
||||
From the point of view of an attacker you need to know that:
|
||||
Van die oogpunt van 'n aanvaller moet jy weet dat:
|
||||
|
||||
- **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
|
||||
- **Serverless kan nie direk publiek wees nie** (dit kan slegs in 'n VPN loop sonder enige publiek blootgestelde IP). egter, **Provisioned** kan gekonfigureer word om 'n **publieke IP** te kry (standaard doen dit nie) en die **veiligheidsgroep** te konfigureer om die relevante poorte te **bloot te stel**.
|
||||
- **Serverless** **ondersteun slegs IAM** as autentikasie metode. **Provisioned** ondersteun SASL/SCRAM (**wagwoord**) autentikasie, **IAM** autentikasie, AWS **Certificate** Manager (ACM) autentikasie en **Onautentiseerde** toegang.
|
||||
- Let daarop dat dit nie moontlik is om 'n Provisioned Kafka publiek bloot te stel as onaudentiseerde toegang geaktiveer is nie.
|
||||
|
||||
### 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 Toegang (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**.
|
||||
As jy **toegang tot die VPC** waar 'n Provisioned Kafka is, gaan hê, kan jy **ongemagtigde toegang** **aktiveer**, as **SASL/SCRAM-sertifisering**, **lees** die wagwoord uit die geheim, gee 'n paar **ander beheerde gebruiker IAM-toestemmings** (as IAM of serverless gebruik word) of volhard met **sertifikate**.
|
||||
|
||||
## 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