Entra authorization policy disallows user consent for applications
Microsoft Entra authorization settings are evaluated to determine if the default user role permits user consent to applications. The check looks at permission grant policies to see whether end users can authorize apps to access organization data on their behalf, or if consent is restricted (e.g., Do not allow user consent).
Risk
Permitting end-user consent enables consent phishing and over-privileged OAuth grants. Attackers can obtain tokens to read/send mail, access files, or act as the user, causing data exfiltration, persistence beyond password resets/MFA changes, and abuse of connected apps, impacting confidentiality and integrity.
Run this check with Prowler
Run in Prowler Cloudprowler azure --checks entra_policy_restricts_user_consent_for_appsRecommendation
Enforce least privilege by setting user consent to Do not allow user consent. Use the admin consent workflow to review requests and pre-approve only vetted apps. If needed, allow consent only for verified publishers with low-impact scopes. Regularly review existing grants and monitor audit/sign-in logs.
Remediation
CLI
Update-MgPolicyAuthorizationPolicy -BodyParameter @{ permissionGrantPolicyIdsAssignedToDefaultUserRole = @() }Terraform
resource "azuread_authorization_policy" "<example_resource_name>" {
# Critical: remove all self-consent policies so users cannot consent to apps
permission_grant_policy_ids_assigned_to_default_user_role = []
}Other
Check Code
from prowler.lib.check.models import Check, Check_Report_Azure
from prowler.providers.azure.services.entra.entra_client import entra_client
class entra_policy_restricts_user_consent_for_apps(Check):
def execute(self) -> Check_Report_Azure:
findings = []
for tenant_domain, auth_policy in entra_client.authorization_policy.items():
report = Check_Report_Azure(metadata=self.metadata(), resource=auth_policy)
report.subscription = f"Tenant: {tenant_domain}"
report.resource_name = getattr(auth_policy, "name", "Authorization Policy")
report.resource_id = auth_policy.id
report.status = "FAIL"
report.status_extended = "Entra allows users to consent apps accessing company data on their behalf"
if getattr(auth_policy, "default_user_role_permissions", None) and not any(
"ManagePermissionGrantsForSelf" in policy_assigned
for policy_assigned in getattr(
auth_policy.default_user_role_permissions,
"permission_grant_policies_assigned",
["ManagePermissionGrantsForSelf.microsoft-user-default-legacy"],
)
):
report.status = "PASS"
report.status_extended = "Entra does not allow users to consent apps accessing company data on their behalf"
findings.append(report)
return findingsReferences
- https://learn.microsoft.com/en-us/security/benchmark/azure/mcsb-privileged-access#pa-1-separate-and-limit-highly-privilegedadministrative-users
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/azure/ActiveDirectory/users-can-consent-to-apps-accessing-company-data-on-their-behalf.html#
- https://learn.microsoft.com/en-gb/entra/identity/enterprise-apps/configure-user-consent?pivots=portal
- https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/configure-user-consent