Bylaw

Gallery › Health Deidentification Service › Azure built-in policies

Azure Health Data Services de-identification service should use private link

Converted Policy Audit Disabled Mode Indexed Version 1.0.0

Azure Health Data Services de-identification service should have at least one approved private endpoint connection. Clients in a virtual network can securely access resources that have private endpoint connections through private links.

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

Azure Policy JSONHealthDeidentification_PrivateLink_Audit.json · 55 lines
{
  "properties": {
    "displayName": "Azure Health Data Services de-identification service should use private link",
    "policyType": "BuiltIn",
    "description": "Azure Health Data Services de-identification service should have at least one approved private endpoint connection. Clients in a virtual network can securely access resources that have private endpoint connections through private links.",
    "mode": "Indexed",
    "metadata": {
      "version": "1.0.0",
      "category": "Health Deidentification Service"
    },
    "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.HealthDataAIServices/deidServices"
          },
          {
            "count": {
              "field": "Microsoft.HealthDataAIServices/deidServices/privateEndpointConnections[*]",
              "where": {
                "field": "Microsoft.HealthDataAIServices/deidServices/privateEndpointConnections[*].privateLinkServiceConnectionState.status",
                "equals": "Approved"
              }
            },
            "less": 1
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/d9b2d63d-a233-4123-847a-7f7e5f5d7e7a",
  "name": "d9b2d63d-a233-4123-847a-7f7e5f5d7e7a"
}
Bylawd9b2d63d-a233-4123-847a-7f7e5f5d7e7a.bylaw.ps1 · 30 lines
# Converted from HealthDeidentification_PrivateLink_Audit.json by ConvertTo-Bylaw.
Policy 'd9b2d63d-a233-4123-847a-7f7e5f5d7e7a' {

    Properties @{
        DisplayName   = 'Azure Health Data Services de-identification service should use private link'
        Description   = 'Azure Health Data Services de-identification service should have at least one approved private endpoint connection. Clients in a virtual network can securely access resources that have private endpoint connections through private links.'
        Version       = '1.0.0'
        Category      = 'Health Deidentification Service'
        PolicyVersion = '1.0.0'
        Mode          = 'Indexed'
    }

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

    Resource 'Microsoft.HealthDataAIServices/deidServices' {

        Require 'privateEndpointConnections and privateLinkServiceConnectionState.status are as required' {
            Count 'privateEndpointConnections[*]' -Where {
                Field privateLinkServiceConnectionState.status | Must -Be 'Approved'
            } | Must -BeGreaterOrEqual 1
        }
    }

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/Health Deidentification Service/HealthDeidentification_PrivateLink_Audit.json in Azure/azure-policy, under the MIT licence.