// guides

Cloud Penetration Testing: AWS, Azure, and GCP

Cloud penetration testing methodology compared across AWS, Azure and GCP identity attack paths

Cloud penetration testing is an authorized attack simulation against your AWS accounts, Azure tenant, or GCP organization. Simulating an attacker, it steals or federates an identity, escalates through IAM, and proves which data is reachable. The three providers differ in testing policy, identity model, and escalation primitives, so a generic checklist or a CSPM export misses the paths into production.

The short answer

  • Cloud penetration testing is an authorized attack simulation that steals or federates identity, escalates IAM and proves which data is reachable.
  • AWS, Azure and GCP generally allow testing of your own resources without prior approval, but each has its own rules; all forbid DoS, provider infrastructure and other tenants.
  • Escalation primitives differ per cloud, so a generic checklist misses paths; cross-account trust, CI/CD OIDC and AI agent identities are the usual blind spots.
  • The deliverable is exploited paths with evidence, detection gaps and ranked fixes, not a CSPM export.

Key takeaways

  • Cloud penetration testing is an identity attack simulation. A CSPM export answers a different question.
  • AWS and Azure allow most customer-resource testing without prior approval. Google Cloud asks for notification or approval in many cases. Confirm the live policy and your contract on the day you scope.
  • The shared kill chain is credentials, enumeration, IAM escalation, trust pivot, data. PassRole plus compute, Azure role assignment and managed identity, and GCP service-account impersonation are the primitives that differ.
  • Cross-account role trust, B2B consent, domain-wide delegation, and OIDC federation for CI are in scope. Test them from outside the trust.
  • The report must show exploited paths, evidence, detection gaps, and a retest call that should fail. It supports SOC 2, ISO 27001, PCI DSS 4.0, and DORA evidence. It does not certify you.
  • Agent, RAG, and MCP identities use the same IAM analysis. Name them in the rules of engagement.

What is cloud penetration testing, and how is it different from CSPM?

Cloud penetration testing proves exploitability. CSPM reports deviations from a baseline. A posture tool tells you a role has iam:PassRole on *. A pentest shows that a leaked developer key can pass that role to a new Lambda, call kms:Decrypt on the production key, and read the customer table, with the API calls that did it.

The difference is the graph. Prowler and ScoutSuite score resources one at a time against CIS Benchmarks. Attackers chain findings: a medium issue in a sandbox account is the first hop into production. PMapper, AzureHound with BloodHound, and Cartography draw identities, permissions, and trust as edges. That graph is a hypothesis until a tester walks a path and keeps the evidence.

CSPM / config review Cloud pentest Cloud red team
Question answered What deviates from the baseline? What can an attacker reach, and how? Would we detect and stop a real operator?
Method API read of every resource Assumed credentials, path exploitation Objective-driven, stealthy, multi-vector
Output Findings list per resource Attack paths with evidence and fixes Narrative plus detection timeline
Cadence Continuous Periodic and after major change Once detection is mature
Main consumer Cloud platform team AppSec, platform, IAM owners SOC, CISO

Run them in that order. A cloud configuration review clears the noise. The pentest proves which paths matter. A red team justifies its cost only once detection is mature enough to measure.

Do you need AWS, Azure, or GCP permission before a cloud penetration testing engagement?

For resources you own, prior approval is often unnecessary, and each provider writes its own rules. Read the policy page on the day you sign the rules of engagement. Provider permission is not the same as owner authorization.

  • AWS. The AWS Customer Support Policy for Penetration Testing allows testing of customer-owned resources on a published service list without prior approval, under the Acceptable Use Policy. It prohibits DoS and DDoS, including simulated DoS, port and request flooding, and DNS zone walking against Route 53 hosted zones. The permitted list and any service exceptions change. Confirm both at test time. Other simulated events use a separate request.
  • Azure. Microsoft Cloud Penetration Testing Rules of Engagement allow most testing of customer-deployed resources without prior approval. DoS, other tenants’ data, phishing Microsoft staff, and probing Microsoft-managed infrastructure are forbidden. Some categories have required notification. Confirm the current rules before you test managed services.
  • Google Cloud. Google asks customers to notify Google or request approval for penetration tests in many cases, and to follow the Cloud Platform Acceptable Use Policy and Terms of Service. Testing Google’s own infrastructure, and load that resembles denial of service, is prohibited. Enterprise contracts sometimes add a notice step. Check the current guidance and your agreement before kickoff.

