Azure compromises rarely start with the network. They start with identity: an app registration with more permissions than it needs, a client secret left in a repository, a managed identity with owner rights, or a consent grant nobody reviewed. Azure penetration testing is an authorized attack on your own Azure tenant and subscriptions that targets that identity layer, plus the storage, secrets and workloads it controls, to show what an attacker could reach. Microsoft does not require approval for it, as long as the test follows its rules of engagement.
This guide covers Microsoft’s testing rules, what a test checks, an example attack path written the way a report describes it, the link between on-premises Active Directory and the cloud, and how to scope an engagement. It is the Azure companion to our AWS penetration testing guide and GCP penetration testing guide.
Why Entra ID is the real Azure perimeter
Every Azure resource is managed through an identity in Microsoft Entra ID (formerly Azure AD): a user, a group, an app’s service principal, or a managed identity. A valid token for the right identity reaches the management plane from anywhere. Network rules on a virtual network do not stand between a stolen credential and your subscriptions; identity controls do.
Azure also has two permission systems that are easy to review separately and hard to reason about together:
- Entra roles govern the directory: users, groups, app registrations and tenant settings.
- Azure roles (RBAC) govern resources: management groups, subscriptions, resource groups and everything in them.
Microsoft states that the two are “secured independently from one another,” then documents a setting that lets a Global Administrator assign themselves User Access Administrator at root scope, over every subscription and management group in the tenant (Microsoft Learn). A test that looks at only one of the two systems misses the paths that cross between them.
Microsoft’s rules for testing Azure
You do not need Microsoft’s approval. As of June 15, 2017, Microsoft no longer requires pre-approval to test Azure resources, and notification is no longer required. You and any firm you hire must follow the Microsoft Cloud Unified Penetration Testing Rules of Engagement. A third party needs explicit written authorization from the resource owner, and Microsoft does not grant it on your behalf (Microsoft Learn: Penetration testing).
Prohibited under the rules of engagement:
- Denial-of-service testing of any kind. DDoS is prohibited under all circumstances; Microsoft lists approved simulation partners for resilience testing.
- Accessing, scanning or testing tenants, data or storage accounts you do not own or have permission to test.
- Using credentials or secrets that are not your own, including ones leaked publicly.
- Network-intensive fuzzing or automated testing that generates excessive traffic.
- Phishing Microsoft employees, or using Microsoft services to phish anyone else.
- Going beyond initial proof of concept if the test finds a flaw in a Microsoft service itself. That finding goes to the Microsoft Security Response Center.
Encouraged by the same rules: creating test accounts or trial tenants to test cross-tenant scenarios, fuzzing and port scanning your own Azure virtual machines, testing your tenant’s security monitoring and detection, evaluating Conditional Access and Intune app protection policies, and attempting to break out of shared service containers such as App Service or Functions, with an immediate stop and report on success.
Two practical effects. A phishing test cannot use Azure-hosted infrastructure to send its lures. And Azure’s abuse detection may flag legitimate testing, so keep the written authorization where you can find it quickly.
Azure penetration testing rules at a glance
| No approval needed | Prohibited | Encouraged |
|---|---|---|
| Testing your own endpoints for the OWASP Top 10 | Denial-of-service testing of any kind, including DDoS | Creating test accounts or trial tenants for cross-tenant scenarios |
| Dynamic application security testing (DAST) of your web apps and APIs | Testing tenants, data or storage accounts you do not own | Testing your tenant’s security monitoring and detection |
| Fuzz testing of your endpoints | Using credentials or secrets that are not yours, including leaked ones | Evaluating Conditional Access and Intune app protection policies |
| Port scanning of your endpoints | Network-intensive fuzzing or automated testing that generates excessive traffic | Trying to break out of shared containers such as App Service or Functions, then stopping and reporting |
| Third-party testing with the resource owner’s written authorization | Phishing Microsoft employees, or using Microsoft services to phish others | |
| Going beyond proof of concept on a flaw in a Microsoft service |
The first column is Microsoft’s list of standard tests on the Learn page linked above, which was last revised in 2026. Microsoft calls its lists illustrative, and the rules of engagement are the authoritative text, so reread both before each engagement.
Shared responsibility: what you may test
Microsoft’s shared responsibility matrix makes three areas yours under every service model, whether IaaS, PaaS or SaaS: your data, your configurations and settings, and your identities and users. Applications and network controls are shared in PaaS. Physical hosts, the physical network and the datacenter are Microsoft’s (Microsoft Learn).
That line sets the scope. Your tenant, your identities, your subscriptions, your configurations and your applications are testable. Microsoft’s hosts and infrastructure are not, and there is nothing there you would need to test anyway.
What an Azure penetration test covers
Entra ID roles and privileged access
Who holds Global Administrator and the other privileged roles, and whether that access is standing or activated on demand through Privileged Identity Management. Break-glass accounts, guest users with more reach than intended, and Conditional Access policies with gaps: legacy authentication still allowed, broad exclusions, or admin portals outside MFA.
App registrations, service principals and consent
Every app registration can hold secrets or certificates, and every one of those is a credential. The test inventories them: how old they are, who owns the app, and which API permissions were granted with admin consent. It also checks whether ordinary users can consent to third-party apps, which is how malicious OAuth apps get into a tenant. Application permissions on Microsoft Graph get the closest look: an app that is allowed to write role assignments or app role assignments can grant itself more access, with no user signing in, which makes it a path to tenant takeover. The same review covers how tokens could be stolen in the first place, including device code phishing, where a user is talked into approving a sign-in the attacker started.
Managed identities
Managed identities remove stored secrets, which is good. They also give a resource its own access, and that access is often broader than the resource needs. The test maps which virtual machines, App Service apps and Functions carry an identity, what that identity can reach, and whether a flaw in the application would hand an attacker that access. This is the Azure version of the metadata-service risk in our AWS guide, and the reason a web application test and a cloud test belong in the same conversation.
Azure RBAC, subscriptions and management groups
Owner, Contributor and User Access Administrator assignments at broad scopes, inherited from a management group where nobody looks. Custom roles with wildcard actions. Identities that can assign roles, because an identity that can grant access can grant it to itself. That is the Azure form of privilege escalation, and it is the step most attack paths in a report hinge on.
Storage accounts and SAS tokens
Containers open to anonymous access, storage account keys still enabled and shared widely, and shared access signature (SAS) tokens with long lifetimes or broad permissions sitting in code, config files or URLs. Network rules that leave storage reachable from the internet when it should be private.
Key Vault
Who can read secrets, keys and certificates, whether the vault uses access policies or Azure RBAC, and whether soft delete and purge protection are on. The test also looks at what is stored. A vault full of passwords for other identities is a map to the next step.
Functions and App Service
Secrets in app settings, deployment credentials that still allow basic authentication, exposed management endpoints, and the identity each app runs as.
Azure Kubernetes Service and container workloads
An AKS cluster has two permission layers of its own, and the test checks both. On the Azure side: who can pull the cluster’s kubeconfig, which Microsoft describes as a standalone Azure Resource Manager operation governed by Azure RBAC, and what the cluster and kubelet managed identities can reach in the subscription. On the Kubernetes side: whether local accounts are still enabled (Microsoft recommends disabling them in production because the built-in cluster admin certificate bypasses Entra ID), how Kubernetes RBAC is bound, and whether pods use workload identity or carry secrets (Microsoft Learn: AKS access and identity). A compromised pod with a broad managed identity is the container version of the managed identity risk above. Azure Container Registry access and Azure Automation runbooks, with the identities they run under, get the same treatment.
Network controls
Management ports open to the internet in network security groups, virtual machines with public IPs, and PaaS services with public network access on when a private endpoint exists. Network controls matter less than identity in Azure, but they still decide what an attacker can reach from the outside.
Logging and detection
Whether Entra sign-in and audit logs, the Azure activity log and Microsoft Defender for Cloud would have caught each step of the test, and whether anyone was alerted. A finding that says “we reached the subscription and nothing fired” changes priorities faster than one that only says “we reached the subscription.”
Example attack path: a leaked app secret to subscription owner
This is how a report narrates an attack path. Each step on its own looks like a medium or low finding. Together they are critical. Our sample penetration test report shows the same narration in a finished deliverable.
- A secret in source control. A client secret for the app registration used by a deployment pipeline sits in an old commit in a code repository.
- A role broader than the job. The pipeline’s service principal can deploy to one application, but it holds a role over the whole resource group, including a Key Vault it has no reason to read.
- A credential for something bigger. The Key Vault stores the secret of an older deployment identity from a migration project.
- Standing owner rights. That older identity was given Owner on the production subscription during the migration and never reduced.
From one leaked secret, the tester ends with Owner on production: control of every resource in the subscription and the ability to grant access to anyone. In an authorized test, the tester proves the access without changing production and stops there, as the rules of engagement for the test require.
The fixes, in order:
- Remove and rotate the leaked secret, then move the pipeline to workload identity federation, which lets GitHub Actions or Azure Pipelines authenticate without a stored secret (Microsoft Learn).
- Scope the pipeline’s role to the resources it deploys.
- Replace stored credentials in Key Vault with managed identities where possible.
- Remove standing Owner assignments and use Privileged Identity Management for the rare times they are needed.
- Alert on new role assignments at subscription and management group scope.
A configuration scanner reports steps 2 and 4 as separate items, and it cannot see step 1 or connect step 3. The value of the test is showing the chain. Our guide to CI/CD pipeline security covers the same pipeline trust from the build side.
Hybrid identity: where Active Directory and Azure meet
Most Microsoft-stack companies sync on-premises Active Directory to Entra ID. Microsoft says the Entra Connect server “contains critical identity data” and “must be treated as a Tier 0 component” (Microsoft Learn). In practice that means a compromise on one side can become a compromise on the other. A synced account with a privileged Entra role puts cloud control one on-premises password away, and a weak sync server puts the domain at risk.
A hybrid test covers both halves: an internal network penetration test for the Active Directory side, and the cloud test for Entra ID and Azure. When only the directory is in question, our Active Directory security assessment covers the on-premises paths from $6,000, and our Active Directory hardening checklist lists the Tier 0 checks to run first. When the concern is the Microsoft 365 tenant rather than Azure subscriptions, the Microsoft 365 security assessment reviews Entra ID, Conditional Access, Exchange Online and sharing settings from $4,200, and our Microsoft 365 security best practices guide lists the settings to fix first. Two quick wins we recommend: keep Entra admin roles on cloud-only accounts rather than synced ones, and treat the sync server with the same care as a domain controller.
Configuration review vs attack-path test
Half one: configuration review. Settings are checked against the CIS Microsoft Azure Foundations Benchmark and the Microsoft cloud security benchmark with read-only access. Microsoft Defender for Cloud, and open-source tools such as Prowler and ScoutSuite, enumerate misconfigurations at a scale no person can match. This half answers one question: does each setting match the recommended value?
Half two: attack paths. The tester starts from a realistic foothold, such as a standard user, a developer’s identity, a leaked secret or a compromised web app, and works toward the data and the subscriptions. Identity graph tools such as BloodHound help map the relationships. This half answers the question that matters: what can an attacker reach, and how?
Tools used in an Azure penetration test
The tools split along the same line as the test.
| Half | Tool | What it does |
|---|---|---|
| Configuration review | Microsoft Defender for Cloud, Prowler, ScoutSuite | Compare settings across subscriptions with benchmark recommendations |
| Attack paths | AzureHound | “The BloodHound data collector for Microsoft Azure”: gathers Entra ID and Azure RBAC relationships for graph analysis |
| Attack paths | ROADtools | A framework for interacting with Entra ID (Azure AD); its ROADrecon component copies directory data into a local database to explore |
| Attack paths | MicroBurst | “A collection of scripts for assessing Microsoft Azure security”, published by NetSPI |
| Both | Azure CLI, Az PowerShell and Microsoft Graph | The same management interfaces an attacker with a token would use |
Tools find the relationships. Deciding which of them form a real path to your data, and proving it without changing production, is the tester’s work. Defenders can run the collection tools against their own tenant to see the same graph first. If you would rather fix the common misconfigurations before a test, our cloud security best practices checklist lists what to check.
A secure score or a benchmark report is half one, and auditors know the difference. When a read-only review is what you need, our cloud security assessment delivers half one on its own, from $4,200.
How to scope an Azure penetration test
Have these answers ready and scoping takes one call:
- Tenants and subscriptions: how many, and how the management groups are laid out.
- Workloads: rough counts of virtual machines, App Service apps, Functions, AKS clusters, SQL databases, storage accounts and Key Vaults. If the clusters themselves need testing from the inside, add Kubernetes penetration testing for AKS to the scope.
- Identity: how many app registrations and service principals, whether you sync from on-premises AD, whether Privileged Identity Management is in use, and how many guest users.
- Access for the test: Reader on the subscriptions plus a read-only directory role such as Global Reader for the configuration half, and test identities that mirror real roles for the attack-path half.
- Applications: which web apps and APIs run in Azure, and whether to test them in the same engagement through API penetration testing or a web application test.
- Starting points: which footholds to model, such as a standard employee, a developer, or an attacker with only internet access.
- Compliance driver: it decides what the report has to map to.
- Anything outside the rules: DDoS resilience goes to a Microsoft-approved simulation partner, and phishing runs from outside Azure.
Compliance and Azure
Running in Azure does not remove a testing obligation. It moves it.
- SOC 2 auditors expect testing that covers the infrastructure the service runs on. See SOC 2 penetration testing.
- PCI DSS Requirement 11.4 applies to the cardholder data environment wherever it runs, including segmentation inside Azure. See PCI DSS penetration testing.
- HIPAA requires an evaluation of the safeguards around ePHI, including storage accounts and databases that hold it. See HIPAA penetration testing.
- NYDFS Part 500 requires annual penetration testing of a covered entity’s information systems. See NYDFS penetration testing.
- CMMC Level 2 does not name a penetration test, but a boundary test of an enclave in Azure or Azure Government (the cloud behind GCC High) is strong evidence for the control assessment and vulnerability practices. See the CMMC Level 2 requirements checklist.
What an Azure penetration test costs
Our cloud penetration testing starts at $6,800 for a single subscription on one provider, fixed in writing before work begins. Several subscriptions, with AKS or serverless workloads tested alongside, start at $10,500. Large estates with many subscriptions and identities, or more than one cloud, start at $17,500. A hybrid engagement adds the internal network test for Active Directory, from $6,000. Every test includes the configuration review, the attack-path testing, a full report and a free retest of the fixes. The tiers are on the cloud penetration testing pricing page.
| Azure estate | Starting price |
|---|---|
| A single subscription on one provider | $6,800 |
| Several subscriptions, with AKS or serverless workloads tested alongside | $10,500 |
| Large estates with many subscriptions and identities, or more than one cloud | $17,500 |
| Hybrid add-on: internal network test for Active Directory | From $6,000 |
| Configuration review only (cloud security assessment) | From $4,200 |
Frequently asked questions
Do I need Microsoft’s permission to run an Azure penetration test? No. Pre-approval ended on June 15, 2017, and notification is no longer required. You must follow Microsoft’s rules of engagement, and a testing firm needs your written authorization.
Can the test include Entra ID? Yes, and it should. Entra ID holds the identities that control every Azure resource, so most serious Azure findings start or end there.
Is a Microsoft Defender for Cloud secure score enough? No. It is a configuration review, the first half of a test. It does not show how findings chain together or what an attacker could reach.
How long does it take? About a week of testing for a single subscription, then reporting and the retest once your fixes are in. More subscriptions, more identities and container or serverless workloads take longer. See how long a penetration test takes.
Will the test affect production? The configuration review is read-only. Attack-path testing uses agreed test identities, stays inside the scope you approve, avoids everything on Microsoft’s prohibited list, and proves access without changing production.
How much does it cost? From $6,800 for a single subscription, from $10,500 for several, and from $17,500 for large or multi-cloud estates, each with a free retest.
What tools are used for Azure penetration testing? Benchmark scanners such as Microsoft Defender for Cloud, Prowler and ScoutSuite for the configuration half, and AzureHound, ROADtools and MicroBurst, alongside the Azure CLI and Microsoft Graph, for mapping and testing attack paths. The tools gather data; the tester works out which paths are real.
Does an Azure penetration test include Microsoft 365? Partly. Entra ID is shared by Azure and Microsoft 365, so identity findings apply to both. Exchange Online, SharePoint, Teams and sharing settings are a separate scope, covered by the Microsoft 365 security assessment described above.
Can Azure be tested black box? Yes. A tester can start with nothing but internet access and your company name. Most tests also include an assumed-breach starting point, such as a standard user or a leaked secret, because that is where Azure compromises usually begin and it finds more in the same number of days. The configuration review always needs read access.
If you run on Azure and want to know what an attacker could reach from one leaked secret, scope a cloud assessment. Comparing vendors first? Our list of cloud penetration testing companies covers the field.
Written by
Wahid Iqbal, Head of Compliance
20+ years in the field. Focus: PCI DSS, ISO 27001 & ISO 22301. Part of the team that scopes, tests, and reports for our clients. Full profile →