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

This commit is contained in:
Translator
2024-12-31 20:18:58 +00:00
parent 820dd99aed
commit 931ae54e5f
245 changed files with 9984 additions and 12710 deletions

View File

@@ -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)** è un servizio completamente gestito, che facilita lo sviluppo e l'esecuzione di applicazioni che elaborano dati in streaming tramite **Apache Kafka**. Le operazioni del piano di controllo, inclusa la creazione, l'aggiornamento e la cancellazione di **cluster**, sono offerte da Amazon MSK. Il servizio consente l'utilizzo delle operazioni del piano dati di Apache Kafka, comprendenti la produzione e il consumo di dati. Funziona su **versioni open-source di Apache Kafka**, garantendo compatibilità con applicazioni, strumenti e plugin esistenti sia da parte dei partner che della **comunità Apache Kafka**, eliminando la necessità di modifiche nel codice dell'applicazione.
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 termini di affidabilità, Amazon MSK è progettato per **rilevare automaticamente e recuperare da scenari di guasto del cluster prevalenti**, garantendo che le applicazioni di produttori e consumatori continuino le loro attività di scrittura e lettura dei dati con minime interruzioni. Inoltre, mira a ottimizzare i processi di replicazione dei dati cercando di **riutilizzare lo storage dei broker sostituiti**, riducendo così il volume di dati che deve essere replicato da Apache Kafka.
### **Types**
### **Tipi**
There are 2 types of Kafka clusters that AWS allows to create: Provisioned and Serverless.
Ci sono 2 tipi di cluster Kafka che AWS consente di creare: Provisioned e Serverless.
From the point of view of an attacker you need to know that:
Dal punto di vista di un attaccante, è necessario sapere che:
- **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 non può essere direttamente pubblico** (può funzionare solo in una VPN senza alcun IP esposto pubblicamente). Tuttavia, **Provisioned** può essere configurato per ottenere un **IP pubblico** (per impostazione predefinita non lo fa) e configurare il **gruppo di sicurezza** per **esporre** le porte rilevanti.
- **Serverless** **supporta solo IAM** come metodo di autenticazione. **Provisioned** supporta l'autenticazione SASL/SCRAM (**password**), l'autenticazione **IAM**, l'autenticazione del AWS **Certificate** Manager (ACM) e l'accesso **non autenticato**.
- Si noti che non è possibile esporre pubblicamente un Kafka Provisioned se l'accesso non autenticato è abilitato.
### 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)
### Accesso IAM Kafka (in serverless)
```bash
# Guide from https://docs.aws.amazon.com/msk/latest/developerguide/create-serverless-cluster.html
# Download Kafka
@@ -75,29 +72,24 @@ 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}}
../aws-privilege-escalation/aws-msk-privesc.md
{{#endref}}
### Unauthenticated Access
### Accesso non autenticato
{{#ref}}
../aws-unauthenticated-enum-access/aws-msk-unauthenticated-enum.md
{{#endref}}
### Persistence
### Persistenza
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**.
Se hai **accesso alla VPC** dove si trova un Kafka Provisioned, potresti **abilitare l'accesso non autorizzato**, se **l'autenticazione SASL/SCRAM**, **leggi** la password dal segreto, dare alcune **altre autorizzazioni IAM a un utente controllato** (se si utilizza IAM o serverless) o persistere con **certificati**.
## References
## Riferimenti
- [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}}