Bylaw

Gallery › General › Azure built-in policies

[Preview]: Azure Baseline Security Mode

Converted Initiative Version 1.0.0-preview Preview

Azure Baseline Security Mode (https://aka.ms/AzureBSM) helps you secure your Azure environment with a curated set of Microsoft-recommended security controls. It simplifies the adoption of high-impact security protections, helping reduce risk and strengthen your security posture with minimal effort.

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

Azure Policy JSONAzureBSM.json · 218 lines
{
  "properties": {
    "displayName": "[Preview]: Azure Baseline Security Mode",
    "policyType": "BuiltIn",
    "description": "Azure Baseline Security Mode (https://aka.ms/AzureBSM) helps you secure your Azure environment with a curated set of Microsoft-recommended security controls. It simplifies the adoption of high-impact security protections, helping reduce risk and strengthen your security posture with minimal effort.",
    "metadata": {
      "version": "1.0.0-preview",
      "category": "General",
      "preview": true
    },
    "version": "1.0.0-preview",
    "parameters": {
      "blockStorageAccountPublicAccessEffect": {
        "type": "String",
        "defaultValue": "Deny",
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Block public (anonymous) access to storage accounts",
          "description": "Deny blocks storage accounts that allow public (anonymous) blob access, Audit reports them as non-compliant, and Disabled turns off evaluation."
        }
      },
      "blockKeyVaultWithoutPurgeProtectionEffect": {
        "type": "String",
        "defaultValue": "Deny",
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Block key vaults without deletion (purge) protection",
          "description": "Deny blocks key vaults that don't have deletion (purge) protection enabled, Audit reports them as non-compliant, and Disabled turns off evaluation."
        }
      },
      "blockStorageAccountSharedKeyAccessEffect": {
        "type": "String",
        "defaultValue": "Deny",
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Block shared key access to storage accounts",
          "description": "Deny blocks storage accounts that allow shared key access, Audit reports them as non-compliant, and Disabled turns off evaluation."
        }
      },
      "blockStorageAccountBelowMinimumTlsEffect": {
        "type": "String",
        "defaultValue": "Deny",
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Block storage accounts below the minimum TLS version",
          "description": "Deny blocks storage accounts configured below the minimum TLS version, Audit reports them as non-compliant, and Disabled turns off evaluation."
        }
      },
      "blockKeyVaultPublicNetworkAccessEffect": {
        "type": "String",
        "defaultValue": "Deny",
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Block public network access to key vaults",
          "description": "Deny blocks key vaults that allow public network access, Audit reports them as non-compliant, and Disabled turns off evaluation."
        }
      },
      "blockStorageAccountInsecureTransferEffect": {
        "type": "String",
        "defaultValue": "Deny",
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Block insecure transfer to storage accounts",
          "description": "Deny blocks storage accounts that allow insecure (non-HTTPS) transfer, Audit reports them as non-compliant, and Disabled turns off evaluation."
        }
      },
      "blockKeyVaultWithoutSoftDeleteEffect": {
        "type": "String",
        "defaultValue": "Deny",
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Block key vaults without soft delete",
          "description": "Deny blocks key vaults that don't have soft delete enabled, Audit reports them as non-compliant, and Disabled turns off evaluation."
        }
      }
    },
    "policyDefinitions": [
      {
        "policyDefinitionReferenceId": "blockStorageAccountPublicAccess",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/4fa4b6c0-31ca-4c0d-b10d-24b96f62a751",
        "definitionVersion": "3.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('blockStorageAccountPublicAccessEffect')]"
          }
        },
        "groupNames": [
          "Authentication"
        ]
      },
      {
        "policyDefinitionReferenceId": "blockKeyVaultWithoutPurgeProtection",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0b60c0b2-2dc2-4e1c-b5c9-abbed971de53",
        "definitionVersion": "2.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('blockKeyVaultWithoutPurgeProtectionEffect')]"
          }
        },
        "groupNames": [
          "Data Protection"
        ]
      },
      {
        "policyDefinitionReferenceId": "blockStorageAccountSharedKeyAccess",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/8c6a50c6-9ffd-4ae7-986f-5fa6111f9a54",
        "definitionVersion": "2.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('blockStorageAccountSharedKeyAccessEffect')]"
          }
        },
        "groupNames": [
          "Authentication"
        ]
      },
      {
        "policyDefinitionReferenceId": "blockStorageAccountBelowMinimumTls",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/fe83a0eb-a853-422d-aac2-1bffd182c5d0",
        "definitionVersion": "1.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('blockStorageAccountBelowMinimumTlsEffect')]"
          }
        },
        "groupNames": [
          "Data Protection"
        ]
      },
      {
        "policyDefinitionReferenceId": "blockKeyVaultPublicNetworkAccess",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/405c5871-3e91-4644-8a63-58e19d68ff5b",
        "definitionVersion": "1.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('blockKeyVaultPublicNetworkAccessEffect')]"
          }
        },
        "groupNames": [
          "Network"
        ]
      },
      {
        "policyDefinitionReferenceId": "blockStorageAccountInsecureTransfer",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/404c3081-a854-4457-ae30-26a93ef643f9",
        "definitionVersion": "2.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('blockStorageAccountInsecureTransferEffect')]"
          }
        },
        "groupNames": [
          "Data Protection"
        ]
      },
      {
        "policyDefinitionReferenceId": "blockKeyVaultWithoutSoftDelete",
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/1e66c121-a66a-4b1f-9b83-0fd99bf0fc2d",
        "definitionVersion": "3.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('blockKeyVaultWithoutSoftDeleteEffect')]"
          }
        },
        "groupNames": [
          "Data Protection"
        ]
      }
    ],
    "policyDefinitionGroups": [
      {
        "name": "Authentication",
        "displayName": "Authentication"
      },
      {
        "name": "Data Protection",
        "displayName": "Data Protection"
      },
      {
        "name": "Network",
        "displayName": "Network"
      }
    ],
    "versions": [
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/48da5be7-5507-4c72-99a3-7b74141147c1",
  "name": "48da5be7-5507-4c72-99a3-7b74141147c1"
}
Bylaw48da5be7-5507-4c72-99a3-7b74141147c1.bylaw.ps1 · 129 lines
# Converted from AzureBSM.json by ConvertTo-Bylaw.
Initiative '48da5be7-5507-4c72-99a3-7b74141147c1' {

    Properties @{
        DisplayName   = '[Preview]: Azure Baseline Security Mode'
        Description   = 'Azure Baseline Security Mode (https://aka.ms/AzureBSM) helps you secure your Azure environment with a curated set of Microsoft-recommended security controls. It simplifies the adoption of high-impact security protections, helping reduce risk and strengthen your security posture with minimal effort.'
        Version       = '1.0.0-preview'
        Category      = 'General'
        Preview       = $true
        PolicyVersion = '1.0.0-preview'
    }

    Parameter BlockStorageAccountPublicAccessEffect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
        DisplayName   = 'Block public (anonymous) access to storage accounts'
        Description   = 'Deny blocks storage accounts that allow public (anonymous) blob access, Audit reports them as non-compliant, and Disabled turns off evaluation.'
    }
    Parameter BlockKeyVaultWithoutPurgeProtectionEffect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
        DisplayName   = 'Block key vaults without deletion (purge) protection'
        Description   = 'Deny blocks key vaults that don''t have deletion (purge) protection enabled, Audit reports them as non-compliant, and Disabled turns off evaluation.'
    }
    Parameter BlockStorageAccountSharedKeyAccessEffect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
        DisplayName   = 'Block shared key access to storage accounts'
        Description   = 'Deny blocks storage accounts that allow shared key access, Audit reports them as non-compliant, and Disabled turns off evaluation.'
    }
    Parameter BlockStorageAccountBelowMinimumTlsEffect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
        DisplayName   = 'Block storage accounts below the minimum TLS version'
        Description   = 'Deny blocks storage accounts configured below the minimum TLS version, Audit reports them as non-compliant, and Disabled turns off evaluation.'
    }
    Parameter BlockKeyVaultPublicNetworkAccessEffect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
        DisplayName   = 'Block public network access to key vaults'
        Description   = 'Deny blocks key vaults that allow public network access, Audit reports them as non-compliant, and Disabled turns off evaluation.'
    }
    Parameter BlockStorageAccountInsecureTransferEffect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
        DisplayName   = 'Block insecure transfer to storage accounts'
        Description   = 'Deny blocks storage accounts that allow insecure (non-HTTPS) transfer, Audit reports them as non-compliant, and Disabled turns off evaluation.'
    }
    Parameter BlockKeyVaultWithoutSoftDeleteEffect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
        DisplayName   = 'Block key vaults without soft delete'
        Description   = 'Deny blocks key vaults that don''t have soft delete enabled, Audit reports them as non-compliant, and Disabled turns off evaluation.'
    }

    DefinitionGroup 'Authentication' -DisplayName 'Authentication'
    DefinitionGroup 'Data Protection' -DisplayName 'Data Protection'
    DefinitionGroup 'Network' -DisplayName 'Network'

    PolicyDefinition @{
        Id          = '4fa4b6c0-31ca-4c0d-b10d-24b96f62a751'
        ReferenceId = 'blockStorageAccountPublicAccess'
        Version     = '3.*.*'
        Group       = 'Authentication'
        Parameters  = @{
            effect = (Param BlockStorageAccountPublicAccessEffect)
        }
    }

    PolicyDefinition @{
        Id          = '0b60c0b2-2dc2-4e1c-b5c9-abbed971de53'
        ReferenceId = 'blockKeyVaultWithoutPurgeProtection'
        Version     = '2.*.*'
        Group       = 'Data Protection'
        Parameters  = @{
            effect = (Param BlockKeyVaultWithoutPurgeProtectionEffect)
        }
    }

    PolicyDefinition @{
        Id          = '8c6a50c6-9ffd-4ae7-986f-5fa6111f9a54'
        ReferenceId = 'blockStorageAccountSharedKeyAccess'
        Version     = '2.*.*'
        Group       = 'Authentication'
        Parameters  = @{
            effect = (Param BlockStorageAccountSharedKeyAccessEffect)
        }
    }

    PolicyDefinition @{
        Id          = 'fe83a0eb-a853-422d-aac2-1bffd182c5d0'
        ReferenceId = 'blockStorageAccountBelowMinimumTls'
        Version     = '1.*.*'
        Group       = 'Data Protection'
        Parameters  = @{
            effect = (Param BlockStorageAccountBelowMinimumTlsEffect)
        }
    }

    PolicyDefinition @{
        Id          = '405c5871-3e91-4644-8a63-58e19d68ff5b'
        ReferenceId = 'blockKeyVaultPublicNetworkAccess'
        Version     = '1.*.*'
        Group       = 'Network'
        Parameters  = @{
            effect = (Param BlockKeyVaultPublicNetworkAccessEffect)
        }
    }

    PolicyDefinition @{
        Id          = '404c3081-a854-4457-ae30-26a93ef643f9'
        ReferenceId = 'blockStorageAccountInsecureTransfer'
        Version     = '2.*.*'
        Group       = 'Data Protection'
        Parameters  = @{
            effect = (Param BlockStorageAccountInsecureTransferEffect)
        }
    }

    PolicyDefinition @{
        Id          = '1e66c121-a66a-4b1f-9b83-0fd99bf0fc2d'
        ReferenceId = 'blockKeyVaultWithoutSoftDelete'
        Version     = '3.*.*'
        Group       = 'Data Protection'
        Parameters  = @{
            effect = (Param BlockKeyVaultWithoutSoftDeleteEffect)
        }
    }
}

Members (7)

Source: built-in-policies/policySetDefinitions/General/AzureBSM.json in Azure/azure-policy, under the MIT licence.