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,85 +4,73 @@
## CodeBuild
For more information, check:
Per ulteriori informazioni, controlla:
{{#ref}}
../../aws-services/aws-codebuild-enum.md
{{#endref}}
### Check Secrets
### Controlla i Segreti
If credentials have been set in Codebuild to connect to Github, Gitlab or Bitbucket in the form of personal tokens, passwords or OAuth token access, these **credentials are going to be stored as secrets in the secret manager**.\
Therefore, if you have access to read the secret manager you will be able to get these secrets and pivot to the connected platform.
Se le credenziali sono state impostate in Codebuild per connettersi a Github, Gitlab o Bitbucket sotto forma di token personali, password o token di accesso OAuth, queste **credenziali verranno memorizzate come segreti nel gestore dei segreti**.\
Pertanto, se hai accesso per leggere il gestore dei segreti, sarai in grado di ottenere questi segreti e passare alla piattaforma connessa.
{{#ref}}
../../aws-privilege-escalation/aws-secrets-manager-privesc.md
{{#endref}}
### Abuse CodeBuild Repo Access
### Abuso dell'Accesso al Repo di CodeBuild
In order to configure **CodeBuild**, it will need **access to the code repo** that it's going to be using. Several platforms could be hosting this code:
Per configurare **CodeBuild**, avrà bisogno di **accesso al repo di codice** che utilizzerà. Diverse piattaforme potrebbero ospitare questo codice:
<figure><img src="../../../../images/image (96).png" alt=""><figcaption></figcaption></figure>
The **CodeBuild project must have access** to the configured source provider, either via **IAM role** of with a github/bitbucket **token or OAuth access**.
Il **progetto CodeBuild deve avere accesso** al provider di origine configurato, sia tramite **ruolo IAM** che con un **token github/bitbucket o accesso OAuth**.
An attacker with **elevated permissions in over a CodeBuild** could abuse this configured access to leak the code of the configured repo and others where the set creds have access.\
In order to do this, an attacker would just need to **change the repository URL to each repo the config credentials have access** (note that the aws web will list all of them for you):
Un attaccante con **permessi elevati su un CodeBuild** potrebbe abusare di questo accesso configurato per leakare il codice del repo configurato e di altri a cui le credenziali impostate hanno accesso.\
Per fare ciò, un attaccante dovrebbe semplicemente **cambiare l'URL del repository a ciascun repo a cui le credenziali di configurazione hanno accesso** (nota che il web di aws elencherà tutti per te):
<figure><img src="../../../../images/image (107).png" alt=""><figcaption></figcaption></figure>
And **change the Buildspec commands to exfiltrate each repo**.
E **cambiare i comandi Buildspec per esfiltrare ciascun repo**.
> [!WARNING]
> However, this **task is repetitive and tedious** and if a github token was configured with **write permissions**, an attacker **won't be able to (ab)use those permissions** as he doesn't have access to the token.\
> Or does he? Check the next section
> Tuttavia, questo **compito è ripetitivo e noioso** e se un token github è stato configurato con **permessi di scrittura**, un attaccante **non sarà in grado di (ab)usare quei permessi** poiché non ha accesso al token.\
> O sì? Controlla la sezione successiva
### Leaking Access Tokens from AWS CodeBuild
You can leak access given in CodeBuild to platforms like Github. Check if any access to external platforms was given with:
### Leakare Token di Accesso da AWS CodeBuild
Puoi leakare l'accesso dato in CodeBuild a piattaforme come Github. Controlla se è stato dato accesso a piattaforme esterne con:
```bash
aws codebuild list-source-credentials
```
{{#ref}}
aws-codebuild-token-leakage.md
{{#endref}}
### `codebuild:DeleteProject`
An attacker could delete an entire CodeBuild project, causing loss of project configuration and impacting applications relying on the project.
Un attaccante potrebbe eliminare un intero progetto CodeBuild, causando la perdita della configurazione del progetto e influenzando le applicazioni che dipendono dal progetto.
```bash
aws codebuild delete-project --name <value>
```
**Potential Impact**: Loss of project configuration and service disruption for applications using the deleted project.
**Impatto Potenziale**: Perdita della configurazione del progetto e interruzione del servizio per le applicazioni che utilizzano il progetto eliminato.
### `codebuild:TagResource` , `codebuild:UntagResource`
An attacker could add, modify, or remove tags from CodeBuild resources, disrupting your organization's cost allocation, resource tracking, and access control policies based on tags.
Un attaccante potrebbe aggiungere, modificare o rimuovere tag dalle risorse di CodeBuild, interrompendo l'allocazione dei costi della tua organizzazione, il tracciamento delle risorse e le politiche di controllo degli accessi basate sui tag.
```bash
aws codebuild tag-resource --resource-arn <value> --tags <value>
aws codebuild untag-resource --resource-arn <value> --tag-keys <value>
```
**Potential Impact**: Disruption of cost allocation, resource tracking, and tag-based access control policies.
**Impatto Potenziale**: Interruzione dell'allocazione dei costi, tracciamento delle risorse e politiche di controllo degli accessi basate sui tag.
### `codebuild:DeleteSourceCredentials`
An attacker could delete source credentials for a Git repository, impacting the normal functioning of applications relying on the repository.
Un attaccante potrebbe eliminare le credenziali di origine per un repository Git, influenzando il normale funzionamento delle applicazioni che dipendono dal repository.
```sql
aws codebuild delete-source-credentials --arn <value>
```
**Potential Impact**: Disruption of normal functioning for applications relying on the affected repository due to the removal of source credentials.
**Impatto Potenziale**: Interruzione del normale funzionamento delle applicazioni che dipendono dal repository interessato a causa della rimozione delle credenziali sorgente.
{{#include ../../../../banners/hacktricks-training.md}}