Gallery › SQL › Azure built-in policies
[Preview]: Azure PostgreSQL flexible server should have Microsoft Entra Only Authentication enabled
Converted Policy Audit Disabled Mode Indexed Version 1.0.0-preview Preview
Disabling local authentication methods and allowing only Microsoft Entra Authentication improves security by ensuring that Azure PostgreSQL flexible server can exclusively be accessed by Microsoft Entra identities.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONPostgreSQL_FlexibleServers_EnableEntraOnlyAuthentication_Audit.json · 58 lines
{
"properties": {
"displayName": "[Preview]: Azure PostgreSQL flexible server should have Microsoft Entra Only Authentication enabled",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Disabling local authentication methods and allowing only Microsoft Entra Authentication improves security by ensuring that Azure PostgreSQL flexible server can exclusively be accessed by Microsoft Entra identities.",
"metadata": {
"preview": true,
"version": "1.0.0-preview",
"category": "SQL"
},
"version": "1.0.0-preview",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.DBForPostgreSql/flexibleServers"
},
{
"anyOf": [
{
"field": "Microsoft.DBForPostgreSql/flexibleServers/authConfig.activeDirectoryAuth",
"notEquals": "Enabled"
},
{
"field": "Microsoft.DBForPostgreSql/flexibleServers/authConfig.passwordAuth",
"notEquals": "Disabled"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/fa498b91-8a7e-4710-9578-da944c68d1fe",
"name": "fa498b91-8a7e-4710-9578-da944c68d1fe"
}Bylawfa498b91-8a7e-4710-9578-da944c68d1fe.bylaw.ps1 · 33 lines
# Converted from PostgreSQL_FlexibleServers_EnableEntraOnlyAuthentication_Audit.json by ConvertTo-Bylaw.
Policy 'fa498b91-8a7e-4710-9578-da944c68d1fe' {
Properties @{
DisplayName = '[Preview]: Azure PostgreSQL flexible server should have Microsoft Entra Only Authentication enabled'
Description = 'Disabling local authentication methods and allowing only Microsoft Entra Authentication improves security by ensuring that Azure PostgreSQL flexible server can exclusively be accessed by Microsoft Entra identities.'
Preview = $true
Version = '1.0.0-preview'
Category = 'SQL'
PolicyVersion = '1.0.0-preview'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.DBForPostgreSql/flexibleServers' {
Require 'authConfig.activeDirectoryAuth is Enabled' {
Field authConfig.activeDirectoryAuth | Must -Be 'Enabled'
}
Require 'authConfig.passwordAuth is Disabled' {
Field authConfig.passwordAuth | Must -Be 'Disabled'
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/SQL/PostgreSQL_FlexibleServers_EnableEntraOnlyAuthentication_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw