Cloud Penetration Testing: Complete Guide to AWS, Azure and GCP Security Testing
Cloud penetration testing for AWS, Azure, and GCP: the 6-phase methodology, IAM analysis, chained attack paths, and tools — with a worked lab example.
What Is Cloud Penetration Testing?
Cloud penetration testing is an authorized security assessment of the customer-controlled layer of a public cloud environment — AWS, Azure, GCP, or multi-cloud — that finds and exploits misconfigurations, identity vulnerabilities, data exposure, and privilege-escalation paths before an attacker does.
A cloud penetration test does not attack the provider's own infrastructure. It tests what the customer controls: IAM policies, storage permissions, security groups, encryption settings, serverless functions, and cloud-hosted applications. The tester proves real impact by chaining findings into a working attack path — for example, showing that a public storage bucket leads to a leaked credential that leads to an admin role — and then reports each finding with reproduction steps and a fix.
Cloud Penetration Testing vs Traditional Penetration Testing
Traditional penetration testing assumes a defined perimeter, IP ranges you can scan, and infrastructure you fully control. Cloud environments break all three assumptions, and four differences shape the methodology:
| Difference | Traditional testing | Cloud testing |
|---|---|---|
| Perimeter | A fixed network boundary with firewalls at the edge | No fixed perimeter — resources are reachable by API from anywhere |
| Target list | IP ranges and hosts you can enumerate by scanning | Accounts, subscriptions, projects, and services across regions |
| Control plane | You own the servers, switches, and firewalls | The provider owns the infrastructure; you own the configuration |
| Top findings | Software vulnerabilities and missing patches | Misconfigurations and over-permissioned identities |
Identity is the new perimeter. In cloud environments, most successful attacks are not exploits against software — they are the abuse of over-permissioned identities. A role with one permission too many, or a trust policy that lets the wrong principal assume it, is the cloud equivalent of an open port.
The infrastructure is API-driven. Every resource is created, modified, and destroyed through APIs, which means the tester works through the provider's CLI and APIs as much as through the network. Resources are ephemeral. A vulnerable instance can be replaced in minutes, so findings must be recorded with the account, region, and resource name, not just an IP address that may not exist tomorrow.
The Shared Responsibility Model
The shared responsibility model divides cloud security between the provider and the customer. Understanding the line is the first step of any cloud test, because the test only ever targets the customer's side of it.
| Layer | Who secures it | Examples |
|---|---|---|
| Provider infrastructure | AWS / Azure / GCP | Data centres, physical network, hypervisor, managed-service internals |
| Customer configuration | You (the account owner) | IAM policies and roles, storage permissions, security groups, encryption settings |
| Customer data and applications | You | Application code, secrets, database contents, access control in your apps |
AWS, Azure, and GCP all publish their version of this model, and the wording differs, but the line is in the same place: the provider secures the infrastructure it operates, and the customer secures everything they configure. A penetration test targets the customer side — IAM, storage, network configuration, and applications — never the provider's core infrastructure.
Do You Need Permission to Pentest the Cloud?
Yes — twice over. You need written authorization from the owner of the cloud account being tested, and you must work inside the provider's rules of engagement. Testing an account you do not own, testing the provider's own infrastructure, or simulating a denial-of-service attack without approval is not permitted and can get the account suspended.
| Provider | Permission rule for testing your own accounts |
|---|---|
| AWS | No prior authorization from Amazon is needed for most testing inside your own accounts. Activities such as DDoS simulation, or testing from AWS infrastructure against third-party targets, still need a formal request. |
| Azure | Testing follows Microsoft's unified rules of engagement. DDoS simulation is prohibited on customer resources. Read the current policy before you start. |
| GCP | Google has its own testing policy for its cloud platform. Read the current policy and stay inside customer-managed assets. |
Three hard rules apply on every provider:
Provider policies change, so check the current policy on the provider's own site before every engagement. The rules above describe the position as of this guide's writing, not a substitute for the policy itself.
Cloud Penetration Testing Methodology in 6 Phases
A cloud penetration test follows the same arc as any penetration test, from scoping through reporting, but every phase is adapted to the control plane. The phases below map to the seven sections of the Penetration Testing Execution Standard (PTES): pre-engagement, intelligence gathering, threat modeling, vulnerability analysis, exploitation, post-exploitation, and reporting.
The rest of this guide walks through each phase, then shows a worked example of a chained attack path in a lab account.
Phase 1: Scoping and Rules of Engagement
Everything begins with defining exactly what will be tested and confirming you are permitted to test it.
Scope tightly to customer-managed assets. Prioritize IAM and chained misconfigurations over isolated host bugs, and follow the provider's rules of engagement to the letter. A test that drifts into provider infrastructure or into accounts outside the written scope is not a thorough test — it is an unauthorized one.
Phase 2: Reconnaissance and Asset Discovery
The tester builds an inventory of compute, storage, network, identity, and serverless resources across every region and account in scope, using provider APIs and open-source enumeration tools.
# AWS: who am I, and what is in this account?
aws sts get-caller-identity
aws s3 ls
aws ec2 describe-instances --query 'Reservations[].Instances[].InstanceId'
# Azure: which subscription and resources?
az account show
az resource list --output table
# GCP: which project and resources?
gcloud projects list
gcloud compute instances list
Automated enumeration tools give fast coverage:
| Tool | What it enumerates |
|---|---|
| ScoutSuite | Multi-cloud misconfigurations across AWS, Azure, and GCP |
| Prowler | AWS (and Azure/GCP) security checks against CIS Benchmarks |
| Steampipe | Cloud resources queried with SQL across providers |
| CloudMapper | AWS environment visualization and network mapping |
External footprinting matters too: subdomains and exposed services that point at cloud resources are found with the same tools used in any reconnaissance phase, such as Amass and theHarvester. Validate everything manually — automated tools reliably surface misconfigurations, but they miss context and they do not chain findings together.
Phase 3: Configuration Review Against CIS Benchmarks
The tester compares the environment against the CIS Benchmarks for AWS, Azure, and Google Cloud, and against the provider's own hardening guidance. Five checks find most of the configuration problems in a typical account:
| Check | What to look for | How to check |
|---|---|---|
| Public storage | S3 buckets or Blob containers readable by anyone | aws s3 ls s3://EXAMPLE-BUCKET --no-sign-request — if it lists objects, the bucket is public |
| Open management ports | Security groups or NSGs allowing 0.0.0.0/0 to SSH/RDP | Review security group rules in the console or with ScoutSuite/Prowler |
| Logging disabled | CloudTrail, Azure Activity Log, or Cloud Audit Logs off | Check the logging service status in each region — logging is often off in one region while on in another |
| Root account without MFA | The root user has no multi-factor authentication | IAM credential report, or the provider's security dashboard |
| Unencrypted databases | RDS, Azure SQL, or Cloud SQL without encryption at rest | Check the database encryption setting in the console |
Run the benchmark checks in every region, not just the one the team remembers using. Resources outside the tested region are a classic blind spot — a forgotten bucket in an unused region is still a public bucket.
Phase 4: IAM and Privilege Analysis
This is the heart of cloud penetration testing, and where the highest-severity findings almost always emerge. Map all IAM policies, roles, trust relationships, and permission boundaries, then identify privilege-escalation paths.
# AWS: which policies and roles exist, and who can assume them?
aws iam list-roles
aws iam list-attached-role-policies --role-name EXAMPLE-ROLE
aws iam get-role --role-name EXAMPLE-ROLE
Tools that do the heavy lifting:
| Tool | What it does |
|---|---|
| Pacu (AWS) | Exploitation framework for AWS — enumerates permissions and tests escalation paths |
| PMapper | Maps IAM privilege-escalation paths in an AWS account |
| Cloudsplaining | Finds overly permissive IAM policies and explains the risk in plain language |
| IAM policy simulators | Test what a given identity is actually allowed to do before you try it |
The questions to answer for every identity: what can this role do, who can assume it, and what happens if the permissions chain — can a low-privilege user reach a role that can read secrets, modify infrastructure, or assume an admin role? A trust policy that lets the wrong principal assume a role is often the single finding that turns a minor misconfiguration into full account compromise.
Worked Example: From a Public Bucket to Admin Access
Lab exercise — your own test AWS account only. This example chains three small findings into one working attack path, the way a real engagement does. Every name, key, and account ID below is a placeholder.
Step 1: Reconnaissance finds a public bucket
During asset discovery, a bucket listing works without any credentials:
aws s3 ls s3://EXAMPLE-BUCKET --no-sign-request
2026-01-12 10:04:11 342 app-config.json
2026-01-12 10:04:11 128 deploy-notes.txt
(illustrative output)
A bucket that lists its contents to an unauthenticated caller is the first finding: public read access on storage that was assumed private.
Step 2: A file inside the bucket leaks credentials
One of the files contains credentials for a deployment user:
aws s3 cp s3://EXAMPLE-BUCKET/app-config.json ./ --no-sign-request
{
"db_user": "app_reader",
"aws_access_key_id": "AKIAIOSFODNN7EXAMPLE",
"aws_secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
(illustrative output)
The access key ID shown here is the standard example key from AWS documentation — never a real key. In a real engagement the tester would use the leaked credentials only inside the authorized scope, and report the leak immediately.
Step 3: The leaked identity can assume a powerful role
Checking the identity and its trust relationships:
aws sts get-caller-identity
aws iam get-role --role-name EXAMPLE-ROLE
{
"UserId": "AIDACKCEVSQ6C2EXAMPLE",
"Account": "111122223333",
"Arn": "arn:aws:iam::111122223333:user/deploy-user"
}
(illustrative output)
The deploy user's role has a trust policy that allows it to assume an admin role in the same account — the second finding, and the one that makes the chain dangerous.
Step 4: Assume the role and prove impact
aws sts assume-role --role-arn arn:aws:iam::111122223333:role/EXAMPLE-ROLE --role-session-name pentest-lab
{
"Credentials": {
"AccessKeyId": "ASIAIOSFODNN7EXAMPLE",
"SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
"SessionToken": "FQoGZXIvYXdzEBYaD...",
"Expiration": "2026-11-14T12:00:00Z"
}
}
(illustrative output)
With the assumed role's credentials, the tester lists a sensitive object to prove impact — and stops there. The point of the exercise is the proof, not the data: a public bucket plus a leaked key plus a broad trust policy equals full account access. Three findings that look minor in isolation chain into the highest-severity outcome in the report.
Phase 5: Network and Compute Assessment
Review security groups, network ACLs, VPC peering configurations, and exposed services. The checks are short, but they catch the exposures that configuration reviews miss:
nmap -sV -p 22,80,443,3306,5432 example.com
A security group is not a firewall rule you set once and forget. Review it in every region, and treat any 0.0.0.0/0 rule on a management port as a finding until someone proves it is intentional and compensated.
Data Exposure Testing
Storage and secrets are where cloud data actually leaks. Test each of these in your own account:
Test safely: list and describe, do not download data you do not need, and never use a finding to access data outside the written scope. The finding is the exposure; the proof is one object listed, not a dataset copied.
Serverless and Container Testing
Serverless functions and containers have their own attack surface, and it is easy to miss because there is no server to scan.
Serverless (Lambda, Azure Functions, Cloud Functions):
Containers and registries:
Two or three checks per area is enough for a first pass. The goal is to show whether the serverless and container layers were considered at all — in many accounts, they were not.
Cloud Penetration Testing Tools
Tooling supports the methodology; it does not replace analyst judgement.
| Tool | What it does | When to use it |
|---|---|---|
| ScoutSuite | Multi-cloud misconfiguration audit (AWS, Azure, GCP) | First-pass baseline of an account |
| Prowler | Security checks against CIS Benchmarks | Configuration review against a known baseline |
| Steampipe | Query cloud resources with SQL | Ad-hoc inventory questions across providers |
| CloudMapper | AWS environment visualization | Understanding network paths and trust relationships |
| Pacu | AWS exploitation framework | Testing privilege-escalation paths after enumeration |
| PMapper | IAM privilege-escalation mapping | Finding how a low-privilege identity reaches admin |
| Cloudsplaining | IAM policy risk analysis | Explaining which policies are overly permissive |
| MicroBurst | Azure exploitation scripts | Azure-specific attack paths |
| ROADtools | Azure AD enumeration and analysis | Mapping Azure AD trust and permissions |
| Provider CLIs (aws, az, gcloud) | Direct API access to everything | Every phase — the authoritative source |
| Nmap | Network and service scanning | Network and compute assessment from an authorized host |
| Amass / theHarvester | External footprinting | Reconnaissance of domains and exposed services |
Automated tools reliably surface misconfigurations, but they do not chain findings together. The critical caveat in every tool report is the same: the tool found the pieces; the analyst proved the attack path.
Mapping Findings to MITRE ATT&CK for Cloud
The MITRE ATT&CK Cloud Matrix maps adversary techniques across IaaS, SaaS, identity providers, and office suites — and it reads very differently from the network matrix, because the techniques are about identity and APIs rather than hosts and ports.
Map each validated finding to a technique, and suggest the detection that would have caught it:
| Technique | What the tester did | Detection to suggest |
|---|---|---|
| Valid Accounts (Cloud Accounts) | Used a leaked access key from a public bucket | Alert on access-key use from a new source or outside expected hours |
| Permission Groups Discovery | Listed roles and policies with the leaked identity | Alert on broad IAM enumeration calls |
| Assume Role / Trust abuse | Assumed an admin role through a broad trust policy | Alert on role assumption by an unexpected principal |
| Data from Cloud Storage | Listed objects in a public bucket | Alert on public bucket policy changes and anonymous access |
| Impair Defenses | Found logging disabled in one region | Alert on CloudTrail or audit-log configuration changes |
Mapping findings to ATT&CK turns a list of bugs into a story about how an attacker would move through the environment — and gives the defense team concrete detections to build, not just patches to apply.
Reporting and Scoring Findings
A cloud penetration test report has one job: make each finding fixable by the person who owns it.
Report structure:
Scoring: use CVSS v3.1 to score each finding, but prioritize by business impact alongside the score — a medium finding on a production database outranks a high finding on a disposable test resource. Use the CISA Known Exploited Vulnerabilities catalog and the asset's actual exposure when ranking.
Remediation verification is a follow-up step, not an afterthought. After the team fixes a finding, re-test it: re-run the check that found it, confirm the fix holds, and record the verification. A fix that was never verified is a finding that may still be open.
Cloud Penetration Testing Cheat Sheet
| Phase | Checks | Tools / commands |
|---|---|---|
| Scoping | Accounts, regions, services in scope; black/gray/white box; written authorization | Scope document, provider ROE |
| Reconnaissance | Inventory compute, storage, network, identity, serverless in every region | aws sts get-caller-identity, az account show, gcloud projects list, ScoutSuite, Steampipe |
| Configuration review | Public storage, open management ports, logging off, root without MFA, unencrypted databases | Prowler, ScoutSuite, CIS Benchmarks |
| IAM analysis | Policies, roles, trust relationships, permission boundaries, escalation paths | Pacu, PMapper, Cloudsplaining, aws iam list-roles |
| Network and compute | Security groups, NACLs, VPC peering, exposed services | nmap -sV, security group review |
| Data exposure | Public buckets/blobs, secrets in code, database exposure, snapshot sharing | aws s3 ls --no-sign-request, repo scanning |
| Serverless and containers | Function roles, event injection, image vulnerabilities, exposed runtimes | Registry scanning, function role review |
| Exploitation | Chain findings into a working attack path; prove impact; stop at proof | Pacu, MicroBurst, provider CLIs |
| Reporting | CVSS scoring, reproduction steps, owner, remediation verification | Report template, ATT&CK mapping |
| Provider rules | Written authorization, customer assets only, never DDoS | Provider policy pages |
Troubleshooting and Common Mistakes
| Problem | Cause | Fix |
|---|---|---|
| Testing without written authorization | Scope was agreed verbally or assumed | Stop, get signed authorization with the scope attached, then restart |
| Scope creep into provider infrastructure | The tester followed an interesting finding outside customer assets | Define customer-managed assets in the scope document and stay inside them |
| Treating a scanner report as a pentest | Automated output was handed over as findings | Validate every finding and chain them into a proven attack path |
| Gray-box credentials with no permissions | The starting identity cannot enumerate anything | Agree the starting identity's permissions in scoping, or test black-box instead |
| Findings that do not chain | Each issue reported alone with no proven impact | Re-run the phases with chaining in mind: what does this finding unlock next? |
| Forgetting regions | Checks ran in one region only | Run inventory and benchmark checks in every region in scope |
| Trusting a single tool's output | One tool's result treated as the truth | Cross-check with the provider CLI and a second tool before reporting |
| Skipping remediation verification | The report was delivered and the fixes never re-tested | Schedule a verification pass and re-run the exact check that found each issue |
Keep Learning
Summary
Cloud penetration testing is a structured assessment of the customer-controlled layer of a cloud environment. Identity is the perimeter, misconfigurations chain into real attack paths, and the highest-severity findings almost always come from IAM — not from software exploits. The methodology is six phases: scope with written authorization, discover every asset in every region, review configuration against the CIS Benchmarks, analyze IAM for escalation paths, prove impact by chaining findings, and report with CVSS scoring and remediation verification. Start with permission, test only what you are authorized to test, and verify every fix. The cloud rewards the tester who thinks in identities and APIs, not in IP addresses.
Knowledge Check
Answers: 1. The customer secures their configuration, IAM policies, storage permissions, encryption settings, and application security — the provider secures the infrastructure it operates; 2. No prior authorization from Amazon is needed for most testing in your own accounts, but DDoS simulation and testing third-party targets still need a formal request — and written authorization from the account owner is always required; 3. Black box starts with no credentials, gray box with limited credentials simulating a compromised user, white box with full read access and documentation; 4. Because most cloud attacks abuse over-permissioned identities and trust relationships rather than software exploits; 5. The CIS Benchmarks for AWS, Azure, and Google Cloud; 6. A scan lists automated findings, while a pentest validates them and chains them into a proven attack path with evidence; 7. It turns a list of bugs into an attack story and gives the defense team concrete detections to build; 8. Re-testing each fix after remediation to confirm it actually works — a fix that was never verified may still be open.
Frequently Asked Questions
Continue Learning
Ethical Hacking Fundamentals: Principles, Methodology, and Best Practices
Learn the core principles of ethical hacking, the five-phase penetration testing methodology, types of security testing, and how to build your own hacking lab.
Ethical Hacking · IntermediateWindows Privilege Escalation Cheat Sheet: How to Escalate Privileges in Windows
Windows privilege escalation cheat sheet: WinPEAS, unquoted service paths, AlwaysInstallElevated and Potato attacks — with a worked lab example.
Ethical Hacking · IntermediateDocker Security Best Practices: How to Secure Docker Containers and Images
Secure your Docker containers step by step: hardened images, Trivy scanning, secrets, runtime limits and daemon hardening — with a worked Flask example.
Ethical Hacking · IntermediateLinux Privilege Escalation: Complete Guide from Enumeration to Root
Linux privilege escalation from enumeration to root: LinPEAS, SUID, sudo, capabilities, cron and kernel checks — with a worked lab example and cheat sheet.
Related Security Tools
Wifite
Learn how to use Wifite in Kali Linux with this beginner tutorial: check your WiFi adapter, install Wifite, run your first authorized WiFi audit, capture WPA handshakes and PMKIDs, and crack them with a wordlist. Includes Wifite commands, a worked example, troubleshooting for common errors, and how Wifite compares with Aircrack-ng.
Information GatheringAmass
OWASP Amass is the industry-standard in-depth network mapping and attack surface discovery tool. It uses active and passive techniques, scraping 20+ public data feeds, DNS enumeration, and certificate transparency logs to discover subdomains, IP addresses, and ASN data — making it essential for penetration testing, bug bounty hunting, and enterprise security assessments.
Post ExploitationBloodHound
BloodHound uses graph theory to reveal the hidden and often unintended relationships within an Active Directory or Azure environment, allowing attackers or defenders to identify complex attack paths.
Stress Testinghping3
hping3 is a command-line network tool for crafting, sending, and analyzing custom TCP/IP packets. Built for firewall testing, port scanning, OS fingerprinting, path MTU discovery, and authorized stress testing, it gives you control over nearly every field of the TCP, UDP, ICMP, and raw IP headers — the flags, sequence numbers, window size, TTL, fragmentation, and payload — and then shows you exactly how the target answers. Where Nmap runs predefined scan types, hping3 is the packet workbench you reach for when the question is "what does the firewall do with THIS exact packet?" It runs on raw sockets (so it needs root), supports scan and listen modes, and includes a Tcl scripting engine for automating protocol experiments in a lab.