This repository has been archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
policydefinition-append_redis_sslenforcement.tf
81 lines (76 loc) · 2.24 KB
/
policydefinition-append_redis_sslenforcement.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# This file was auto generated
resource "azurerm_policy_definition" "append_redis_sslenforcement" {
name = "Append-Redis-sslEnforcement"
policy_type = "Custom"
mode = "All"
display_name = "Azure Cache for Redis Append a specific min TLS version requirement and enforce TLS."
description = "Append a specific min TLS version requirement and enforce SSL on Azure Cache for Redis. Enables secure server to client by enforce minimal Tls Version to secure the connection between your database server and your client applications helps protect against 'man in the middle' attacks by encrypting the data stream between the server and your application. This configuration enforces that SSL is always enabled for accessing your database server."
metadata = <<METADATA
{
"version": "1.0.0",
"category": "Cache"
}
METADATA
management_group_name = var.management_group_name
policy_rule = <<POLICYRULE
{
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Cache/redis"
},
{
"anyOf": [
{
"field": "Microsoft.Cache/Redis/minimumTlsVersion",
"notequals": "[parameters('minimumTlsVersion')]"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": [
{
"field": "Microsoft.Cache/Redis/minimumTlsVersion",
"value": "[parameters('minimumTlsVersion')]"
}
]
}
}
POLICYRULE
parameters = <<PARAMETERS
{
"effect": {
"type": "String",
"defaultValue": "Append",
"allowedValues": [
"Append",
"Disabled"
],
"metadata": {
"displayName": "Effect Azure Cache for Redis",
"description": "Enable or disable the execution of the policy minimum TLS version Azure Cache for Redis"
}
},
"minimumTlsVersion": {
"type": "String",
"defaultValue": "1.2",
"allowedValues": [
"1.2",
"1.1",
"1.0"
],
"metadata": {
"displayName": "Select version for Redis server",
"description": "Select version minimum TLS version Azure Cache for Redis to enforce"
}
}
}
PARAMETERS
}
output "policydefinition_append_redis_sslenforcement" {
value = azurerm_policy_definition.append_redis_sslenforcement
}