The signed authorization should name every AWS account ID, Azure subscription and tenant ID, and GCP project or folder, plus the credentials testers may use. Third-party SaaS in the tenant, including a managed database vendor, needs its own sign-off.

What stays on the provider’s side of the line

The shared responsibility line sets scope. The provider secures the hypervisor, physical plant, and managed-service internals. You secure identity, configuration, data, and workloads. Customer-side resources are testable. Provider infrastructure is not.

Testers can abuse your IAM policies through STS. They cannot fuzz STS itself. They can attack Lambda code and its execution role. They cannot try to leave the Firecracker microVM for AWS hosts. On EKS, AKS, and GKE, your node pools, workloads, and RBAC are yours. The managed control plane is not.

A bug that looks like a tenant-boundary cross is a stop. Document the observation and report it through the provider’s vulnerability disclosure program. Pushing further turns a finding into a terms-of-service problem.

Which privilege-escalation primitives differ across AWS, Azure, and GCP?

Identity is the primary attack surface because the control plane is an authenticated API. Every read, write, and pivot is an IAM decision. A role that can export a database does not need a network path to it.

The kill chain is the same on all three clouds, and the permissions are not:

  1. Credential acquisition. Keys in git, CI variables, or Terraform state; metadata tokens via SSRF; a phished SSO session; an OAuth consent grant.
  2. Enumeration. What can this principal do? If it cannot read its own policies, enumerate-iam brute-forces read-only calls. Steampipe, az, and gcloud fill gaps.
  3. Privilege escalation by writing identity or borrowing a stronger one.
  4. Trust exploitation: role assumption, service-account impersonation, cross-tenant access.
  5. Data reachability: object storage, KMS and Key Vault, secrets stores, databases.
  6. Persistence, only with written approval, then removed: new keys, federated trust, app-registration secrets.

Security groups, NSGs, and VPC firewall rules are a second line. Unless a resource policy, a VPC endpoint policy, or GCP VPC Service Controls limits the caller, the right role reaches the bucket from anywhere.

AWS

Common write primitives include iam:CreatePolicyVersion set as default, iam:AttachUserPolicy, iam:PutUserPolicy, iam:CreateAccessKey on another user, and iam:UpdateAssumeRolePolicy. The path that shows up most often is iam:PassRole plus compute.

ec2:RunInstances with a stronger instance profile, lambda:CreateFunction plus invoke, Glue, CloudFormation, or ssm:SendCommand on an instance with a better role are the usual vehicles. SCPs and permission boundaries can cap an administrator, so score effective permissions, not one policy document. PMapper models the graph. Pacu automates exploitation inside an authorized test. Detail for a single provider sits in AWS penetration testing.

Azure

Azure has two planes. Entra ID roles (Global Administrator, Privileged Role Administrator, Application Administrator) govern the directory. Azure RBAC (Owner, User Access Administrator, Contributor) governs resources under management groups and subscriptions.

A Global Administrator is not automatically Owner. The account can enable “Access management for Azure resources” and grant User Access Administrator at root. That bridge must be tested and must alert. An Entra ID security assessment covers the directory half.

Other levers: Microsoft.Authorization/roleAssignments/write, a new secret on a service principal you control, Contributor on a VM with a managed identity (run command, then a token from IMDS), Automation runbooks, and PIM eligible roles that activate without approval. Azure penetration testing has to walk both planes.

GCP

Allow policies bind members to roles at organization, folder, project, or resource scope and inherit downward. One loose organization binding undermines every project under it. Service accounts are both identities and resources.

roles/iam.serviceAccountTokenCreator allows direct impersonation. iam.serviceAccounts.actAs plus compute.instances.create or a Cloud Functions deploy attaches a stronger account to code you control. Key creation and setIamPolicy are the other levers. iam.disableServiceAccountKeyCreation closes a path only when it is enforced on every folder. GCP penetration testing starts at the organization node, not a single project.

AWS Azure GCP
Identity model IAM users and roles, STS, SCPs Entra ID plus Azure RBAC, PIM Allow policies on the hierarchy; service accounts as resources
Top escalation lever PassRole plus compute launch roleAssignments/write, managed identity serviceAccountTokenCreator, actAs, setIamPolicy
Cross-boundary trust Cross-account role trust, ExternalId B2B guests, multi-tenant apps, consent Workload Identity Federation, domain-wide delegation
Graph tooling PMapper, Cloudsplaining, Pacu AzureHound, BloodHound Cartography, gcloud policy analysis

