Gallery › Cognitive Services › Azure Landing Zones Library
Enforce recommended guardrails for Cognitive Services
Converted Initiative Version 1.2.0
This policy initiative is a group of policies that ensures Cognitive Services is compliant per regulated Landing Zones.
ConvertTo-Bylaw converted this initiative, and proved that the file compiles back to the same definition.
Azure Policy JSONEnforce-Guardrails-CognitiveServices.alz_policy_set_definition.json · 198 lines
{
"name": "Enforce-Guardrails-CognitiveServices",
"properties": {
"description": "This policy initiative is a group of policies that ensures Cognitive Services is compliant per regulated Landing Zones.",
"displayName": "Enforce recommended guardrails for Cognitive Services",
"metadata": {
"alzCloudEnvironments": [
"AzureCloud",
"AzureChinaCloud",
"AzureUSGovernment"
],
"category": "Cognitive Services",
"source": "https://github.com/Azure/Enterprise-Scale/",
"version": "1.2.0"
},
"parameters": {
"cognitiveSearchLocalAuth": {
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Deny",
"type": "string"
},
"cognitiveSearchSku": {
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Deny",
"type": "string"
},
"cognitiveServicesCustomerStorage": {
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Deny",
"type": "string"
},
"cognitiveServicesLocalAuth": {
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify",
"type": "string"
},
"cognitiveServicesManagedIdentity": {
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Deny",
"type": "string"
},
"cognitiveServicesModifyPublicNetworkAccess": {
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify",
"type": "string"
},
"cognitiveServicesResourceLogs": {
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"defaultValue": "AuditIfNotExists",
"type": "string"
},
"modifyCognitiveSearchLocalAuth": {
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify",
"type": "string"
},
"modifyCognitiveSearchPublicEndpoint": {
"allowedValues": [
"Modify",
"Disabled"
],
"defaultValue": "Modify",
"type": "string"
}
},
"policyDefinitions": [
{
"definitionVersion": "1.*.*",
"groupNames": [],
"parameters": {
"effect": {
"value": "[parameters('cognitiveSearchSku')]"
}
},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a049bf77-880b-470f-ba6d-9f21c530cf83",
"policyDefinitionReferenceId": "Deny-CognitiveSearch-SKU"
},
{
"definitionVersion": "1.*.*",
"groupNames": [],
"parameters": {
"effect": {
"value": "[parameters('cognitiveSearchLocalAuth')]"
}
},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/6300012e-e9a4-4649-b41f-a85f5c43be91",
"policyDefinitionReferenceId": "Deny-CongitiveSearch-LocalAuth"
},
{
"definitionVersion": "1.*.*",
"groupNames": [],
"parameters": {
"effect": {
"value": "[parameters('modifyCognitiveSearchLocalAuth')]"
}
},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/4eb216f2-9dba-4979-86e6-5d7e63ce3b75",
"policyDefinitionReferenceId": "Modify-CogntiveSearch-LocalAuth"
},
{
"definitionVersion": "1.*.*",
"groupNames": [],
"parameters": {
"effect": {
"value": "[parameters('modifyCognitiveSearchPublicEndpoint')]"
}
},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9cee519f-d9c1-4fd9-9f79-24ec3449ed30",
"policyDefinitionReferenceId": "Modify-CogntiveSearch-PublicEndpoint"
},
{
"definitionVersion": "3.*.*",
"groupNames": [],
"parameters": {
"effect": {
"value": "[parameters('cognitiveServicesModifyPublicNetworkAccess')]"
}
},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/47ba1dd7-28d9-4b07-a8d5-9813bed64e0c",
"policyDefinitionReferenceId": "Modify-Cognitive-Services-Public-Network-Access"
},
{
"definitionVersion": "1.*.*",
"groupNames": [],
"parameters": {
"effect": {
"value": "[parameters('cognitiveServicesManagedIdentity')]"
}
},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/fe3fd216-4f83-4fc1-8984-2bbec80a3418",
"policyDefinitionReferenceId": "Deny-Cognitive-Services-Managed-Identity"
},
{
"definitionVersion": "2.*.*",
"groupNames": [],
"parameters": {
"effect": {
"value": "[parameters('cognitiveServicesCustomerStorage')]"
}
},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/46aa9b05-0e60-4eae-a88b-1e9d374fa515",
"policyDefinitionReferenceId": "Deny-Cognitive-Services-Customer-Storage"
},
{
"definitionVersion": "1.*.*",
"groupNames": [],
"parameters": {
"effect": {
"value": "[parameters('cognitiveServicesLocalAuth')]"
}
},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/14de9e63-1b31-492e-a5a3-c3f7fd57f555",
"policyDefinitionReferenceId": "Modify-Cognitive-Services-Local-Auth"
},
{
"definitionVersion": "5.*.*",
"groupNames": [],
"parameters": {
"effect": {
"value": "[parameters('cognitiveServicesResourceLogs')]"
}
},
"policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b4330a05-a843-4bc8-bf9a-cacce50c67f4",
"policyDefinitionReferenceId": "Aine-Cognitive-Services-Resource-Logs"
}
],
"policyType": "Custom"
},
"type": "Microsoft.Authorization/policySetDefinitions"
}BylawEnforce-Guardrails-CognitiveServices.bylaw.ps1 · 138 lines
# Converted from Enforce-Guardrails-CognitiveServices.alz_policy_set_definition.json by ConvertTo-Bylaw.
Initiative 'Enforce-Guardrails-CognitiveServices' {
Properties @{
DisplayName = 'Enforce recommended guardrails for Cognitive Services'
Description = 'This policy initiative is a group of policies that ensures Cognitive Services is compliant per regulated Landing Zones.'
Category = 'Cognitive Services'
Version = '1.2.0'
Metadata = [ordered]@{ alzCloudEnvironments = @('AzureCloud', 'AzureChinaCloud', 'AzureUSGovernment'); source = 'https://github.com/Azure/Enterprise-Scale/' }
}
Parameter CognitiveSearchLocalAuth @{
Type = 'string'
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Deny'
}
Parameter CognitiveSearchSku @{
Type = 'string'
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Deny'
}
Parameter CognitiveServicesCustomerStorage @{
Type = 'string'
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Deny'
}
Parameter CognitiveServicesLocalAuth @{
Type = 'string'
AllowedValues = @('Modify', 'Disabled')
Default = 'Modify'
}
Parameter CognitiveServicesManagedIdentity @{
Type = 'string'
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Deny'
}
Parameter CognitiveServicesModifyPublicNetworkAccess @{
Type = 'string'
AllowedValues = @('Modify', 'Disabled')
Default = 'Modify'
}
Parameter CognitiveServicesResourceLogs @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
}
Parameter ModifyCognitiveSearchLocalAuth @{
Type = 'string'
AllowedValues = @('Modify', 'Disabled')
Default = 'Modify'
}
Parameter ModifyCognitiveSearchPublicEndpoint @{
Type = 'string'
AllowedValues = @('Modify', 'Disabled')
Default = 'Modify'
}
PolicyDefinition @{
Id = 'a049bf77-880b-470f-ba6d-9f21c530cf83'
ReferenceId = 'Deny-CognitiveSearch-SKU'
Version = '1.*.*'
Parameters = @{
effect = (Param CognitiveSearchSku)
}
}
PolicyDefinition @{
Id = '6300012e-e9a4-4649-b41f-a85f5c43be91'
ReferenceId = 'Deny-CongitiveSearch-LocalAuth'
Version = '1.*.*'
Parameters = @{
effect = (Param CognitiveSearchLocalAuth)
}
}
PolicyDefinition @{
Id = '4eb216f2-9dba-4979-86e6-5d7e63ce3b75'
ReferenceId = 'Modify-CogntiveSearch-LocalAuth'
Version = '1.*.*'
Parameters = @{
effect = (Param ModifyCognitiveSearchLocalAuth)
}
}
PolicyDefinition @{
Id = '9cee519f-d9c1-4fd9-9f79-24ec3449ed30'
ReferenceId = 'Modify-CogntiveSearch-PublicEndpoint'
Version = '1.*.*'
Parameters = @{
effect = (Param ModifyCognitiveSearchPublicEndpoint)
}
}
PolicyDefinition @{
Id = '47ba1dd7-28d9-4b07-a8d5-9813bed64e0c'
ReferenceId = 'Modify-Cognitive-Services-Public-Network-Access'
Version = '3.*.*'
Parameters = @{
effect = (Param CognitiveServicesModifyPublicNetworkAccess)
}
}
PolicyDefinition @{
Id = 'fe3fd216-4f83-4fc1-8984-2bbec80a3418'
ReferenceId = 'Deny-Cognitive-Services-Managed-Identity'
Version = '1.*.*'
Parameters = @{
effect = (Param CognitiveServicesManagedIdentity)
}
}
PolicyDefinition @{
Id = '46aa9b05-0e60-4eae-a88b-1e9d374fa515'
ReferenceId = 'Deny-Cognitive-Services-Customer-Storage'
Version = '2.*.*'
Parameters = @{
effect = (Param CognitiveServicesCustomerStorage)
}
}
PolicyDefinition @{
Id = '14de9e63-1b31-492e-a5a3-c3f7fd57f555'
ReferenceId = 'Modify-Cognitive-Services-Local-Auth'
Version = '1.*.*'
Parameters = @{
effect = (Param CognitiveServicesLocalAuth)
}
}
PolicyDefinition @{
Id = 'b4330a05-a843-4bc8-bf9a-cacce50c67f4'
ReferenceId = 'Aine-Cognitive-Services-Resource-Logs'
Version = '5.*.*'
Parameters = @{
effect = (Param CognitiveServicesResourceLogs)
}
}
}Members (9)
- Azure AI Search service should use a SKU that supports private link
- Azure AI Search services should have local authentication methods disabled
- Configure Azure AI Search services to disable local authentication
- Configure Azure AI Search services to disable public network access
- Configure Cognitive Services accounts to disable public network access
- Cognitive Services accounts should use a managed identity
- Cognitive Services accounts should use customer owned storage
- Configure Cognitive Services accounts to disable local authentication methods
- Resource logs in Search services should be enabled
Source: policy_set_definitions/Enforce-Guardrails-CognitiveServices.alz_policy_set_definition.json in Azure/Azure-Landing-Zones-Library, under the MIT licence.
Bylaw