Skip to content
Back to overview Illustration: a cloud environment with a clear boundary, a crosshair probes only inside it, next to a rulebook with ticks and crosses
Penetration Testing Azure Microsoft 365

Penetration testing in Azure and Microsoft 365: what Microsoft allows and how it works

By , Offensive Security 9 min read

Key takeaways

  • Since 15 June 2017, Microsoft no longer requires pre-approval for penetration tests against your own Azure resources. What is binding are Microsoft’s rules of engagement, which apply across Microsoft’s cloud services.
  • Prohibited activities include denial-of-service testing, accessing other tenants and storage accounts, using credentials that are not your own and phishing Microsoft employees.
  • Testing focuses on your tenant’s configuration: privileged roles, Conditional Access gaps, app registrations, Azure roles and internet-facing resources.
  • Written authorisation must come from the tenant owner. Microsoft does not grant it on the customer’s behalf, and your IT service provider cannot replace it.

Many organisations hesitate to commission a pentest of their Microsoft cloud because it is unclear what Microsoft allows. Can a service provider simply test inside the tenant? Does Microsoft need to be told? And what is there to test in a cloud environment when there are no servers of your own? The answers are in Microsoft’s own rules, which few people read. This article summarises them from a penetration tester’s perspective and describes how a test in Entra ID, Microsoft 365 and Azure works and what you should prepare.

Does Microsoft have to approve a penetration test?

No. According to Microsoft Learn, Microsoft has not required pre-approval for penetration tests against Azure resources since 15 June 2017, and no notification before the test is expected. What is binding instead are the rules of engagement that Microsoft publishes on the Microsoft Security Response Center website under the title “Microsoft Security Testing Rules of Engagement” (Microsoft Learn refers to them as the “Microsoft Cloud Unified Penetration Testing Rules of Engagement”). They cover the products, services and infrastructure Microsoft operates, which includes Microsoft 365.

You may test what you own or what the owner has explicitly authorised. According to Microsoft, third parties such as consultancies need explicit written authorisation from the resource owner, documented in the service agreement before testing begins. Microsoft does not grant that authorisation on the customer’s behalf. Microsoft also reserves the right to interrupt activity in progress if its automated abuse detection is triggered. In that case, you respond to the abuse notification with the authorisation and a description of the in-scope activity.

What does Microsoft prohibit, and what does it encourage?

Regardless of any authorisation, the rules of engagement prohibit, among other things:

  • Denial-of-service testing of any kind. If you want to test your own DDoS resilience, use the simulation partners Microsoft names.
  • Accessing, scanning or testing tenants, systems, logs, data or storage accounts that you do not own.
  • Using credentials or secrets that are not your own, even if they have been leaked publicly.
  • Network-intensive fuzzing or automated testing that generates excessive traffic.
  • Phishing or social engineering against Microsoft employees, and using Microsoft services such as Azure to phish others.
  • Further actions against Microsoft’s own services beyond an initial proof of concept. Anyone who finds a vulnerability in a Microsoft service during a test stops and reports it to the Microsoft Security Response Center.

Explicitly encouraged are test accounts and trial tenants for cross-tenant scenarios, testing your own monitoring and detection, and evaluating Conditional Access policies and Intune mobile application management (MAM) policies. For your tenant this means: attacking your own configuration and your own accounts is permitted; attacking the platform underneath is not.

What gets tested in a Microsoft tenant?

In the cloud there are no servers of your own to patch, but there is a configuration with a very large number of settings. Attackers there are not looking for a software bug but for a route from an ordinary account to more privileges. Testers use tools such as ROADtools or AzureHound, which read the directory and permissions and make relationships visible.

AreaTypical checksWhy it matters
Privileged rolesPermanent Global Administrators, no Privileged Identity Management, role-assignable groups and their ownersA single compromised admin account is enough for the whole tenant
Conditional AccessExclusions, platforms or apps not covered, legacy authentication still allowed, device code flow, policies left in report-only modeGaps in the rules are the most common way around MFA
Authentication methodsSMS and voice instead of phishing-resistant methods, password reset settingsDecides whether stolen credentials are enough
ApplicationsApp registrations and service principals with far-reaching application permissions, user consent, app owners, secrets without expiryBy default, all users can register applications, and in many tenants they can grant apps access to their own data
Guests and collaborationGuest permissions, invitation rights, sharing in SharePoint and OneDriveExternal accounts widen the attack surface
Hybrid identityEntra Connect server, synchronisation accounts, link to on-premises Active DirectoryThe server belongs to the highest protection tier but is often treated like any other server
AzureOwner and User Access Administrator rights, managed identities with overly broad roles, publicly reachable storage accounts, key vaults and management portsPaths lead from here to data and back into identity

