Cloud Security Fundamentals
The cloud changes the pentest rules: there’s no physical perimeter or servers to scan, but APIs, identities, and permissions. The central asset is no longer “root on a machine” but a set of credentials with certain permissions (IAM). Understanding the shared responsibility model, how authentication and authorization work, and where the typical flaws are is the basis of the whole Cloud area. This card is the map: the vectors, the cross-provider equivalences, and which specific card to jump to in each case.
Threat model
Section titled “Threat model”In the cloud, the attacker almost never exploits a 0-day in the provider’s infrastructure: they abuse what the customer misconfigures. The goal is to obtain an identity (some credentials), figure out what it allows, and chain legitimate permissions up to account control. The assets at stake:
- Identities and credentials: access keys, tokens, service accounts, managed identities. Their leakage is the number-one vector.
- Data in public resources: buckets, snapshots, databases, and backups exposed without authentication.
- Excessive permissions (IAM): an identity with more permissions than needed equals an admin password.
- Control plane (API): everything goes through the provider’s APIs; whoever controls credentials with permissions controls resources.
Shared responsibility
Section titled “Shared responsibility”The provider (AWS/Azure/GCP) secures the infrastructure (“security of the cloud”); you secure what you put inside (“security in the cloud”): configuration, IAM, data, code. Almost every cloud breach is the customer’s fault: public buckets, lax IAM, leaked credentials, misconfigured services. Cloud pentesting focuses there.
flowchart TB
subgraph Provider["Provider (security OF the cloud)"]
HW[Hardware, physical network, hypervisor, regions]
end
subgraph Customer["Customer (security IN the cloud)"]
IAM[IAM and credentials]
DATA[Data and encryption]
CFG[Service configuration]
CODE[App/function code]
end
HW --> Customer
IAM --> Breaches[Almost every cloud breach]
DATA --> Breaches
CFG --> Breaches
CODE --> Breaches
The paradigm shift
Section titled “The paradigm shift”Identity is the new perimeter. What on-premise was “root on a server” is in the cloud “IAM credentials with permissions”. The mental mappings:
- Network perimeter → identity is the perimeter.
- Root on a server → IAM credentials with permissions.
- Scanning ports → enumerating APIs and permissions.
- Service exploit → permission abuse or misconfiguration.
- Firewall → security groups and IAM policies.
Cross-provider equivalences
Section titled “Cross-provider equivalences”The big three solve the same problems with different names. Knowing how to translate speeds up recon:
- Identity: IAM User/Role (AWS) · Entra ID / Managed Identity (Azure) · IAM / Service Account (GCP).
- Compute: EC2 · Virtual Machine · Compute Engine.
- Storage: S3 · Blob Storage · Cloud Storage.
- Serverless: Lambda · Functions · Cloud Functions / Cloud Run.
- Metadata:
169.254.169.254(AWS and Azure) ·metadata.google.internal(GCP, resolves to the same IP). - Logging: CloudTrail · Activity Log · Cloud Audit Logs.
Red Team
Section titled “Red Team”The general flow of an authorized cloud assessment, with the specific card for each step:
# 1) Recon: identify provider and exposed assets (see cloud-recon)dig CNAME target.com # *.amazonaws.com, *.azurewebsites.net...curl -sI https://target.com | grep -iE 'amz|azure|goog|cloudfront'
# 2) Hunt for leaked credentials (vector #1)trufflehog github --repo https://github.com/org/repo
# 3) With credentials: who am I and what can I do?aws sts get-caller-identityaz account showgcloud auth listEntry vectors, by frequency and impact:
- Leaked credentials (GitHub,
.env, logs, dumps) → direct access (see Source Code OSINT). - Public resources (buckets, snapshots, DBs) → data leak (see Buckets and Public Storage).
- SSRF → metadata service → instance credentials (see Metadata Service (IMDS)).
- Misconfigured IAM → privilege escalation (see IAM Abuse and Privilege Escalation).
- Misconfigured services: serverless, containers, Kubernetes (see Kubernetes Pentesting).
Reference real case: Capital One (2019) chained an SSRF in a misconfigured WAF to the IMDSv1 of an EC2 instance, stole the role’s temporary credentials, and exfiltrated data of ~100 million customers from S3. It’s the textbook SSRF→IMDS→S3 chain.
Blue Team
Section titled “Blue Team”- Least privilege in IAM: no wildcards (
*), scoped roles, periodic review with access analyzers. - No static credentials: use managed roles/identities, rotation, secrets in managers (Secrets Manager / Key Vault / Secret Manager).
- Block public access by default (buckets, DBs); encryption at rest and in transit.
- IMDSv2 mandatory on AWS (mitigates SSRF→metadata), hop limit set to 1.
- Logging enabled and monitored: CloudTrail / Activity Log / Audit Logs; detection with GuardDuty / Defender for Cloud / Security Command Center.
- CSPM (Cloud Security Posture Management) to detect misconfigurations continuously (Prowler, ScoutSuite, Steampipe).
Checklist
Section titled “Checklist”- Understand the shared responsibility model of the service under assessment
- Identify the provider and services in use (Cloud Reconnaissance)
- Hunt for leaked credentials (Source Code OSINT,
.env, logs) - Enumerate IAM and look for escalation (IAM Abuse and Privilege Escalation)
- Exposed public resources (Buckets and Public Storage)
- SSRF toward the metadata service (Metadata Service (IMDS))
- Automated audit (ScoutSuite / Prowler)
- Map the path to maximum privilege