Navigation
- Common Setup
- Prowler Cloud Authentication
- Prowler CLI Authentication
- Supported PowerShell Versions
- Required PowerShell Modules
Common Setup
Authentication Methods Overview
Prowler Cloud uses app-only authentication. Prowler CLI supports the same app-only options and two delegated flows. Prowler Cloud: Prowler CLI:- Application Certificate Authentication (Recommended)
- Application Client Secret Authentication
- Azure CLI Authentication
- Interactive Browser Authentication
Required Permissions
To run the full Prowler provider, including PowerShell checks, two types of permission scopes must be set in Microsoft Entra ID.Application Permissions for App-Only Authentication
When using service principal authentication, add these Application Permissions: Microsoft Graph API Permissions:AccessReview.Read.All: Required forentra_access_review_guest_users_configuredandentra_access_review_privileged_roles_configuredchecks. A Microsoft Entra ID P2 or Microsoft Entra ID Governance license is also required.AuditLog.Read.All: Required for Entra service.Directory.Read.All: Required for all services.OnPremDirectorySynchronization.Read.All: Required forentra_seamless_sso_disabledcheck (hybrid deployments).Policy.Read.All: Required for all services.RoleManagementPolicy.Read.Directory: Required forentra_pim_global_administrator_approval_requiredandentra_pim_privileged_role_administrator_approval_requiredchecks. A Microsoft Entra ID P2 or Microsoft Entra ID Governance license is also required.SecurityIdentitiesHealth.Read.All: Required fordefenderidentity_health_issues_no_opencheck.SecurityIdentitiesSensors.Read.All: Required fordefenderidentity_health_issues_no_opencheck.SharePointTenantSettings.Read.All: Required for SharePoint service.ThreatHunting.Read.All: Required for Defender XDR checks (defenderxdr_endpoint_privileged_user_exposed_credentials,defenderxdr_critical_asset_management_pending_approvals).DeviceManagementServiceConfig.Read.All: Required for Intune device management settings used byentra_conditional_access_policy_mdm_compliant_device_requiredcheck.DeviceManagementConfiguration.Read.All: Required for Intune device compliance policies used byentra_conditional_access_policy_mdm_compliant_device_requiredcheck.DeviceManagementManagedDevices.Read.All: Required for Intune managed devices used byentra_conditional_access_policy_mdm_compliant_device_requiredcheck.
Exchange.ManageAsAppfrom external APIOffice 365 Exchange Online: Required for Exchange PowerShell module app authentication. TheGlobal Readerrole must also be assigned to the app.
Global Reader role and the Microsoft Graph Organization.Read.All permission, which Directory.Read.All already includes.
Directory.Read.All can be replaced with Domain.Read.All for more restrictive permissions, but Entra checks related to DirectoryRoles and GetUsers will not run. If using this option, you must also add the Organization.Read.All permission to the application registration for authentication.These permissions enable application-based authentication methods (client secret and certificate). Using certificate-based authentication is the recommended way to run the full M365 provider, including PowerShell checks.
Browser Authentication Permissions
When using browser authentication, permissions are delegated to the user, so the user must have the appropriate permissions rather than the application.Automated Setup with a Script (Optional)
Added in: 5.52.0 As an alternative to the manual steps in Step-by-Step Permission Assignment, the Prowler repository includes a script that creates the application registration and assigns every permission in one run:permissions/prowler-azure-m365-scan-identity.sh.
The script is a single Bash file that only calls the Azure CLI. It uses the cloud and tenant the Azure CLI is signed in to. No endpoint is hardcoded, and the script looks up each permission by name in that cloud. A tenant administrator runs the script. Prowler never receives administrator access.
What the Script Creates
- An application registration (single tenant) and its service principal, named “Prowler Scan” unless
--app-nameis set. - The Microsoft Graph application permissions listed in Application Permissions for App-Only Authentication, with admin consent granted.
- The
Exchange.ManageAsApppermission fromOffice 365 Exchange Onlineand theGlobal Readerdirectory role, both required by the PowerShell checks. Use--graph-onlyto leave both out; only checks that work through Microsoft Graph will run. - Optionally, a credential: the public certificate passed with
--certificate(recommended), or a client secret with--client-secret. The client secret is printed once on the terminal and stored nowhere else, and expires after 180 days.
Running the Script
-
Download the script from the repository and read it. Every command that changes something goes through one function,
run, which prints the command before running it. -
For a cloud other than the commercial one, select it in the Azure CLI first:
Then sign in to the tenant:
-
For certificate authentication, create the certificate as described in Generate the Certificate. Only the public
prowlerm365.cerfile is passed to the script; the private key stays on the local machine. -
To see what the script would do, run it without
--apply. This is a dry run: it prints every command and changes nothing. -
To create the identity, run the same command with
--apply: - Copy the Tenant ID and Client ID from the output. Wait about a minute before the first scan: a new application registration and its credential take a moment to become usable for sign-in.
[exists] and left unchanged. When an application registration with the same name already exists, the script shows how many owners and credentials it has and stops; to continue, for example on a second run, add --use-existing-app. If a permission does not exist in the signed-in cloud, or the tenant has no Exchange Online, the script skips it and repeats the warning at the end of the output. To use one identity for Microsoft 365 and Azure, pass --m365 and --azure together.
Removing What the Script Created
Delete the application registration only if it was created for Prowler. If the script ran with--use-existing-app on an application that other workloads use, remove only what the script added and leave the application in place: the Microsoft Graph and Exchange application permissions (and their admin consent), the Global Reader assignment and the prowler-scan credential.
If the script also ran with --azure, remove the Azure role assignments it created as well, following Removing What the Script Created in the Azure guide. Deleting the application does not remove them, and on a shared application leave any assignment that existed before the script ran.
To remove the application registration, its service principal, its credentials, its permissions and its Global Reader assignment:
Step-by-Step Permission Assignment
Create Application Registration
-
Access Microsoft Entra ID.

