From 0a9801c768bcbdd47e4c4f28d077e6ea7e35b6ea Mon Sep 17 00:00:00 2001 From: Eric Schwabe Date: Fri, 13 Sep 2019 08:18:29 -0700 Subject: [PATCH 1/2] Add defaultState and defaultAction to managed rule set definitions --- .../examples/WafListManagedRuleSets.json | 14 ++++++--- .../2019-03-01/webapplicationfirewall.json | 30 +++++++++++++------ 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/examples/WafListManagedRuleSets.json b/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/examples/WafListManagedRuleSets.json index 60d72d77413e..81204161f8e5 100644 --- a/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/examples/WafListManagedRuleSets.json +++ b/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/examples/WafListManagedRuleSets.json @@ -14,7 +14,7 @@ "properties": { "provisioningState": "Succeeded", "ruleSetType": "DefaultRuleSet", - "ruleSetVersion": "preview-1.0", + "ruleSetVersion": "1.0", "ruleGroups": [ { "ruleGroupName": "Group1", @@ -22,11 +22,15 @@ "rules": [ { "ruleId": "GROUP1-0001", - "description": "Generic managed web application firewall rule." + "description": "Generic managed web application firewall rule.", + "defaultState": "Enabled", + "defaultAction": "Block" }, { "ruleId": "GROUP1-0002", - "description": "Generic managed web application firewall rule." + "description": "Generic managed web application firewall rule.", + "defaultState": "Disabled", + "defaultAction": "Block" } ] }, @@ -36,7 +40,9 @@ "rules": [ { "ruleId": "GROUP2-0001", - "description": "Generic managed web application firewall rule." + "description": "Generic managed web application firewall rule.", + "defaultState": "Enabled", + "defaultAction": "Allow" } ] } diff --git a/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/webapplicationfirewall.json b/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/webapplicationfirewall.json index a49a01a2f97a..093245ca7307 100644 --- a/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/webapplicationfirewall.json +++ b/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/webapplicationfirewall.json @@ -619,15 +619,7 @@ }, "enabledState": { "description": "Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified.", - "type": "string", - "enum": [ - "Disabled", - "Enabled" - ], - "x-ms-enum": { - "name": "ManagedRuleEnabledState", - "modelAsString": true - } + "$ref": "#/definitions/ManagedRuleEnabledState" }, "action": { "description": "Describes the override action to be applied when rule matches.", @@ -726,6 +718,14 @@ "readOnly": true, "type": "string" }, + "defaultState": { + "description": "Describes the default state for the managed rule.", + "$ref": "#/definitions/ManagedRuleEnabledState" + }, + "defaultAction": { + "description": "Describes the default action to be applied when the managed rule matches.", + "$ref": "#/definitions/ActionType" + }, "description": { "description": "Describes the functionality of the managed rule.", "readOnly": true, @@ -747,6 +747,18 @@ "modelAsString": true } }, + "ManagedRuleEnabledState": { + "description": "Describes if the managed rule is in enabled or disabled state.", + "type": "string", + "enum": [ + "Disabled", + "Enabled" + ], + "x-ms-enum": { + "name": "ManagedRuleEnabledState", + "modelAsString": true + } + }, "ErrorResponse": { "description": "Error response indicates Front Door service is not able to process the incoming request. The reason is provided in the error message.", "type": "object", From 3fa8f3514a5e14cab1429615541e7f04e8730996 Mon Sep 17 00:00:00 2001 From: Eric Schwabe Date: Tue, 17 Sep 2019 09:05:05 -0700 Subject: [PATCH 2/2] Add read-only to defaultAction and defaultState fields --- .../stable/2019-03-01/webapplicationfirewall.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/webapplicationfirewall.json b/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/webapplicationfirewall.json index 093245ca7307..e40f2d2a4c0a 100644 --- a/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/webapplicationfirewall.json +++ b/specification/frontdoor/resource-manager/Microsoft.Network/stable/2019-03-01/webapplicationfirewall.json @@ -720,10 +720,12 @@ }, "defaultState": { "description": "Describes the default state for the managed rule.", + "readOnly": true, "$ref": "#/definitions/ManagedRuleEnabledState" }, "defaultAction": { "description": "Describes the default action to be applied when the managed rule matches.", + "readOnly": true, "$ref": "#/definitions/ActionType" }, "description": {