Map findings to the MITRE ATT&CK Cloud matrices for IaaS and Entra ID so a multi-cloud report uses one vocabulary.

Concept image of cloud IAM privilege escalation paths differing across AWS, Azure and GCP
Same goal, different steps: escalation primitives are provider-specific.

How do you test cross-account trust, OIDC, and CI/CD roles?

Test trust from outside it. From a tester-controlled account or tenant named in the rules of engagement, attempt the assumption or consent an attacker would use. Testing only inside one account is the usual blind spot.

  • AWS. Review role trust for Principal set to * or an account root with no conditions. A vendor role without ExternalId is the confused-deputy case: any customer of that vendor can ask it to assume your role. Check S3, KMS, SQS, and Secrets Manager resource policies, and confirm aws:PrincipalOrgID, aws:SourceAccount, and aws:SourceArn reject an outside principal.
  • Azure. See what B2B guests can enumerate and whether any hold RBAC roles. A multi-tenant app in the tester tenant that requests Mail.Read and offline_access shows whether user consent allows an illicit grant. Review cross-tenant access both ways. User-targeted Conditional Access does not cover service principals.
  • GCP. Find service accounts with domain-wide delegation. A key for one of them can impersonate Workspace users inside the granted scopes, which turns a cloud credential into mail and Drive access. Check allUsers and allAuthenticatedUsers bindings and service accounts shared across projects.

Never pivot into a third party’s environment, even when a trust edge allows it. Document the edge and stop.

Pipelines belong in scope. They hold deploy roles with write access to production, and OIDC federation misconfigurations are often the shortest path to those roles.

