{
    "properties": {
        "displayName": "Audit: TLS 1.0 and 1.1 server protocols disabled",
        "policyType": "Custom",
        "mode": "Indexed",
        "description": "Audits that SCHANNEL has the server side of TLS 1.0 and TLS 1.1 explicitly disabled.",
        "metadata": {
            "category": "Guest Configuration",
            "version": "1.0.0",
            "requiredProviders": [
                "Microsoft.GuestConfiguration"
            ],
            "guestConfiguration": {
                "name": "TlsServerProtocols_1.0.0",
                "version": "1.0.0",
                "contentType": "Custom",
                "contentUri": "https://stcontosomc.blob.core.windows.net/machine-configuration/TlsServerProtocols_1.0.0.zip",
                "contentHash": "{{PACKAGE_SHA256}}",
                "contentManagedIdentity": "system"
            }
        },
        "parameters": {
            "IncludeArcMachines": {
                "type": "string",
                "metadata": {
                    "displayName": "Include Arc connected machines",
                    "description": "By selecting this option, you agree to be charged monthly per Arc connected machine.",
                    "portalReview": "true"
                },
                "allowedValues": [
                    "true",
                    "false"
                ],
                "defaultValue": "false"
            }
        },
        "policyRule": {
            "if": {
                "anyOf": [
                    {
                        "allOf": [
                            {
                                "anyOf": [
                                    {
                                        "field": "type",
                                        "equals": "Microsoft.Compute/virtualMachines"
                                    },
                                    {
                                        "field": "type",
                                        "equals": "Microsoft.Compute/virtualMachineScaleSets"
                                    }
                                ]
                            },
                            {
                                "field": "tags['aks-managed-orchestrator']",
                                "exists": "false"
                            },
                            {
                                "field": "tags['aks-managed-poolName']",
                                "exists": "false"
                            },
                            {
                                "anyOf": [
                                    {
                                        "field": "Microsoft.Compute/imagePublisher",
                                        "in": [
                                            "esri",
                                            "incredibuild",
                                            "MicrosoftDynamicsAX",
                                            "MicrosoftSharepoint",
                                            "MicrosoftVisualStudio",
                                            "MicrosoftWindowsDesktop",
                                            "MicrosoftWindowsServerHPCPack"
                                        ]
                                    },
                                    {
                                        "allOf": [
                                            {
                                                "field": "Microsoft.Compute/imagePublisher",
                                                "equals": "MicrosoftWindowsServer"
                                            },
                                            {
                                                "field": "Microsoft.Compute/imageSKU",
                                                "notLike": "2008*"
                                            }
                                        ]
                                    },
                                    {
                                        "allOf": [
                                            {
                                                "field": "Microsoft.Compute/imagePublisher",
                                                "equals": "MicrosoftSQLServer"
                                            },
                                            {
                                                "field": "Microsoft.Compute/imageOffer",
                                                "notLike": "SQL2008*"
                                            }
                                        ]
                                    },
                                    {
                                        "allOf": [
                                            {
                                                "field": "Microsoft.Compute/imagePublisher",
                                                "equals": "microsoft-dsvm"
                                            },
                                            {
                                                "field": "Microsoft.Compute/imageOffer",
                                                "like": "dsvm-win*"
                                            }
                                        ]
                                    },
                                    {
                                        "allOf": [
                                            {
                                                "field": "Microsoft.Compute/imagePublisher",
                                                "equals": "microsoft-ads"
                                            },
                                            {
                                                "field": "Microsoft.Compute/imageOffer",
                                                "in": [
                                                    "standard-data-science-vm",
                                                    "windows-data-science-vm"
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "allOf": [
                                            {
                                                "field": "Microsoft.Compute/imagePublisher",
                                                "equals": "batch"
                                            },
                                            {
                                                "field": "Microsoft.Compute/imageOffer",
                                                "equals": "rendering-windows2016"
                                            }
                                        ]
                                    },
                                    {
                                        "allOf": [
                                            {
                                                "field": "Microsoft.Compute/imagePublisher",
                                                "equals": "center-for-internet-security-inc"
                                            },
                                            {
                                                "field": "Microsoft.Compute/imageOffer",
                                                "like": "cis-windows-server-201*"
                                            }
                                        ]
                                    },
                                    {
                                        "allOf": [
                                            {
                                                "field": "Microsoft.Compute/imagePublisher",
                                                "equals": "pivotal"
                                            },
                                            {
                                                "field": "Microsoft.Compute/imageOffer",
                                                "like": "bosh-windows-server*"
                                            }
                                        ]
                                    },
                                    {
                                        "allOf": [
                                            {
                                                "field": "Microsoft.Compute/imagePublisher",
                                                "equals": "cloud-infrastructure-services"
                                            },
                                            {
                                                "field": "Microsoft.Compute/imageOffer",
                                                "like": "ad*"
                                            }
                                        ]
                                    },
                                    {
                                        "allOf": [
                                            {
                                                "anyOf": [
                                                    {
                                                        "field": "Microsoft.Compute/virtualMachines/osProfile.windowsConfiguration",
                                                        "exists": true
                                                    },
                                                    {
                                                        "field": "Microsoft.Compute/virtualMachines/storageProfile.osDisk.osType",
                                                        "like": "Windows*"
                                                    },
                                                    {
                                                        "field": "Microsoft.Compute/VirtualMachineScaleSets/osProfile.windowsConfiguration",
                                                        "exists": true
                                                    },
                                                    {
                                                        "field": "Microsoft.Compute/virtualMachineScaleSets/virtualMachineProfile.storageProfile.osDisk.osType",
                                                        "like": "Windows*"
                                                    }
                                                ]
                                            },
                                            {
                                                "anyOf": [
                                                    {
                                                        "field": "Microsoft.Compute/imageSKU",
                                                        "exists": false
                                                    },
                                                    {
                                                        "allOf": [
                                                            {
                                                                "field": "Microsoft.Compute/imageOffer",
                                                                "notLike": "SQL2008*"
                                                            },
                                                            {
                                                                "field": "Microsoft.Compute/imageSKU",
                                                                "notLike": "2008*"
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "allOf": [
                            {
                                "value": "[parameters('IncludeArcMachines')]",
                                "equals": "true"
                            },
                            {
                                "anyOf": [
                                    {
                                        "allOf": [
                                            {
                                                "field": "type",
                                                "equals": "Microsoft.HybridCompute/machines"
                                            },
                                            {
                                                "field": "Microsoft.HybridCompute/imageOffer",
                                                "like": "windows*"
                                            }
                                        ]
                                    },
                                    {
                                        "allOf": [
                                            {
                                                "field": "type",
                                                "equals": "Microsoft.ConnectedVMwarevSphere/virtualMachines"
                                            },
                                            {
                                                "field": "Microsoft.ConnectedVMwarevSphere/virtualMachines/osProfile.osType",
                                                "like": "windows*"
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            },
            "then": {
                "effect": "auditIfNotExists",
                "details": {
                    "type": "Microsoft.GuestConfiguration/guestConfigurationAssignments",
                    "name": "[concat('TlsServerProtocols_1.0.0$pid', uniqueString(policy().assignmentId, policy().definitionReferenceId))]",
                    "existenceCondition": {
                        "field": "Microsoft.GuestConfiguration/guestConfigurationAssignments/complianceStatus",
                        "equals": "Compliant"
                    }
                }
            }
        }
    },
    "name": "ca593085-dfcb-425d-ac9c-12870a55bbaa"
}