-
Navigate to “Applications” > “App registrations”.

-
Click ”+ New registration”, complete the form, and click “Register”.

-
Go to “Certificates & secrets” > “Client secrets” > ”+ New client secret”.

-
Fill in the required fields and click “Add”, then copy the generated value (this will be
AZURE_CLIENT_SECRET).
Grant Microsoft Graph API Permissions
-
Open API permissions for the Prowler application registration.

-
Click ”+ Add a permission” > “Microsoft Graph” > “Application permissions”.

-
Search and select the required permissions:
AccessReview.Read.All: Required forentra_access_review_guest_users_configuredandentra_access_review_privileged_roles_configuredchecks. A Microsoft Entra ID P2 or Microsoft Entra ID Governance license is also requiredAuditLog.Read.All: Required for Entra serviceDirectory.Read.All: Required for all servicesOnPremDirectorySynchronization.Read.All: Required forentra_seamless_sso_disabledcheck (hybrid deployments)Policy.Read.All: Required for all servicesRoleManagementPolicy.Read.Directory: Required forentra_pim_global_administrator_approval_requiredandentra_pim_privileged_role_administrator_approval_requiredchecks. A Microsoft Entra ID P2 or Microsoft Entra ID Governance license is also requiredSecurityIdentitiesHealth.Read.All: Required fordefenderidentity_health_issues_no_opencheckSecurityIdentitiesSensors.Read.All: Required fordefenderidentity_health_issues_no_opencheckSharePointTenantSettings.Read.All: Required for SharePoint service


-
Click “Add permissions”, then click “Grant admin consent for
<your-tenant-name>”.
Grant PowerShell Module Permissions
-
Add Exchange API:
- Search and select “Office 365 Exchange Online” API in APIs my organization uses.

- Select “Exchange.ManageAsApp” permission and click “Add permissions”.

- Assign
Global Readerrole to the app: Go toRoles and administrators> clickherefor directory level assignment.

- Search for
Global Readerand assign it to the application.

-
Click “Grant admin consent for
<your-tenant-name>” to grant admin consent.

