Gallery › Stream Analytics › Azure built-in policies
Stream Analytics job should connect to trusted inputs and outputs
Converted Policy Audit Deny Disabled Mode All Version 1.2.0
Ensure that Stream Analytics jobs do not have arbitrary Input, Output, or Function binding connections that are not defined in the allow-list. This checks that Stream Analytics jobs don't exfiltrate data by connecting to arbitrary sinks outside your organization.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONDataExfiltration_Audit.json · 469 lines
{
"properties": {
"displayName": "Stream Analytics job should connect to trusted inputs and outputs",
"policyType": "BuiltIn",
"mode": "All",
"description": "Ensure that Stream Analytics jobs do not have arbitrary Input, Output, or Function binding connections that are not defined in the allow-list. This checks that Stream Analytics jobs don't exfiltrate data by connecting to arbitrary sinks outside your organization.",
"metadata": {
"version": "1.2.0",
"category": "Stream Analytics"
},
"version": "1.2.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "The desired effect of the policy."
},
"allowedValues": [
"Deny",
"Audit",
"Disabled"
],
"defaultValue": "Audit"
},
"allowedEventHubNamespaces": {
"type": "Array",
"metadata": {
"displayName": "List of allowed Event Hub namespaces"
},
"defaultValue": []
},
"allowedSQLServers": {
"type": "Array",
"metadata": {
"displayName": "List of allowed SQL servers"
},
"defaultValue": []
},
"allowedStorageAccounts": {
"type": "Array",
"metadata": {
"displayName": "List of allowed storage accounts"
},
"defaultValue": []
},
"allowedCosmosAccounts": {
"type": "Array",
"metadata": {
"displayName": "List of allowed Cosmos DB accounts"
},
"defaultValue": []
},
"allowedAzureFunctionAccounts": {
"type": "Array",
"metadata": {
"displayName": "List of allowed Function Apps"
},
"defaultValue": []
},
"allowedIoTHubNamespaces": {
"type": "Array",
"metadata": {
"displayName": "List of allowed IoT Hubs"
},
"defaultValue": []
},
"allowedMLWebServiceEndpoints": {
"type": "Array",
"metadata": {
"displayName": "List of allowed ML Web Service endpoints"
},
"defaultValue": []
},
"allowedServiceBusNamespaces": {
"type": "Array",
"metadata": {
"displayName": "List of allowed Service Bus namespaces",
"description": "Used for Service Bus Queue and Service Bus Topic outputs."
},
"defaultValue": []
},
"allowedDataLakeAccounts": {
"type": "Array",
"metadata": {
"displayName": "List of allowed Data Lake Store accounts"
},
"defaultValue": []
},
"allowedMLServicesEndpoints": {
"type": "Array",
"metadata": {
"displayName": "Allowed Azure Machine Learning service endpoints",
"description": "List of Azure Machine Learning service (Microsoft.MachineLearningServices) scoring endpoints permitted as function bindings. An empty list denies all Azure ML service function bindings."
},
"defaultValue": []
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"in": [
"Microsoft.StreamAnalytics/streamingjobs/outputs",
"Microsoft.StreamAnalytics/streamingjobs/inputs",
"Microsoft.StreamAnalytics/streamingjobs/functions",
"Microsoft.StreamAnalytics/streamingjobs"
]
},
{
"anyOf": [
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.StreamAnalytics/streamingjobs/outputs"
},
{
"anyOf": [
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"equals": "Microsoft.EventHub/EventHub"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-ServiceBus-EventHub.serviceBusNamespace",
"notIn": "[parameters('allowedEventHubNamespaces')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"equals": "Microsoft.Sql/Server/Database"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-Sql-Server-Database.server",
"notIn": "[parameters('allowedSQLServers')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"equals": "Microsoft.Storage/Table"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-Storage-Table.accountName",
"notIn": "[parameters('allowedStorageAccounts')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"equals": "Microsoft.Storage/DocumentDB"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-Storage-DocumentDB.accountId",
"notIn": "[parameters('allowedCosmosAccounts')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"equals": "Microsoft.AzureFunction"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-AzureFunction.functionAppName",
"notIn": "[parameters('allowedAzureFunctionAccounts')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"equals": "Microsoft.Storage/Blob"
},
{
"count": {
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-Storage-Blob.storageAccounts[*]",
"where": {
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-Storage-Blob.storageAccounts[*].accountName",
"notIn": "[parameters('allowedStorageAccounts')]"
}
},
"greater": 0
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"equals": "Microsoft.ServiceBus/EventHub"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-ServiceBus-EventHub.serviceBusNamespace",
"notIn": "[parameters('allowedEventHubNamespaces')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"equals": "Microsoft.ServiceBus/Queue"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-ServiceBus-Queue.serviceBusNamespace",
"notIn": "[parameters('allowedServiceBusNamespaces')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"equals": "Microsoft.ServiceBus/Topic"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-ServiceBus-Topic.serviceBusNamespace",
"notIn": "[parameters('allowedServiceBusNamespaces')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"equals": "Microsoft.DataLake/Accounts"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-DataLake-Accounts.accountName",
"notIn": "[parameters('allowedDataLakeAccounts')]"
}
]
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type",
"notIn": [
"Microsoft.EventHub/EventHub",
"Microsoft.Sql/Server/Database",
"Microsoft.Storage/Table",
"Microsoft.Storage/DocumentDB",
"Microsoft.AzureFunction",
"Microsoft.Storage/Blob",
"Microsoft.ServiceBus/EventHub",
"Microsoft.ServiceBus/Queue",
"Microsoft.ServiceBus/Topic",
"Microsoft.DataLake/Accounts"
]
}
]
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.StreamAnalytics/streamingjobs/inputs"
},
{
"anyOf": [
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type",
"equals": "Microsoft.EventHub/EventHub"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-ServiceBus-EventHub.serviceBusNamespace",
"notIn": "[parameters('allowedEventHubNamespaces')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type",
"equals": "Microsoft.Devices/IotHubs"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-Devices-IotHubs.iotHubNamespace",
"notIn": "[parameters('allowedIoTHubNamespaces')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Reference.datasource.type",
"equals": "Microsoft.Sql/Server/Database"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Reference.datasource.Microsoft-Sql-Server-Database.server",
"notIn": "[parameters('allowedSQLServers')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type",
"equals": "Microsoft.Storage/Blob"
},
{
"count": {
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-Storage-Blob.storageAccounts[*]",
"where": {
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-Storage-Blob.storageAccounts[*].accountName",
"notIn": "[parameters('allowedStorageAccounts')]"
}
},
"greater": 0
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Reference.datasource.type",
"equals": "Microsoft.Storage/Blob"
},
{
"count": {
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Reference.datasource.Microsoft-Storage-Blob.storageAccounts[*]",
"where": {
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Reference.datasource.Microsoft-Storage-Blob.storageAccounts[*].accountName",
"notIn": "[parameters('allowedStorageAccounts')]"
}
},
"greater": 0
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type",
"equals": "Microsoft.ServiceBus/EventHub"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-ServiceBus-EventHub.serviceBusNamespace",
"notIn": "[parameters('allowedEventHubNamespaces')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type",
"equals": "Microsoft.EventGrid/EventSubscriptions"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-EventGrid-EventSubscriptions.subscriber.serviceBusNamespace",
"notIn": "[parameters('allowedEventHubNamespaces')]"
}
]
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type",
"notIn": [
"Microsoft.EventHub/EventHub",
"Microsoft.Devices/IotHubs",
"Microsoft.Sql/Server/Database",
"Microsoft.Storage/Blob",
"Microsoft.ServiceBus/EventHub",
"Microsoft.EventGrid/EventSubscriptions"
]
}
]
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.StreamAnalytics/streamingjobs/functions"
},
{
"anyOf": [
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/functions/binding.type",
"equals": "Microsoft.MachineLearning/WebService"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/functions/binding.Microsoft-MachineLearning-WebService.endpoint",
"notIn": "[parameters('allowedMLWebServiceEndpoints')]"
}
]
},
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/functions/binding.type",
"equals": "Microsoft.MachineLearningServices"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/functions/binding.Microsoft-MachineLearningServices.endpoint",
"notIn": "[parameters('allowedMLServicesEndpoints')]"
}
]
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/functions/binding.type",
"notIn": [
"Microsoft.MachineLearning/WebService",
"Microsoft.MachineLearningServices",
"Microsoft.StreamAnalytics/JavascriptUdf",
"Microsoft.StreamAnalytics/CLRUdf"
]
}
]
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.StreamAnalytics/streamingjobs"
},
{
"anyOf": [
{
"allOf": [
{
"field": "Microsoft.StreamAnalytics/streamingjobs/jobStorageAccount",
"exists": "true"
},
{
"field": "Microsoft.StreamAnalytics/streamingjobs/jobStorageAccount.accountName",
"notIn": "[parameters('allowedStorageAccounts')]"
}
]
}
]
}
]
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.2.0",
"1.1.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/fe8684d6-3c5b-45c0-a08b-fa92653c2e1c",
"name": "fe8684d6-3c5b-45c0-a08b-fa92653c2e1c"
}Bylawfe8684d6-3c5b-45c0-a08b-fa92653c2e1c.bylaw.ps1 · 201 lines
# Converted from DataExfiltration_Audit.json by ConvertTo-Bylaw.
Policy 'fe8684d6-3c5b-45c0-a08b-fa92653c2e1c' {
Properties @{
DisplayName = 'Stream Analytics job should connect to trusted inputs and outputs'
Description = 'Ensure that Stream Analytics jobs do not have arbitrary Input, Output, or Function binding connections that are not defined in the allow-list. This checks that Stream Analytics jobs don''t exfiltrate data by connecting to arbitrary sinks outside your organization.'
Version = '1.2.0'
Category = 'Stream Analytics'
PolicyVersion = '1.2.0'
Mode = 'All'
}
Parameter Effect @{
AllowedValues = @('Deny', 'Audit', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'The desired effect of the policy.'
}
Parameter AllowedEventHubNamespaces @{
Type = 'Array'
Default = @()
DisplayName = 'List of allowed Event Hub namespaces'
}
Parameter AllowedSQLServers @{
Type = 'Array'
Default = @()
DisplayName = 'List of allowed SQL servers'
}
Parameter AllowedStorageAccounts @{
Type = 'Array'
Default = @()
DisplayName = 'List of allowed storage accounts'
}
Parameter AllowedCosmosAccounts @{
Type = 'Array'
Default = @()
DisplayName = 'List of allowed Cosmos DB accounts'
}
Parameter AllowedAzureFunctionAccounts @{
Type = 'Array'
Default = @()
DisplayName = 'List of allowed Function Apps'
}
Parameter AllowedIoTHubNamespaces @{
Type = 'Array'
Default = @()
DisplayName = 'List of allowed IoT Hubs'
}
Parameter AllowedMLWebServiceEndpoints @{
Type = 'Array'
Default = @()
DisplayName = 'List of allowed ML Web Service endpoints'
}
Parameter AllowedServiceBusNamespaces @{
Type = 'Array'
Default = @()
DisplayName = 'List of allowed Service Bus namespaces'
Description = 'Used for Service Bus Queue and Service Bus Topic outputs.'
}
Parameter AllowedDataLakeAccounts @{
Type = 'Array'
Default = @()
DisplayName = 'List of allowed Data Lake Store accounts'
}
Parameter AllowedMLServicesEndpoints @{
Type = 'Array'
Default = @()
DisplayName = 'Allowed Azure Machine Learning service endpoints'
Description = 'List of Azure Machine Learning service (Microsoft.MachineLearningServices) scoring endpoints permitted as function bindings. An empty list denies all Azure ML service function bindings.'
}
Resource * {
When {
Field type | Must -BeIn @('Microsoft.StreamAnalytics/streamingjobs/outputs', 'Microsoft.StreamAnalytics/streamingjobs/inputs', 'Microsoft.StreamAnalytics/streamingjobs/functions', 'Microsoft.StreamAnalytics/streamingjobs')
}
Require 'type, datasource.type, datasource.Microsoft-ServiceBus-EventHub.serviceBusNamespace and 9 more are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.StreamAnalytics/streamingjobs/outputs' -IfPresent
AllOf {
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -Not -Be 'Microsoft.EventHub/EventHub' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-ServiceBus-EventHub.serviceBusNamespace' | Must -BeIn (Param AllowedEventHubNamespaces)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -Not -Be 'Microsoft.Sql/Server/Database' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-Sql-Server-Database.server' | Must -BeIn (Param AllowedSQLServers)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -Not -Be 'Microsoft.Storage/Table' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-Storage-Table.accountName' | Must -BeIn (Param AllowedStorageAccounts)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -Not -Be 'Microsoft.Storage/DocumentDB' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-Storage-DocumentDB.accountId' | Must -BeIn (Param AllowedCosmosAccounts)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -Not -Be 'Microsoft.AzureFunction' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-AzureFunction.functionAppName' | Must -BeIn (Param AllowedAzureFunctionAccounts)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -Not -Be 'Microsoft.Storage/Blob' -IfPresent
Each 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-Storage-Blob.storageAccounts[*]' {
Field accountName | Must -BeIn (Param AllowedStorageAccounts) -Strict
}
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -Not -Be 'Microsoft.ServiceBus/EventHub' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-ServiceBus-EventHub.serviceBusNamespace' | Must -BeIn (Param AllowedEventHubNamespaces)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -Not -Be 'Microsoft.ServiceBus/Queue' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-ServiceBus-Queue.serviceBusNamespace' | Must -BeIn (Param AllowedServiceBusNamespaces)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -Not -Be 'Microsoft.ServiceBus/Topic' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-ServiceBus-Topic.serviceBusNamespace' | Must -BeIn (Param AllowedServiceBusNamespaces)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -Not -Be 'Microsoft.DataLake/Accounts' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.Microsoft-DataLake-Accounts.accountName' | Must -BeIn (Param AllowedDataLakeAccounts)
}
Field 'Microsoft.StreamAnalytics/streamingjobs/outputs/datasource.type' | Must -BeIn @('Microsoft.EventHub/EventHub', 'Microsoft.Sql/Server/Database', 'Microsoft.Storage/Table', 'Microsoft.Storage/DocumentDB', 'Microsoft.AzureFunction', 'Microsoft.Storage/Blob', 'Microsoft.ServiceBus/EventHub', 'Microsoft.ServiceBus/Queue', 'Microsoft.ServiceBus/Topic', 'Microsoft.DataLake/Accounts')
}
}
}
Require 'type, Stream.datasource.type, Stream.datasource.Microsoft-ServiceBus-EventHub.serviceBusNamespace and 7 more are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.StreamAnalytics/streamingjobs/inputs' -IfPresent
AllOf {
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type' | Must -Not -Be 'Microsoft.EventHub/EventHub' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-ServiceBus-EventHub.serviceBusNamespace' | Must -BeIn (Param AllowedEventHubNamespaces)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type' | Must -Not -Be 'Microsoft.Devices/IotHubs' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-Devices-IotHubs.iotHubNamespace' | Must -BeIn (Param AllowedIoTHubNamespaces)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Reference.datasource.type' | Must -Not -Be 'Microsoft.Sql/Server/Database' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Reference.datasource.Microsoft-Sql-Server-Database.server' | Must -BeIn (Param AllowedSQLServers)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type' | Must -Not -Be 'Microsoft.Storage/Blob' -IfPresent
Each 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-Storage-Blob.storageAccounts[*]' {
Field accountName | Must -BeIn (Param AllowedStorageAccounts) -Strict
}
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Reference.datasource.type' | Must -Not -Be 'Microsoft.Storage/Blob' -IfPresent
Each 'Microsoft.StreamAnalytics/streamingjobs/inputs/Reference.datasource.Microsoft-Storage-Blob.storageAccounts[*]' {
Field accountName | Must -BeIn (Param AllowedStorageAccounts) -Strict
}
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type' | Must -Not -Be 'Microsoft.ServiceBus/EventHub' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-ServiceBus-EventHub.serviceBusNamespace' | Must -BeIn (Param AllowedEventHubNamespaces)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type' | Must -Not -Be 'Microsoft.EventGrid/EventSubscriptions' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.Microsoft-EventGrid-EventSubscriptions.subscriber.serviceBusNamespace' | Must -BeIn (Param AllowedEventHubNamespaces)
}
Field 'Microsoft.StreamAnalytics/streamingjobs/inputs/Stream.datasource.type' | Must -BeIn @('Microsoft.EventHub/EventHub', 'Microsoft.Devices/IotHubs', 'Microsoft.Sql/Server/Database', 'Microsoft.Storage/Blob', 'Microsoft.ServiceBus/EventHub', 'Microsoft.EventGrid/EventSubscriptions')
}
}
}
Require 'type, binding.type, binding.Microsoft-MachineLearning-WebService.endpoint and 1 more are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.StreamAnalytics/streamingjobs/functions' -IfPresent
AllOf {
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/functions/binding.type' | Must -Not -Be 'Microsoft.MachineLearning/WebService' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/functions/binding.Microsoft-MachineLearning-WebService.endpoint' | Must -BeIn (Param AllowedMLWebServiceEndpoints)
}
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/functions/binding.type' | Must -Not -Be 'Microsoft.MachineLearningServices' -IfPresent
Field 'Microsoft.StreamAnalytics/streamingjobs/functions/binding.Microsoft-MachineLearningServices.endpoint' | Must -BeIn (Param AllowedMLServicesEndpoints)
}
Field 'Microsoft.StreamAnalytics/streamingjobs/functions/binding.type' | Must -BeIn @('Microsoft.MachineLearning/WebService', 'Microsoft.MachineLearningServices', 'Microsoft.StreamAnalytics/JavascriptUdf', 'Microsoft.StreamAnalytics/CLRUdf')
}
}
}
Require 'type, jobStorageAccount and jobStorageAccount.accountName are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.StreamAnalytics/streamingjobs' -IfPresent
AllOf {
AnyOf {
Field 'Microsoft.StreamAnalytics/streamingjobs/jobStorageAccount' | Must -Not -Exist
Field 'Microsoft.StreamAnalytics/streamingjobs/jobStorageAccount.accountName' | Must -BeIn (Param AllowedStorageAccounts)
}
}
}
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Stream Analytics/DataExfiltration_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw