Gallery › VirtualEnclaves › Azure built-in policies
[Preview]: Control the use of Microsoft SQL in a Virtual Enclave
Converted Initiative Version 1.0.0-preview Preview
This initiative deploys Azure policies for Microsoft SQL ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves
ConvertTo-Bylaw converted this initiative, and proved that the file compiles back to the same definition.
Azure Policy JSONMSSqlInitiative.json · 145 lines
{
"properties": {
"displayName": "[Preview]: Control the use of Microsoft SQL in a Virtual Enclave",
"policyType": "BuiltIn",
"description": "This initiative deploys Azure policies for Microsoft SQL ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves",
"metadata": {
"version": "1.0.0-preview",
"category": "VirtualEnclaves",
"preview": true
},
"version": "1.0.0-preview",
"policyDefinitions": [
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/ac01ad65-10e5-46df-bdd9-6b0cad13e1d2",
"policyDefinitionReferenceId": "MSSqlManagedInstancesShouldUseCmkForEncryption",
"definitionVersion": "2.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0a370ff3-6cab-4e85-8995-295fd854c5b8",
"policyDefinitionReferenceId": "MSSqlServersShouldUseCmkForEncryption",
"definitionVersion": "2.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a8793640-60f7-487c-b5c3-1d37215905c4",
"policyDefinitionReferenceId": "MSSqlManagedInstancesShouldTls12orNewer",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/32e6bbec-16b6-44c2-be37-c5b672d103cf",
"policyDefinitionReferenceId": "MSSqlServersShouldTls12orNewer",
"definitionVersion": "2.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/17k78e20-9358-41c9-923c-fb736d382a12",
"policyDefinitionReferenceId": "MSSqlServersShouldHaveTransparentDataEncryptionEnabled",
"definitionVersion": "2.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9dfea752-dd46-4766-aed1-c355fa93fb91",
"policyDefinitionReferenceId": "MSSqlManagedInstancesShouldDisablePublicAccess",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1b8ca024-1d5c-4dec-8995-b1a932b41780",
"policyDefinitionReferenceId": "MSSqlServersShouldDisablePublicAccess",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7698e800-9299-47a6-b3b6-5a0fee576eed",
"policyDefinitionReferenceId": "MSSqlServersShouldUsePrivateLink",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/32e6bbec-16b6-44c2-be37-c5b672d103cf",
"policyDefinitionReferenceId": "MSSqlServersShouldMinimumTls12",
"definitionVersion": "2.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/28b0b1e5-17ba-4963-a7a4-5a1ab4400a0b",
"policyDefinitionReferenceId": "MSSqlServersDenyPublicAccess",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/86a912f6-9a06-4e26-b447-11b16ba8659f",
"policyDefinitionReferenceId": "MSSqlServersTransparentDatabaseDataEncryption",
"definitionVersion": "2.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/ae5d2f14-d830-42b6-9899-df6cfe9c71a3",
"policyDefinitionReferenceId": "MSSqlShouldUseServiceEndpoint",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1f314764-cb73-4fc9-b863-8eca98ac36e9",
"policyDefinitionReferenceId": "MSSqlAadAdminShouldBeProvisionedForSqlServers",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/abda6d70-9778-44e7-84a8-06713e6db027",
"policyDefinitionReferenceId": "MSSqlShouldHaveAadOnlyAuthEnabled",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/78215662-041e-49ed-a9dd-5385911b3a1f",
"policyDefinitionReferenceId": "MSSqlManagedInstancesShouldHaveAadOnlyAuthEnabled",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a6fb4358-5bf4-4ad7-ba82-2cd2f41ce5e9",
"policyDefinitionReferenceId": "MSSqlServersAuditingEnabled",
"definitionVersion": "2.*.*",
"parameters": {
"setting": {
"value": "enabled"
}
}
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/abfb4388-5bf4-4ad7-ba82-2cd2f41ceae9",
"policyDefinitionReferenceId": "MSSqlServersDefenderEnabled",
"definitionVersion": "2.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/abfb7388-5bf4-4ad7-ba99-2cd2f41cebb9",
"policyDefinitionReferenceId": "MSSqlManagedInstancesDefenderEnabled",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/c5a62eb0-c65a-4220-8a4d-f70dd4ca95dd",
"policyDefinitionReferenceId": "MSSqlManagedInstancesDefenderConfigured",
"definitionVersion": "2.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/36d49e87-48c4-4f2e-beed-ba4ed02b71f5",
"policyDefinitionReferenceId": "MSSqlServersDefenderConfigured",
"definitionVersion": "2.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/feedbf84-6b99-488c-acc2-71c829aa5ffc",
"policyDefinitionReferenceId": "MSSqlDatabasesVulnerabilitiesResolved",
"definitionVersion": "4.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/89099bee-89e0-4b26-a5f4-165451757743",
"policyDefinitionReferenceId": "MSSqlServersAuditingRetention",
"definitionVersion": "3.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1b7aa243-30e4-4c9e-bca8-d0d3022b634a",
"policyDefinitionReferenceId": "MSSqlManagedInstancesVulnerabilityAssessmentEnabled",
"definitionVersion": "1.*.*"
},
{
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/ef2a8f2a-b3d9-49cd-a8a8-9a3aaaf647d9",
"policyDefinitionReferenceId": "MSSqlServersVulnerabilityAssessmentEnabled",
"definitionVersion": "3.*.*"
}
],
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policySetDefinitions/0fbe78a5-1722-4f1b-83a5-89c14151fa60",
"name": "0fbe78a5-1722-4f1b-83a5-89c14151fa60"
}Bylaw0fbe78a5-1722-4f1b-83a5-89c14151fa60.bylaw.ps1 · 151 lines
# Converted from MSSqlInitiative.json by ConvertTo-Bylaw.
Initiative '0fbe78a5-1722-4f1b-83a5-89c14151fa60' {
Properties @{
DisplayName = '[Preview]: Control the use of Microsoft SQL in a Virtual Enclave'
Description = 'This initiative deploys Azure policies for Microsoft SQL ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves'
Version = '1.0.0-preview'
Category = 'VirtualEnclaves'
Preview = $true
PolicyVersion = '1.0.0-preview'
}
PolicyDefinition @{
Id = 'ac01ad65-10e5-46df-bdd9-6b0cad13e1d2'
ReferenceId = 'MSSqlManagedInstancesShouldUseCmkForEncryption'
Version = '2.*.*'
}
PolicyDefinition @{
Id = '0a370ff3-6cab-4e85-8995-295fd854c5b8'
ReferenceId = 'MSSqlServersShouldUseCmkForEncryption'
Version = '2.*.*'
}
PolicyDefinition @{
Id = 'a8793640-60f7-487c-b5c3-1d37215905c4'
ReferenceId = 'MSSqlManagedInstancesShouldTls12orNewer'
Version = '1.*.*'
}
PolicyDefinition @{
Id = '32e6bbec-16b6-44c2-be37-c5b672d103cf'
ReferenceId = 'MSSqlServersShouldTls12orNewer'
Version = '2.*.*'
}
PolicyDefinition @{
Id = '/providers/Microsoft.Authorization/policyDefinitions/17k78e20-9358-41c9-923c-fb736d382a12'
ReferenceId = 'MSSqlServersShouldHaveTransparentDataEncryptionEnabled'
Version = '2.*.*'
}
PolicyDefinition @{
Id = '9dfea752-dd46-4766-aed1-c355fa93fb91'
ReferenceId = 'MSSqlManagedInstancesShouldDisablePublicAccess'
Version = '1.*.*'
}
PolicyDefinition @{
Id = '1b8ca024-1d5c-4dec-8995-b1a932b41780'
ReferenceId = 'MSSqlServersShouldDisablePublicAccess'
Version = '1.*.*'
}
PolicyDefinition @{
Id = '7698e800-9299-47a6-b3b6-5a0fee576eed'
ReferenceId = 'MSSqlServersShouldUsePrivateLink'
Version = '1.*.*'
}
PolicyDefinition @{
Id = '32e6bbec-16b6-44c2-be37-c5b672d103cf'
ReferenceId = 'MSSqlServersShouldMinimumTls12'
Version = '2.*.*'
}
PolicyDefinition -Id '28b0b1e5-17ba-4963-a7a4-5a1ab4400a0b' -ReferenceId 'MSSqlServersDenyPublicAccess' -Version '1.*.*'
PolicyDefinition @{
Id = '86a912f6-9a06-4e26-b447-11b16ba8659f'
ReferenceId = 'MSSqlServersTransparentDatabaseDataEncryption'
Version = '2.*.*'
}
PolicyDefinition @{
Id = 'ae5d2f14-d830-42b6-9899-df6cfe9c71a3'
ReferenceId = 'MSSqlShouldUseServiceEndpoint'
Version = '1.*.*'
}
PolicyDefinition @{
Id = '1f314764-cb73-4fc9-b863-8eca98ac36e9'
ReferenceId = 'MSSqlAadAdminShouldBeProvisionedForSqlServers'
Version = '1.*.*'
}
PolicyDefinition @{
Id = 'abda6d70-9778-44e7-84a8-06713e6db027'
ReferenceId = 'MSSqlShouldHaveAadOnlyAuthEnabled'
Version = '1.*.*'
}
PolicyDefinition @{
Id = '78215662-041e-49ed-a9dd-5385911b3a1f'
ReferenceId = 'MSSqlManagedInstancesShouldHaveAadOnlyAuthEnabled'
Version = '1.*.*'
}
PolicyDefinition @{
Id = 'a6fb4358-5bf4-4ad7-ba82-2cd2f41ce5e9'
ReferenceId = 'MSSqlServersAuditingEnabled'
Version = '2.*.*'
Parameters = @{
setting = 'enabled'
}
}
PolicyDefinition -Id 'abfb4388-5bf4-4ad7-ba82-2cd2f41ceae9' -ReferenceId 'MSSqlServersDefenderEnabled' -Version '2.*.*'
PolicyDefinition @{
Id = 'abfb7388-5bf4-4ad7-ba99-2cd2f41cebb9'
ReferenceId = 'MSSqlManagedInstancesDefenderEnabled'
Version = '1.*.*'
}
PolicyDefinition @{
Id = 'c5a62eb0-c65a-4220-8a4d-f70dd4ca95dd'
ReferenceId = 'MSSqlManagedInstancesDefenderConfigured'
Version = '2.*.*'
}
PolicyDefinition @{
Id = '36d49e87-48c4-4f2e-beed-ba4ed02b71f5'
ReferenceId = 'MSSqlServersDefenderConfigured'
Version = '2.*.*'
}
PolicyDefinition @{
Id = 'feedbf84-6b99-488c-acc2-71c829aa5ffc'
ReferenceId = 'MSSqlDatabasesVulnerabilitiesResolved'
Version = '4.*.*'
}
PolicyDefinition @{
Id = '89099bee-89e0-4b26-a5f4-165451757743'
ReferenceId = 'MSSqlServersAuditingRetention'
Version = '3.*.*'
}
PolicyDefinition @{
Id = '1b7aa243-30e4-4c9e-bca8-d0d3022b634a'
ReferenceId = 'MSSqlManagedInstancesVulnerabilityAssessmentEnabled'
Version = '1.*.*'
}
PolicyDefinition @{
Id = 'ef2a8f2a-b3d9-49cd-a8a8-9a3aaaf647d9'
ReferenceId = 'MSSqlServersVulnerabilityAssessmentEnabled'
Version = '3.*.*'
}
}Members (24)
- SQL managed instances should use customer-managed keys to encrypt data at rest
- SQL servers should use customer-managed keys to encrypt data at rest
- SQL Managed Instance should have the minimal TLS version of 1.2
- Azure SQL Database should be running TLS version 1.2 or newer
- Transparent Data Encryption on SQL databases should be enabled
- Azure SQL Managed Instances should disable public network access
- Public network access on Azure SQL Database should be disabled
- Private endpoint connections on Azure SQL Database should be enabled
- Azure SQL Database should be running TLS version 1.2 or newer
- Configure Azure SQL Server to disable public network access
- Deploy SQL DB transparent data encryption
- SQL Server should use a virtual network service endpoint
- An Azure Active Directory administrator should be provisioned for SQL servers
- Azure SQL logical servers should have Microsoft Entra-only authentication enabled during creation
- Azure SQL Managed Instances should have Microsoft Entra-only authentication enabled during creation
- Auditing on SQL server should be enabled
- Azure Defender for SQL should be enabled for unprotected Azure SQL servers
- Azure Defender for SQL should be enabled for unprotected SQL Managed Instances
- Configure Azure Defender to be enabled on SQL managed instances
- Configure Azure Defender to be enabled on SQL servers
- SQL databases should have vulnerability findings resolved
- SQL servers with auditing to storage account destination should be configured with 90 days retention or higher
- Vulnerability assessment should be enabled on SQL Managed Instance
- Vulnerability assessment should be enabled on your SQL servers
Source: built-in-policies/policySetDefinitions/VirtualEnclaves/MSSqlInitiative.json in Azure/azure-policy, under the MIT licence.
Bylaw