Application Certificate Authentication (Recommended)
Available for both Prowler Cloud and Prowler CLI Authentication flag for CLI:--certificate-auth
Certificate-based authentication replaces the client secret with an X.509 certificate that signs Microsoft Entra ID tokens for the Prowler application registration.
This is the recommended approach for production environments because it avoids long-lived secrets, supports the full provider (including PowerShell checks), and simplifies unattended automation. Microsoft also recommends certificate credentials for app-only access, see Manage certificates for applications.
Generate the Certificate
The service principal needs a certificate that contains the private key locally (for Prowler) and the public key uploaded to Microsoft Entra ID. The following commands show a secure baseline workflow on macOS or Linux using OpenSSL:Upload the Certificate to Microsoft Entra ID
- Open Microsoft Entra ID > App registrations > the Prowler application.
- Go to Certificates & secrets > Certificates.
- Select Upload certificate and choose
prowlerm365.cer. - Confirm the certificate appears with the expected expiration date.
prowlerm365.pfx.b64) for the next step.
Provide the Certificate to Prowler
- Prowler Cloud: Paste the Base64-encoded PFX in the
certificate_contentfield when configuring the Microsoft 365 provider in Prowler Cloud. - Prowler CLI: Export credential variables or pass the local file path when running Prowler.
AZURE_CLIENT_ID and AZURE_TENANT_ID in the environment when --certificate-path is used.
Do not mix certificate authentication with a client secret. Provide either a certificate or a secret to the application registration and Prowler configuration.
Application Client Secret Authentication
Available for both Prowler Cloud and Prowler CLI Authentication flag for CLI:--sp-env-auth
Authenticate using a Microsoft Entra application registration with a client secret by configuring the following environment variables:
--sp-env-auth will fail. This workflow is helpful for initial validation or temporary access. Plan to transition to certificate-based authentication to remove long-lived secrets and keep full provider coverage in unattended environments.
To scan every M365 check, ensure the required permissions are added to the application registration. Refer to the PowerShell Module Permissions section for more information.
Prowler Cloud Authentication
Use the shared permissions and credentials above, then complete the Microsoft 365 provider form in Prowler Cloud. The platform persists the encrypted credentials and supplies them during scans.Application Certificate Authentication (Recommended)
- Select Application Certificate Authentication.
- Enter the tenant ID and application (client) ID.
- Paste the Base64-encoded certificate content.
Application Client Secret Authentication
- Select Application Client Secret Authentication.
- Enter the tenant ID and application (client) ID.
- Enter the client secret.
Prowler CLI Authentication
Certificate Authentication
Authentication flag for CLI:--certificate-auth
After credentials are exported, launch the Microsoft 365 provider with certificate authentication:
Client Secret Authentication
Authentication flag for CLI:--sp-env-auth
After exporting the secret-based variables, run:
Azure CLI Authentication
Authentication flag for CLI:--az-cli-auth
Azure CLI authentication relies on the identity that is already signed in with the Azure CLI. Before running Prowler, make sure you have an active CLI session in the target tenant:
Interactive Browser Authentication
Authentication flag for CLI:--browser-auth
Authenticate against Azure using the default browser to start the scan. The --tenant-id flag is also required.
These credentials only enable checks that rely on Microsoft Graph. The entire provider cannot be run with this method. To perform a full M365 security scan, use the recommended authentication method.
Since this is a delegated permission authentication method, necessary permissions should be assigned to the user rather than the application.
Supported PowerShell Versions
PowerShell is required to run certain M365 checks. Supported versions:- PowerShell 7.4 or higher (7.5 is recommended)
Why Is PowerShell 7.4+ Required?
- PowerShell 5.1 (default on some Windows systems) does not support required cmdlets.
- Older cross-platform PowerShell versions are unsupported, leading to potential errors.
Installing PowerShell is only necessary if you install Prowler via pip or other sources. SDK and API containers include PowerShell by default.
Installing PowerShell
Installing PowerShell is different depending on your OS:- Windows
- MacOS
- Linux (Ubuntu)
- Linux (Alpine)
- Linux (Debian)
- Linux (RHEL)
- Docker
Required PowerShell Modules
Prowler relies on several PowerShell cmdlets to retrieve necessary data. These cmdlets come from different modules that must be installed.Automatic Installation
The required modules are automatically installed when running Prowler with the--init-modules flag.
Example command:
Prowler installs the modules using
-Scope CurrentUser.
If you encounter any issues with services not working after the automatic installation, try installing the modules manually using -Scope AllUsers (administrator permissions are required for this).
The command needed to install a module manually is:Modules Version
- MSAL.PS: Required for Exchange module via application authentication.
- ExchangeOnlineManagement (Minimum version: 3.6.0) Required for checks across Exchange, Defender, and Purview.
- MicrosoftTeams (Minimum version: 6.6.0) Required for all Teams checks.

