Bylaw

Gallery › Data Factory › Azure built-in policies

Public network access on Azure Data Factory should be disabled

Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0

Disabling the public network access property improves security by ensuring your Azure Data Factory can only be accessed from a private endpoint.

ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.

Azure Policy JSONPublicNetworkAccess_Audit.json · 50 lines
{
  "properties": {
    "displayName": "Public network access on Azure Data Factory should be disabled",
    "description": "Disabling the public network access property improves security by ensuring your Azure Data Factory can only be accessed from a private endpoint.",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "metadata": {
      "version": "1.0.0",
      "category": "Data Factory"
    },
    "version": "1.0.0",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.DataFactory/factories"
          },
          {
            "field": "Microsoft.DataFactory/factories/publicNetworkAccess",
            "notEquals": "Disabled"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/1cf164be-6819-4a50-b8fa-4bcaa4f98fb6",
  "name": "1cf164be-6819-4a50-b8fa-4bcaa4f98fb6"
}
Bylaw1cf164be-6819-4a50-b8fa-4bcaa4f98fb6.bylaw.ps1 · 28 lines
# Converted from PublicNetworkAccess_Audit.json by ConvertTo-Bylaw.
Policy '1cf164be-6819-4a50-b8fa-4bcaa4f98fb6' {

    Properties @{
        DisplayName   = 'Public network access on Azure Data Factory should be disabled'
        Description   = 'Disabling the public network access property improves security by ensuring your Azure Data Factory can only be accessed from a private endpoint.'
        Version       = '1.0.0'
        Category      = 'Data Factory'
        PolicyVersion = '1.0.0'
        Mode          = 'Indexed'
    }

    Parameter Effect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Audit'
        DisplayName   = 'Effect'
        Description   = 'Enable or disable the execution of the policy'
    }

    Resource 'Microsoft.DataFactory/factories' {

        Require 'publicNetworkAccess is Disabled' {
            Field publicNetworkAccess | Must -Be 'Disabled'
        }
    }

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/Data Factory/PublicNetworkAccess_Audit.json in Azure/azure-policy, under the MIT licence.