Azure / Azure/azure-rest-api-specs

[BUG]Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies should return default value while not set

Open
#36,330 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

### API Spec link

https://github.com/Azure/azure-rest-api-specs/blob/ac8a6431be655f67c87f4dced2e79eff1c824833/specification/network/resource-manager/Microsoft.Network/stable/2024-07-01/webapplicationfirewall.json#L538-L544

### API Spec version

2024-07-01

### Describe the bug

The jsChallengeCookieExpirationInMins property of ApplicationGatewayWebApplicationFirewallPolicy should return default value when the value is not set, from the [document](https://learn.microsoft.com/en-us/azure/web-application-firewall/waf-javascript-challenge#expiration) the default value is `30`

### Expected behavior

jsChallengeCookieExpirationInMins should return default value `30` when not set in request

### Actual behavior

jsChallengeCookieExpirationInMins does not return

### Reproduction Steps

```
PUT https://management.azure.com/subscriptions//resourceGroups/waf-test-rg/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/test?api-version=2024-07-01 HTTP/2.0
content-type: application/json
user-agent: HashiCorp Terraform/1.12.1 (+https://www.terraform.io) terraform-provider-azapi/v2.5.0 pid-222c6c49-1b0a-5959-a213-6608f9eb8820
x-ms-correlation-request-id: 14cbbe91-a1c2-c924-1e2a-b236dccdef71
accept: application/json
content-length: 1628
accept-encoding: gzip

{
"location": "westeurope",
"properties": {
"customRules": [
{
"action": "Block",
"matchConditions": [
{
"matchValues": [
"192.168.1.0/24",
"10.0.0.0/24"
],
"matchVariables": [
{
"selector": "",
"variableName": "RemoteAddr"
}
],
"negationConditon": false,
"operator": "IPMatch",
"transforms": [

]
}
],
"name": "Rule1",
"priority": 1,
"ruleType": "MatchRule",
"skippedManagedRuleSets": [

],
"state": "Enabled"
},
{
"action": "Block",
"matchConditions": [
{
"matchValues": [
"192.168.1.0/24"
],
"matchVariables": [
{
"selector": "",
"variableName": "RemoteAddr"
}
],
"negationConditon": false,
"operator": "IPMatch",
"transforms": [

]
},
{
"matchValues": [
"Windows"
],
"matchVariables": [
{
"selector": "UserAgent",
"variableName": "RequestHeaders"
}
],
"negationConditon": false,
"operator": "Contains",
"transforms": [

]
}
],
"name": "Rule2",
"priority": 2,
"ruleType": "MatchRule",
"skippedManagedRuleSets": [

],
"state": "Enabled"
}
],
"managedRules": {
"exclusions": [
{
"exclusionManagedRuleSets": [

],
"matchVariable": "RequestHeaderNames",
"selector": "x-company-secret-header",
"selectorMatchOperator": "Equals"
},
{
"exclusionManagedRuleSets": [

],
"matchVariable": "RequestCookieNames",
"selector": "too-tasty",
"selectorMatchOperator": "EndsWith"
}
],
"managedRuleSets": [
{
"ruleGroupOverrides": [
{
"ruleGroupName": "REQUEST-920-PROTOCOL-ENFORCEMENT",
"rules": [
{
"action": "Log",
"ruleId": "920300",
"state": "Enabled"
},
{
"action": "Block",
"ruleId": "920440",
"state": "Enabled"
}
]
}
],
"ruleSetType": "OWASP",
"ruleSetVersion": "3.2"
}
]
},
"policySettings": {
"fileUploadEnforcement": false,
"fileUploadLimitInMb": 100,
"maxRequestBodySizeInKb": 128,
"mode": "Prevention",
"requestBodyCheck": true,
"requestBodyEnforcement": true,
"requestBodyInspectLimitInKB": 128,
"state": "Enabled"
}
},
"tags": {

}
}

HTTP/2.0 201
cache-control: no-cache
pragma: no-cache
content-length: 1969
content-type: application/json; charset=utf-8
expires: -1
x-ms-request-id: 308ffbca-ea57-41cd-8e10-88b6caa530b2
x-ms-correlation-request-id: 14cbbe91-a1c2-c924-1e2a-b236dccdef71
date: Wed, 30 Jul 2025 06:24:21 GMT

{
"name": "test",
"id": "/subscriptions//resourceGroups/waf-test-rg/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/test",
"etag": "W/\"dca89ee4-d087-4108-8103-edf16968cacc\"",
"type": "Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies",
"location": "westeurope",
"tags": {

},
"properties": {
"provisioningState": "Updating",
"customRules": [
{
"name": "Rule1",
"priority": 1,
"ruleType": "MatchRule",
"action": "Block",
"matchConditions": [
{
"matchVariables": [
{
"variableName": "RemoteAddr",
"selector": ""
}
],
"operator": "IPMatch",
"negationConditon": false,
"matchValues": [
"192.168.1.0/24",
"10.0.0.0/24"
],
"transforms": [

]
}
],
"skippedManagedRuleSets": [

],
"state": "Enabled"
},
{
"name": "Rule2",
"priority": 2,
"ruleType": "MatchRule",
"action": "Block",
"matchConditions": [
{
"matchVariables": [
{
"variableName": "RemoteAddr",
"selector": ""
}
],
"operator": "IPMatch",
"negationConditon": false,
"matchValues": [
"192.168.1.0/24"
],
"transforms": [

]
},
{
"matchVariables": [
{
"variableName": "RequestHeaders",
"selector": "UserAgent"
}
],
"operator": "Contains",
"negationConditon": false,
"matchValues": [
"Windows"
],
"transforms": [

]
}
],
"skippedManagedRuleSets": [

],
"state": "Enabled"
}
],
"policySettings": {
"requestBodyCheck": true,
"maxRequestBodySizeInKb": 128,
"fileUploadLimitInMb": 100,
"state": "Enabled",
"mode": "Prevention",
"requestBodyInspectLimitInKB": 128,
"fileUploadEnforcement": false,
"requestBodyEnforcement": true
},
"managedRules": {
"managedRuleSets": [
{
"ruleSetType": "OWASP",
"ruleSetVersion": "3.2",
"ruleGroupOverrides": [
{
"ruleGroupName": "REQUEST-920-PROTOCOL-ENFORCEMENT",
"rules": [
{
"ruleId": "920300",
"state": "Enabled",
"action": "Log"
},
{
"ruleId": "920440",
"state": "Enabled",
"action": "Block"
}
]
}
]
}
],
"exclusions": [
{
"matchVariable": "RequestHeaderNames",
"selectorMatchOperator": "Equals",
"selector": "x-company-secret-header",
"exclusionManagedRuleSets": [

]
},
{
"matchVariable": "RequestCookieNames",
"selectorMatchOperator": "EndsWith",
"selector": "too-tasty",
"exclusionManagedRuleSets": [

]
}
]
}
}
}
```

### Environment

Terraform

Contributor guide

Open the contributing guide

Research direction

Start with specification/network/resource-manager/Microsoft.Network/stable/2024-07-01/webapplicationfirewall.json at lines 538-544 and inspect jsChallengeCookieExpirationInMins alongside nearby defaults. Compare the surrounding API definitions, then verify the specification represents 30 as the default when the property is omitted and passes the repository's validation checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
json, openapi
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.