Skip to content

Instantly share code, notes, and snippets.

@anwather
Created July 28, 2022 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anwather/db97f2e31b4578dc2d625c4262dca0ca to your computer and use it in GitHub Desktop.
Save anwather/db97f2e31b4578dc2d625c4262dca0ca to your computer and use it in GitHub Desktop.
{
"name": "05a74909-be77-4704-8034-0dec6a41e2ea",
"properties": {
"displayName": "Storage Account set to minumum TLS and Secure transfer should be enabled",
"mode": "Indexed",
"description": "Audit requirement of Secure transfer in your storage account. Secure transfer is an option that forces your storage account to accept requests only from secure connections (HTTPS). Use of HTTPS ensures authentication between the server and the service and protects data in transit from network layer attacks such as man-in-the-middle, eavesdropping, and session-hijacking",
"metadata": {
"version": "1.0.0",
"category": "Storage"
},
"parameters": {
"effect": {
"type": "String",
"defaultValue": "Deny",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
}
},
"minimumTlsVersion": {
"type": "String",
"defaultValue": "TLS1_2",
"allowedValues": [
"TLS1_2",
"TLS1_1",
"TLS1_0"
],
"metadata": {
"displayName": "Storage Account select minimum TLS version",
"description": "Select version minimum TLS version on Azure Storage Account to enforce"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Storage/storageAccounts"
},
{
"anyOf": [
{
"allOf": [
{
"value": "[requestContext().apiVersion]",
"less": "2019-04-01"
},
{
"field": "Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly",
"exists": "false"
}
]
},
{
"field": "Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly",
"equals": "false"
},
{
"field": "Microsoft.Storage/storageAccounts/minimumTlsVersion",
"notequals": "[parameters('minimumTlsVersion')]"
},
{
"field": "Microsoft.Storage/storageAccounts/minimumTlsVersion",
"exists": "false"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment