You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/pentesting-cloud/pentesting-cloud-methodology.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,50 @@ Each cloud has its own peculiarities but in general there are a few **common thi
32
32
- For **integrations inside the cloud you are auditing** from external platforms, you should ask **who has access externally to (ab)use that integration** and check how is that data being used.\
33
33
For example, if a service is using a Docker image hosted in GCR, you should ask who has access to modify that and which sensitive info and access will get that image when executed inside an AWS cloud.
34
34
35
+
### Hunt autonomous data streams that write into globally-unique storage
36
+
37
+
A recurring **cross-cloud post-exploitation primitive** is to find **long-lived routers / sinks / subscriptions / replication jobs** that keep writing into a storage destination identified mainly by a **globally unique name**. If an attacker can **empty + delete** that destination and then **recreate the same name** in an attacker-controlled project/account/subscription, the upstream service may continue delivering data to the replacement destination **without modifying the router resource itself**.
38
+
39
+
This is interesting because it can **bypass the expected permission boundary**: the attacker might not have the permissions needed to update the router (for example `logging.sinks.update`, `pubsub.subscriptions.update` or similar), but a broad destructive storage permission such as `storage.buckets.delete`, `s3:DeleteBucket`, or `Microsoft.Storage/storageAccounts/delete` can still produce equivalent data redirection.
40
+
41
+
**Generic attack flow:**
42
+
43
+
1. Identify automated data streams that write to buckets / storage accounts and are expected to run unattended.
44
+
2. Verify whether the destination is referenced by **name** and whether that name is **reclaimable** after deletion.
45
+
3. Check if your current principal can delete the destination even if it cannot update the router resource.
46
+
4. Delete the destination, recreate the same globally-unique name under attacker control, and wait for the next log/message/object delivery cycle.
47
+
48
+
**Good targets to review:**
49
+
50
+
-**GCP**: Cloud Logging sinks to GCS, Pub/Sub Cloud Storage subscriptions, Storage Transfer Service jobs.
51
+
-**AWS**: S3 replication destinations, Firehose streams writing to S3, and any other service that continuously writes into an S3 bucket by name.
52
+
-**Azure**: Azure Monitor diagnostic settings writing to Storage Accounts, especially when deletion/recreation is possible inside the same tenant.
53
+
54
+
**Quick hunting checklist:**
55
+
56
+
```bash
57
+
# GCP: sinks, subscriptions and transfer jobs that may target GCS
# Azure: diagnostic settings pointing to storage accounts
67
+
az monitor diagnostic-settings list --resource <resource-id>
68
+
```
69
+
70
+
**What to report / detect:**
71
+
72
+
- Principals that can **delete storage destinations** but cannot formally update the associated router resource.
73
+
-**Dangling router resources** still pointing to deleted buckets / storage accounts.
74
+
- Sensitive log/export pipelines that can write to **external accounts/projects/subscriptions**.
75
+
- High-severity alerts on deletion of buckets / storage accounts that are referenced by sinks, subscriptions, replication rules, transfer jobs, Firehose streams, or diagnostic settings.
76
+
77
+
When a cloud environment heavily relies on autonomous exports for **logs, audit trails, backups, telemetry, or message archival**, this review should be part of the standard methodology because the impact is usually **silent long-term exfiltration** rather than immediate service breakage.
78
+
35
79
## Multi-Cloud tools
36
80
37
81
There are several tools that can be used to test different cloud environments. The installation steps and links are going to be indicated in this section.
-[The Global Namespace Risk: Universal Bucket Hijacking Technique for Cloud Data Exfiltration](https://unit42.paloaltonetworks.com/cloud-bucket-hijacking-risks/)
504
+
-[Cloud Logging routing and sinks](https://docs.cloud.google.com/logging/docs/export/configure_export_v2)
0 commit comments