Translated ['.github/pull_request_template.md', 'src/pentesting-cloud/az

This commit is contained in:
Translator
2024-12-31 18:57:14 +00:00
parent 7770a50092
commit 77a009d308
244 changed files with 8632 additions and 11470 deletions

View File

@@ -4,25 +4,25 @@
## Cloud Functions <a href="#reviewing-cloud-functions" id="reviewing-cloud-functions"></a>
[Google Cloud Functions](https://cloud.google.com/functions/) are designed to host your code, which **gets executed in response to events**, without necessitating the management of a host operating system. Additionally, these functions support the storage of environment variables, which the code can utilize.
[Google Cloud Functions](https://cloud.google.com/functions/) sind dafür konzipiert, Ihren Code zu hosten, der **als Reaktion auf Ereignisse ausgeführt wird**, ohne dass die Verwaltung eines Host-Betriebssystems erforderlich ist. Darüber hinaus unterstützen diese Funktionen die Speicherung von Umgebungsvariablen, die der Code nutzen kann.
### Storage
The Cloud Functions **code is stored in GCP Storage**. Therefore, anyone with **read access over buckets** in GCP is going to be able to **read the Cloud Functions code**.\
The code is stored in a bucket like one of the following:
Der Cloud Functions **Code wird in GCP Storage gespeichert**. Daher kann jeder mit **Lesezugriff auf Buckets** in GCP den **Cloud Functions Code lesen**.\
Der Code wird in einem Bucket wie einem der folgenden gespeichert:
- `gcf-sources-<number>-<region>/<function-name>-<uuid>/version-<n>/function-source.zip`
- `gcf-v2-sources-<number>-<region>/<function-name>function-source.zip`
For example:\
Zum Beispiel:\
`gcf-sources-645468741258-us-central1/function-1-003dcbdf-32e1-430f-a5ff-785a6e238c76/version-4/function-source.zip`
> [!WARNING]
> Any user with **read privileges over the bucket** storing the Cloud Function could **read the executed code**.
> Jeder Benutzer mit **Leseprivilegien über den Bucket**, der die Cloud Function speichert, könnte **den ausgeführten Code lesen**.
### Artifact Registry
If the cloud function is configured so the executed Docker container is stored inside and Artifact Registry repo inside the project, anyway with read access over the repo will be able to download the image and check the source code. For more info check:
Wenn die Cloud-Funktion so konfiguriert ist, dass der ausgeführte Docker-Container in einem Artifact Registry-Repo innerhalb des Projekts gespeichert wird, kann jeder mit Lesezugriff auf das Repo das Image herunterladen und den Quellcode überprüfen. Für weitere Informationen siehe:
{{#ref}}
gcp-artifact-registry-enum.md
@@ -30,26 +30,25 @@ gcp-artifact-registry-enum.md
### SA
If not specified, by default the **App Engine Default Service Account** with **Editor permissions** over the project will be attached to the Cloud Function.
Wenn nicht angegeben, wird standardmäßig das **App Engine Standarddienstkonto** mit **Editor-Berechtigungen** über das Projekt an die Cloud Function angehängt.
### Triggers, URL & Authentication
When a Cloud Function is created the **trigger** needs to be specified. One common one is **HTTPS**, this will **create an URL where the function** can be triggered via web browsing.\
Other triggers are pub/sub, Storage, Filestore...
Wenn eine Cloud Function erstellt wird, muss der **Trigger** angegeben werden. Ein häufiger ist **HTTPS**, dies wird **eine URL erstellen, über die die Funktion** über das Web aufgerufen werden kann.\
Andere Trigger sind pub/sub, Storage, Filestore...
The URL format is **`https://<region>-<project-gcp-name>.cloudfunctions.net/<func_name>`**
Das URL-Format ist **`https://<region>-<project-gcp-name>.cloudfunctions.net/<func_name>`**
When the HTTPS tigger is used, it's also indicated if the **caller needs to have IAM authorization** to call the Function or if **everyone** can just call it:
Wenn der HTTPS-Trigger verwendet wird, wird auch angegeben, ob der **Aufrufer IAM-Berechtigungen benötigt**, um die Funktion aufzurufen, oder ob **jeder** sie einfach aufrufen kann:
<figure><img src="../../../images/image (19).png" alt=""><figcaption></figcaption></figure>
### Inside the Cloud Function
The code is **downloaded inside** the folder **`/workspace`** with the same file names as the ones the files have in the Cloud Function and is executed with the user `www-data`.\
The disk **isn't mounted as read-only.**
Der Code wird **im Ordner** **`/workspace`** mit denselben Dateinamen wie die Dateien in der Cloud Function heruntergeladen und wird mit dem Benutzer `www-data` ausgeführt.\
Die Festplatte **wird nicht als schreibgeschützt gemountet.**
### Enumeration
```bash
# List functions
gcloud functions list
@@ -74,39 +73,34 @@ curl -X POST https://<region>-<project>.cloudfunctions.net/<func_name> \
-H "Content-Type: application/json" \
-d '{}'
```
### Privilegieneskalation
### Privilege Escalation
In the following page, you can check how to **abuse cloud function permissions to escalate privileges**:
Auf der folgenden Seite können Sie überprüfen, wie Sie **Cloud-Funktionsberechtigungen missbrauchen, um Privilegien zu eskalieren**:
{{#ref}}
../gcp-privilege-escalation/gcp-cloudfunctions-privesc.md
{{#endref}}
### Unauthenticated Access
### Unauthentifizierter Zugriff
{{#ref}}
../gcp-unauthenticated-enum-and-access/gcp-cloud-functions-unauthenticated-enum.md
{{#endref}}
### Post Exploitation
### Nach der Ausnutzung
{{#ref}}
../gcp-post-exploitation/gcp-cloud-functions-post-exploitation.md
{{#endref}}
### Persistence
### Persistenz
{{#ref}}
../gcp-persistence/gcp-cloud-functions-persistence.md
{{#endref}}
## References
## Referenzen
- [https://about.gitlab.com/blog/2020/02/12/plundering-gcp-escalating-privileges-in-google-cloud-platform/#reviewing-stackdriver-logging](https://about.gitlab.com/blog/2020/02/12/plundering-gcp-escalating-privileges-in-google-cloud-platform/#reviewing-stackdriver-logging)
{{#include ../../../banners/hacktricks-training.md}}