Bylaw

Gallery › Synapse › Azure built-in policies

Azure Synapse Workspace SQL Server should be running TLS version 1.2 or newer

Converted Policy Audit Deny Disabled Mode All Version 1.1.0

Setting TLS version to 1.2 or newer improves security by ensuring your Azure Synapse workspace SQL server can only be accessed from clients using TLS 1.2 or newer. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities.

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

Azure Policy JSONWorkSpaceDedicatedSqlMinimalTlsSettings_Audit.json · 50 lines
{
  "properties": {
    "displayName": "Azure Synapse Workspace SQL Server should be running TLS version 1.2 or newer",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "Setting TLS version to 1.2 or newer improves security by ensuring your Azure Synapse workspace SQL server can only be accessed from clients using TLS 1.2 or newer. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities.",
    "metadata": {
      "version": "1.1.0",
      "category": "Synapse"
    },
    "version": "1.1.0",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Synapse/workspaces/dedicatedSQLminimalTlsSettings"
          },
          {
            "field": "Microsoft.Synapse/workspaces/dedicatedSQLminimalTlsSettings/minimalTlsVersion",
            "notEquals": "1.2"
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.1.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/cb3738a6-82a2-4a18-b87b-15217b9deff4",
  "name": "cb3738a6-82a2-4a18-b87b-15217b9deff4"
}
Bylawcb3738a6-82a2-4a18-b87b-15217b9deff4.bylaw.ps1 · 28 lines
# Converted from WorkSpaceDedicatedSqlMinimalTlsSettings_Audit.json by ConvertTo-Bylaw.
Policy 'cb3738a6-82a2-4a18-b87b-15217b9deff4' {

    Properties @{
        DisplayName   = 'Azure Synapse Workspace SQL Server should be running TLS version 1.2 or newer'
        Description   = 'Setting TLS version to 1.2 or newer improves security by ensuring your Azure Synapse workspace SQL server can only be accessed from clients using TLS 1.2 or newer. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities.'
        Version       = '1.1.0'
        Category      = 'Synapse'
        PolicyVersion = '1.1.0'
        Mode          = 'All'
    }

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

    Resource 'Microsoft.Synapse/workspaces/dedicatedSQLminimalTlsSettings' {

        Require 'minimalTlsVersion is 1.2' {
            Field minimalTlsVersion | Must -Be '1.2'
        }
    }

    Effect (Param Effect)
}

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