Bylaw

Gallery › Sovereignty › Azure built-in policies

[Preview]: Azure Health Data Services workspaces should disable public network access

Converted Policy Audit Disabled Mode Indexed Version 1.0.0-preview Preview

Disabling public network access improves security by ensuring that Azure Health Data Services workspaces aren't exposed on the public internet. You can limit exposure of your workspaces by creating private endpoints instead.

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

Azure Policy JSONHealthDataServicesWorkspace_PublicNetworkAccess_Audit.json · 58 lines
{
  "properties": {
    "displayName": "[Preview]: Azure Health Data Services workspaces should disable public network access",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Disabling public network access improves security by ensuring that Azure Health Data Services workspaces aren't exposed on the public internet. You can limit exposure of your workspaces by creating private endpoints instead.",
    "metadata": {
      "version": "1.0.0-preview",
      "category": "Sovereignty",
      "preview": true
    },
    "version": "1.0.0-preview",
    "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.HealthcareApis/workspaces"
          },
          {
            "anyOf": [
              {
                "field": "Microsoft.HealthcareApis/workspaces/publicNetworkAccess",
                "exists": "false"
              },
              {
                "field": "Microsoft.HealthcareApis/workspaces/publicNetworkAccess",
                "notEquals": "Disabled"
              }
            ]
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/093e16cd-84e0-4332-b550-82f55cf85f28",
  "name": "093e16cd-84e0-4332-b550-82f55cf85f28"
}
Bylaw093e16cd-84e0-4332-b550-82f55cf85f28.bylaw.ps1 · 33 lines
# Converted from HealthDataServicesWorkspace_PublicNetworkAccess_Audit.json by ConvertTo-Bylaw.
Policy '093e16cd-84e0-4332-b550-82f55cf85f28' {

    Properties @{
        DisplayName   = '[Preview]: Azure Health Data Services workspaces should disable public network access'
        Description   = 'Disabling public network access improves security by ensuring that Azure Health Data Services workspaces aren''t exposed on the public internet. You can limit exposure of your workspaces by creating private endpoints instead.'
        Version       = '1.0.0-preview'
        Category      = 'Sovereignty'
        Preview       = $true
        PolicyVersion = '1.0.0-preview'
        Mode          = 'Indexed'
    }

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

    Resource 'Microsoft.HealthcareApis/workspaces' {

        Require 'publicNetworkAccess exists' {
            Field publicNetworkAccess | Must -Exist
        }

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

    Effect (Param Effect)
}

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