turbot/steampipe-mod-azure-compliance

Control: Ensure that 'User consent for applications' is set to 'Do not allow user consent'

Description

Require administrators to provide consent for applications before use.

If Microsoft Entra ID is running as an identity provider for third-party applications, permissions and consent should be limited to administrators or pre-approved. Malicious applications may attempt to exfiltrate data or abuse privileged user accounts.

Remediation

Remediate from Azure Portal

  1. From Azure Home select the Portal Menu.
  2. Select Microsoft Entra ID.
  3. Under Manage, select Enterprise applications.
  4. Under Security, select Consent and permissions.
  5. Under Manage, select User consent settings.
  6. Set User consent for applications to Do not allow user consent.
  7. Click Save.

Default Value

By default, Users consent for applications is set to Allow user consent for apps.

Usage

Run the control in your terminal:

powerpipe control run azure_compliance.control.ad_authorization_policy_user_consent_disallowed

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run azure_compliance.control.ad_authorization_policy_user_consent_disallowed --share

SQL

This control uses a named query:

with distinct_tenant as (
select
distinct tenant_id,
display_name,
subscription_id,
_ctx
from
azure_tenant
)
select
id as resource,
case when exists (
select 1
from jsonb_array_elements_text(
(default_user_role_permissions -> 'permissionGrantPoliciesAssigned')::jsonb
) as pol(val)
where val like 'ManagePermissionGrantsForSelf.%'
) then 'alarm'
else 'ok'
end as status,
case when exists (
select 1
from jsonb_array_elements_text(
(default_user_role_permissions -> 'permissionGrantPoliciesAssigned')::jsonb
) as pol(val)
where val like 'ManagePermissionGrantsForSelf.%'
) then t.display_name || ' user consent for applications allowed.'
else t.display_name || ' user consent for applications disallowed.'
end as reason,
t.tenant_id
from
distinct_tenant as t,
azuread_authorization_policy

Tags