Bylaw

Gallery › Synapse › Azure built-in policies

IP firewall rules on Azure Synapse workspaces should be removed

Converted Policy Audit Disabled Mode All Version 1.0.0

Removing all IP firewall rules improves security by ensuring your Azure Synapse workspace can only be accessed from a private endpoint. This configuration audits creation of firewall rules that allow public network access on the workspace.

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

Azure Policy JSONWorkspaceFirewallRules_Audit.json · 49 lines
{
  "properties": {
    "displayName": "IP firewall rules on Azure Synapse workspaces should be removed",
    "description": "Removing all IP firewall rules improves security by ensuring your Azure Synapse workspace can only be accessed from a private endpoint. This configuration audits creation of firewall rules that allow public network access on the workspace.",
    "policyType": "BuiltIn",
    "mode": "All",
    "metadata": {
      "version": "1.0.0",
      "category": "Synapse"
    },
    "version": "1.0.0",
    "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.Synapse/workspaces/firewallrules"
          },
          {
            "field": "name",
            "exists": "true"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/56fd377d-098c-4f02-8406-81eb055902b8",
  "name": "56fd377d-098c-4f02-8406-81eb055902b8"
}
Bylaw56fd377d-098c-4f02-8406-81eb055902b8.bylaw.ps1 · 28 lines
# Converted from WorkspaceFirewallRules_Audit.json by ConvertTo-Bylaw.
Policy '56fd377d-098c-4f02-8406-81eb055902b8' {

    Properties @{
        DisplayName   = 'IP firewall rules on Azure Synapse workspaces should be removed'
        Description   = 'Removing all IP firewall rules improves security by ensuring your Azure Synapse workspace can only be accessed from a private endpoint. This configuration audits creation of firewall rules that allow public network access on the workspace.'
        Version       = '1.0.0'
        Category      = 'Synapse'
        PolicyVersion = '1.0.0'
        Mode          = 'All'
    }

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

    Resource 'Microsoft.Synapse/workspaces/firewallrules' {

        Require 'name does not exist' {
            Field name | Must -Not -Exist
        }
    }

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/Synapse/WorkspaceFirewallRules_Audit.json in Azure/azure-policy, under the MIT licence.