Bylaw

Gallery › Stack HCI › Azure built-in policies

[Deprecated]: Host and VM networking should be protected on Azure Stack HCI systems

Converted Policy Audit Disabled Mode All Version 1.1.0-deprecated Deprecated

This policy is deprecated because it targets security settings resource. Instead of continuing to use this policy, we recommend you instead assign this replacement policy with policy ID /providers/Microsoft.Authorization/policyDefinitions/36f0d6bc-a253-4df8-b25b-c3a5023ff443. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.

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

Azure Policy JSONDataInTransitProtected_Audit.json · 56 lines
{
  "properties": {
    "displayName": "[Deprecated]: Host and VM networking should be protected on Azure Stack HCI systems",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "This policy is deprecated because it targets security settings resource. Instead of continuing to use this policy, we recommend you instead assign this replacement policy with policy ID /providers/Microsoft.Authorization/policyDefinitions/36f0d6bc-a253-4df8-b25b-c3a5023ff443. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.",
    "metadata": {
      "version": "1.1.0-deprecated",
      "category": "Stack HCI",
      "deprecated": true
    },
    "version": "1.1.0",
    "parameters": {
      "effect": {
        "type": "String",
        "defaultValue": "Disabled",
        "allowedValues": [
          "Audit",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.AzureStackHCI/clusters/securitySettings"
          },
          {
            "not": {
              "field": "Microsoft.AzureStackHCI/clusters/securitySettings/securityComplianceStatus.dataInTransitProtected",
              "in": [
                "Compliant",
                "Pending"
              ]
            }
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.1.0",
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/aee306e7-80b0-46f3-814c-d3d3083ed034",
  "name": "aee306e7-80b0-46f3-814c-d3d3083ed034"
}
Bylawaee306e7-80b0-46f3-814c-d3d3083ed034.bylaw.ps1 · 29 lines
# Converted from DataInTransitProtected_Audit.json by ConvertTo-Bylaw.
Policy 'aee306e7-80b0-46f3-814c-d3d3083ed034' {

    Properties @{
        DisplayName   = '[Deprecated]: Host and VM networking should be protected on Azure Stack HCI systems'
        Description   = 'This policy is deprecated because it targets security settings resource. Instead of continuing to use this policy, we recommend you instead assign this replacement policy with policy ID /providers/Microsoft.Authorization/policyDefinitions/36f0d6bc-a253-4df8-b25b-c3a5023ff443. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.'
        Version       = '1.1.0-deprecated'
        Category      = 'Stack HCI'
        Deprecated    = $true
        PolicyVersion = '1.1.0'
        Mode          = 'All'
    }

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

    Resource 'Microsoft.AzureStackHCI/clusters/securitySettings' {

        Require 'securityComplianceStatus.dataInTransitProtected is one of 2 values' {
            Field securityComplianceStatus.dataInTransitProtected | Must -BeIn @('Compliant', 'Pending')
        }
    }

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/Stack HCI/DataInTransitProtected_Audit.json in Azure/azure-policy, under the MIT licence.