The last row shows why cloud tests look at the tenant as a whole: a managed identity with Owner rights on a subscription, or an automation account with directory permissions, links Azure and Entra ID into a single attack path.

How does a penetration test in Azure and Microsoft 365 work?

  1. In scoping we define which tenants, subscriptions and applications are included, which perspective is tested (external view of sign-in portals, internal view as a compromised user) and what is excluded.
  2. A person authorised to act for the tenant owner approves the test in writing, with period, scope, test accounts and contacts.
  3. Testing starts with read-only reconnaissance of the configuration. We then check in a targeted way whether findings can be exploited and chained. Critical findings are reported immediately to the agreed contact.
  4. The report contains a management summary, findings with evidence and remediation guidance, and a mapping to NIS2, ISO 27001 and BSI IT-Grundschutz.
  5. After remediation, a retest checks the findings again and confirms closure.

What does your organisation need to prepare?

Authorisation and parties involved

Authorisation comes from the tenant owner, which is your organisation, and is signed by a person entitled to do so. Without it, access would be unauthorised; under German criminal law, Section 202a of the Strafgesetzbuch (StGB) makes it an offence to gain unauthorised access to specially protected data by circumventing access protection. If an IT service provider administers your tenant, for example through delegated admin rights, it must be informed in advance. Its consent does not replace your authorisation.

Test accounts and roles

For a grey-box test, create test accounts that resemble real users: a standard account with the usual licence, if needed an account on a managed device, and a guest account. For the configuration review, read-only roles are sufficient: Global Reader and Security Reader in Entra ID, and Reader at management group level in Azure. No tester needs permanent Global Administrator rights. The test accounts are subject to your Conditional Access policies like any other account and are deleted after the test.

Logging

Entra ID retains sign-in and audit logs for only seven days in the Free edition, and for 30 days with Entra ID P1 or P2. Route the logs to a Log Analytics workspace or Microsoft Sentinel via a diagnostic setting before the test. With P1 or P2, the Microsoft Graph activity logs are also available; they are only retained if you route them there. This lets you trace afterwards which activity came from the test and what your monitoring detected:

SigninLogs
| where TimeGenerated > ago(7d)
| where UserPrincipalName startswith "pentest."
| summarize SignIns = count(), Failed = countif(ResultType != "0")
    by UserPrincipalName, AppDisplayName, IPAddress

Monitoring and SOC

Decide in advance whether your SOC or managed security provider will be informed. If it is, it can attribute alerts to the test and will not lock test accounts without checking first. If it is deliberately not informed, you are testing detection as well; then someone must be available to step in if the test is handled as a real incident. Both approaches are legitimate; what matters is that the decision is made consciously and documented.

Next step

Our penetration testing for Microsoft 365, Entra ID and Azure is offered at a fixed price after scoping. If you first want your Azure configuration reviewed against the Microsoft cloud security benchmark, we offer an Azure assessment; it is described on the Azure Cloud Security page, where we also help remediate findings. Guidance on introducing Conditional Access without lockouts is available in a separate article.

Book an introductory call

Frequently asked questions

Do we have to inform Microsoft before the test?

No. Microsoft does not require pre-approval for tests against your own Azure resources, and the rules of engagement do not provide for advance notification. Keep the written authorisation to hand anyway in case Microsoft’s abuse detection flags an activity.

May testers run phishing against our employees?

The rules of engagement prohibit phishing Microsoft employees and using Microsoft services to phish others. A phishing simulation against your own workforce is a separate part of the engagement, scoped separately in writing, with early involvement of data protection and, where applicable, the works council.

Can a pentest damage our tenant?

A coordinated test works with test accounts and is predominantly read-only. Changes, such as creating an object as evidence, are agreed and documented in advance and reverted after the test. Denial-of-service testing is excluded under Microsoft’s rules in any case.

Isn’t the Secure Score enough as evidence?

The Secure Score shows which recommended settings are in place. It does not show whether several small gaps can be chained into a route to Global Administrator. That is exactly the question a pentest answers.

Let's talk about your IT security

In the introductory call (30 minutes, no obligation) we clarify:

  • where your company stands today and what concerns you most
  • which next step makes sense for your organisation
  • what effort and price range to expect
Bastian Wenske

Bastian Wenske

Founder & Managing Director

Heidelberger Straße 15
12059 Berlin
Germany

Prefer to reach out directly? Send us an email at [email protected].