Closed rybal06 closed 1 month ago
I dug into this a bit more, it seems this is difficult because there is no policy alias available to get the name of the database, so it isn't possible to exclude the masterdb from evaluation of this rule.
https://www.azadvertizer.net/azpolicyaliasesadvertizer_singlelinesx.html
The only available aliases are properties.status and property.state. The audit policy in this repo works around the issue by using an ARM template embedded in the policy with an "AuditIfNotExists" effect; but that is not possible when using a deny policy
@rybal06, a modification has been done for the policy to evaluate the parent resource name through the FullName field. Let us know if you have any additional observations
When deployed, there are two entries shown in compliance, both named "current". One is for the database named master, the other is for the database which is deployed by the customer.
For databases with TDE enabled (as expected), one entry shows compliant while the other shows as non-compliant for the master db.
This setting doesn't seem possible to configure on master db.
This similar policy is configured to exclude the master db: https://github.com/Azure/Community-Policy/tree/main/policyDefinitions/SQL/audit-transparent-data-encryption-status
Repro:
Observe the masterDB will show as non-compliant.