The canonical bug is an AWS role that trusts token.actions.githubusercontent.com with no sub condition, or with StringLike on repo:org/*. Any repository in the organization, on any branch, can then assume production. GitLab CI fails the same way when project_path and ref are not pinned.

Azure federated credentials on app registrations, and GCP Workload Identity Federation providers without an attribute condition, fail the same way. From an in-scope repository and an unprotected branch, check whether a workflow can obtain the production credential.

Then inspect what federation was meant to retire: long-lived CI secrets, Terraform state with plaintext credentials, and Azure DevOps service connections with subscription Owner.

What does an unauthenticated test cover, and how do you avoid breaking production?

An unauthenticated test covers what any internet attacker sees: public storage, exposed endpoints, metadata reachable through your apps, and leaked keys. It does not cover the IAM graph, which is where most impact lives.

  • Public S3 buckets, Azure Blob containers, and GCS buckets, plus public EBS snapshots and AMIs.
  • API Gateway stages, Lambda function URLs, Cloud Run services, and open management ports.
  • SSRF to instance metadata. IMDSv1 answers a plain GET. IMDSv2 needs a PUT-issued token and a hop limit. Azure IMDS requires the Metadata: true header. GCP requires Metadata-Flavor: Google, which blocks naive SSRF but not requests that can set headers.
  • Dangling DNS at deleted cloud resources, open to subdomain takeover.
  • Keys in public repositories and package registries.

Run that pass first and keep it short. Then assume breach with credentials that match a realistic start: a developer SSO session, a CI role, or a read-only auditor.

Default to read-only enumeration. Get written approval for each class of write. Prove impact with the smallest action that shows it.

  • Rate ceilings. Enumeration hits AWS throttling, Azure Resource Manager 429s, and GCP quotas, and can stall the client’s own automation. Set request caps and a testing window.
  • Minimal proof. Read one canary object or a key’s metadata. Assume a role and call sts:GetCallerIdentity before any further use.
  • Evidence. Log every call with time, principal, and account, subscription, or project ID. Keep the raw responses that prove the path.
  • Named principals. Use only credentials the client listed, tag what you create, and keep an emergency stop contact.
  • Cleanup. Delete keys, guests, app secrets, and trust edits, then enumerate again. The cleanup log goes in the report.

Record which steps CloudTrail, GuardDuty, Defender for Cloud, Sentinel, Cloud Audit Logs, and Security Command Center caught. GCP Data Access audit logs are off by default for most services, so many data reads leave no trail. BigQuery is the documented exception: Data Access logs are on there by default.

What should the report prove for SOC 2, ISO 27001, PCI, and DORA?

The report should describe exploited paths, not a list of misconfigurations. It can support evidence for SOC 2, ISO 27001, PCI DSS 4.0, DORA, and NIS2. It is not a certification, and it does not replace continuous posture management.

  • An executive narrative: which crown jewels were reachable, from which starting credential, in how many hops.
  • Scope, rules of engagement, and the method used on each cloud.
  • Attack-path findings with API calls, responses, timestamps, and account or project identifiers.
  • Identity and trust findings: role trust, federation, cross-account and cross-tenant edges, CI credentials.
  • Detection gaps: which steps alerted and which did not.
  • Remediation ranked by blast radius against effort. One trust condition that cuts five paths outranks forty low findings.
  • Retest criteria: the exact call that must now fail.
  • A mapping to MITRE ATT&CK Cloud and the relevant CIS Benchmarks.

Those results typically feed SOC 2 logical access and monitoring (CC6, CC7), ISO 27001 Annex A technical vulnerability management, PCI DSS 4.0 requirement 11.4 including segmentation checks, and DORA and NIS2 resilience testing. Treat the clause map as directional and match it to the version your auditor uses.

Duration and cost follow scope: how many accounts and projects, whether both Azure identity planes are included, and whether CI, federation, and cross-tenant trust are in play. Re-test after major IAM or account-structure changes, and on the cadence the standard you claim actually requires. There is no universal day rate.

How do AI agents, RAG stores, and MCP servers change cloud scope?

They add identities, and those identities are usually over-privileged. A Bedrock agent action-group Lambda, an Azure OpenAI app’s managed identity, and a Vertex AI workload’s service account go through the same escalation analysis as a human user.

The typical finding is an agent role with s3:* or Contributor, granted because the developer could not predict every tool call. Prompt injection then becomes credential acquisition. A poisoned document in the RAG store, often an S3, Blob, or GCS bucket, tells the agent to call a tool, and the agent’s identity performs the action.

MCP servers in the cloud hold tokens for downstream systems and are confused-deputy candidates by design. Scope them explicitly: the agent identity, every tool it can call, the RAG store bucket, and any MCP server’s downstream tokens belong in the rules of engagement.

Map those findings to the OWASP Top 10 for LLM Applications, including prompt injection and excessive agency, and to MITRE ATLAS. MCP server security testing covers the tool-chain side of that path.

Cloud penetration testing attack graph showing an identity path from a leaked key to a data vault
In cloud, the attack path runs through identities and trust edges, not network hops.
Cross-account trust testing in cloud penetration testing, shown as a bridge between two isolated environments
Trust policies must reject principals from outside the boundary. Test from outside.

FAQ

Do I need AWS, Azure, or GCP approval before testing my own tenant?

AWS permits customer-owned resources on its published list without prior approval, with DoS and similar activity banned. Azure allows most customer-deployed testing without prior approval and still restricts some categories. Google Cloud asks customers to notify or request approval in many cases. Read the current page and your contract before you start.

Can a cloud pentest target the provider control plane or other tenants?

No. Hypervisors, managed-service internals, physical sites, provider staff, and other customers are out of scope on AWS, Azure, and GCP. Your identities, configuration, workloads, and code inside managed services are in scope. Stop and disclose anything that looks like a cross-tenant bug.

How is this different from a cloud configuration review?

A configuration review lists deviations from a baseline. Cloud penetration testing walks an identity path and keeps the API evidence. Run the review first so the pentest spends time on chains that reach production data.

Does the report satisfy SOC 2, ISO 27001, PCI DSS, or DORA by itself?

No. It is evidence your auditor can use for access, monitoring, vulnerability management, PCI DSS 4.0 requirement 11.4, and resilience testing under DORA or NIS2. It is not a certification, and clause numbers must match the version in your audit.

Should CI/CD and AI agents be in the same engagement?

Yes when those identities can reach production. OIDC trust without a pinned subject is a common short path to deploy roles. Agent roles, RAG buckets, tool calls, and MCP tokens need an explicit line in the rules of engagement.

If you want exploited paths across AWS, Azure and GCP instead of another posture export, our cloud and container security testing team scopes engagements by identity and trust boundary, with retest included.



// get started

Work with AgentOffense

Tell us about your target and goals. We’ll reply with scope and a fixed-price quote — usually within one business day.

./request_engagement