azuread_account_provisioning_activity_report_reviewedazuread_admin_consent_workflow_enabledazuread_admin_user_mfa_enabledazuread_all_user_mfa_enabledazuread_audit_log_search_enabledazuread_authorization_policy_accessing_company_data_not_allowedazuread_global_admin_range_restrictedazuread_group_not_publicazuread_guest_user_infoazuread_legacy_authentication_disabledazuread_microsoft_azure_management_limited_to_administrative_rolesazuread_password_protection_enabledazuread_risky_sign_ins_reportazuread_security_default_disabledazuread_signin_frequency_policyazuread_signin_risk_policyazuread_third_party_application_not_allowedazuread_user_password_not_set_to_expireazuread_user_risk_policyazuread_user_sspr_enabledmicrosoft365_calendar_sharing_disabled
Query: azuread_password_protection_enabled
Usage
powerpipe query microsoft365_compliance.query.azuread_password_protection_enabled
Steampipe Tables
SQL
with enable_banned_password_check_on_premises_settings as ( select tenant_id, id from azuread_directory_setting where display_name = 'Password Rule Settings' and (name = 'EnableBannedPasswordCheckOnPremises' and value = 'True')), banned_password_check_on_premise_mode_settings as ( select tenant_id, id from azuread_directory_setting where display_name = 'Password Rule Settings' and (name = 'BannedPasswordCheckOnPremisesMode' and value = 'Enforce')),tenant_list as ( select distinct on (tenant_id) tenant_id, _ctx from azuread_user)select t.tenant_id as resource, case when (e.tenant_id is not null) and (b.tenant_id is not null) then 'ok' else 'alarm' end as status, case when (e.tenant_id is not null) and (b.tenant_id is not null) then t.tenant_id || ' has password protection enabled.' else t.tenant_id || ' has password protection disabled.' end as reason , t.tenant_id as tenant_idfrom tenant_list as t left join enable_banned_password_check_on_premises_settings as e on e.tenant_id = t.tenant_id left join banned_password_check_on_premise_mode_settings as b on b.tenant_id = t.tenant_id;
Controls
The query is being used by the following controls: