Active Directory administrator accounts for Azure SQL Server must not use predictable or common names such as “admin” or “administrator.” Predictable account names make privileged accounts easy to discover and enable targeted brute-force and credential-stuffing attacks.
In Ansible, verify the azure.azcollection.azure_rm_adserviceprincipal (or azure_rm_adserviceprincipal) task’s ad_user property is defined, non-empty, and set to a non-predictable, unique name. This rule flags tasks where ad_user is missing or null, or where the value matches common predictable names (case-insensitive) such as admin, administrator, sqladmin, root, user, azure_admin, azure_administrator, or guest. Use a clear, non-guessable name for ad_user. For example:
- name:Create AD service principal for Azure SQL adminazure.azcollection.azure_rm_adserviceprincipal:ad_user:"sqlsvc-prod-01"password:"{{ lookup('password', '/dev/null length=32') }}"state:present
Compliant Code Examples
#this code is a correct code for which the query should not find any result- name:create ad spazure_rm_adserviceprincipal:display_name:my-spapp_id:'{{ app_id }}'state:presenttenant:'{{ tenant_id }}'ad_user:unpredictableName
Non-Compliant Code Examples
#this is a problematic code where the query should report a result(s)- name:create ad spazure_rm_adserviceprincipal:display_name:my-spapp_id:"{{ app_id }}"state:presenttenant:"{{ tenant_id }}"ad_user:admin- name:create ad sp2azure_rm_adserviceprincipal:display_name:my-sp2app_id:"{{ app_id2 }}"state:presenttenant:"{{ tenant_id2 }}"ad_user:""- name:create ad sp3azure_rm_adserviceprincipal:display_name:my-sp3app_id:"{{ app_id3 }}"state:presenttenant:"{{ tenant_id3 }}"ad_user:
1
2
rulesets:- Ansible / Azure # Rules to enforce / Azure.
맞춤형 데모 요청
Datadog 시작하기
Ask AI
AI-generated responses may be inaccurate. Verify important info.