Skip to content

Commit e3b3dc9

Browse files
authored
Merge pull request #11776 from Azure/v-visodadasi/WAF
Updated Application Gateway WAF - SQLi Detection and Application Gateway WAF - XSS Detection
2 parents 26481bb + 290a029 commit e3b3dc9

File tree

6 files changed

+39
-32
lines changed

6 files changed

+39
-32
lines changed

Solutions/Azure Web Application Firewall (WAF)/Analytic Rules/App-GW-WAF-SQLiDetection.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@ query: |
3131
| where Category == "ApplicationGatewayFirewallLog"
3232
| where action_s == "Matched"
3333
| where Message has "SQL Injection"
34-
| project transactionId_g, hostname_s, requestUri_s, TimeGenerated, clientIp_s, Message, details_message_s, details_data_s
34+
| extend transactionId_g = tostring(parse_json(AdditionalFields).transactionId_g)
35+
| extend hostname_s = tostring(parse_json(AdditionalFields).hostname_s)
36+
| project transactionId_g, hostname_s, requestUri_s, TimeGenerated, clientIp_s, Message
3537
| join kind = inner(
3638
AzureDiagnostics
3739
| where Category == "ApplicationGatewayFirewallLog"
38-
| where action_s == "Blocked") on transactionId_g
40+
| where action_s == "Blocked"
41+
| extend transactionId_g = tostring(parse_json(AdditionalFields).transactionId_g)) on transactionId_g
3942
| extend Uri = strcat(hostname_s,requestUri_s)
40-
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TransactionID = make_set(transactionId_g,100), Message = make_set(Message,100), Detail_Message = make_set(details_message_s,100), Detail_Data = make_set(details_data_s,100), Total_TransactionId = dcount(transactionId_g) by clientIp_s, Uri, action_s
43+
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TransactionID = make_set(transactionId_g,100), Message = make_set(Message,100), Total_TransactionId = dcount(transactionId_g) by clientIp_s, Uri, action_s
4144
| where Total_TransactionId >= Threshold
4245
# The Threshold value above can be changed as per your infrastructure's requirement
4346
entityMappings:
@@ -49,5 +52,5 @@ entityMappings:
4952
fieldMappings:
5053
- identifier: Address
5154
columnName: clientIp_s
52-
version: 1.0.0
55+
version: 1.0.1
5356
kind: Scheduled

Solutions/Azure Web Application Firewall (WAF)/Analytic Rules/App-GW-WAF-XSSDetection.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ query: |
2828
| where Category == "ApplicationGatewayFirewallLog"
2929
| where action_s == "Matched"
3030
| where Message has "XSS"
31-
| project transactionId_g, hostname_s, requestUri_s, TimeGenerated, clientIp_s, Message, details_message_s, details_data_s
31+
| extend transactionId_g = tostring(parse_json(AdditionalFields).transactionId_g)
32+
| extend hostname_s = tostring(parse_json(AdditionalFields).hostname_s)
33+
| project transactionId_g, hostname_s, requestUri_s, TimeGenerated, clientIp_s, Message
3234
| join kind = inner(
3335
AzureDiagnostics
3436
| where Category == "ApplicationGatewayFirewallLog"
35-
| where action_s == "Blocked") on transactionId_g
37+
| where action_s == "Blocked"
38+
| extend transactionId_g = tostring(parse_json(AdditionalFields).transactionId_g)) on transactionId_g
3639
| extend Uri = strcat(hostname_s,requestUri_s)
37-
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TransactionID = make_set(transactionId_g,100), Message = make_set(Message,100), Detail_Message = make_set(details_message_s,100), Detail_Data = make_set(details_data_s,100), Total_TransactionId = dcount(transactionId_g) by clientIp_s, Uri, action_s
40+
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), TransactionID = make_set(transactionId_g,100), Message = make_set(Message,100), Total_TransactionId = dcount(transactionId_g) by clientIp_s, Uri, action_s
3841
| where Total_TransactionId >= Threshold
3942
# The Threshold value above can be changed as per your infrastructure's requirement
4043
entityMappings:
@@ -46,5 +49,5 @@ entityMappings:
4649
fieldMappings:
4750
- identifier: Address
4851
columnName: clientIp_s
49-
version: 1.0.0
52+
version: 1.0.1
5053
kind: Scheduled
19.9 KB
Binary file not shown.

Solutions/Azure Web Application Firewall (WAF)/Package/createUiDefinition.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
}
6565
},
6666
{
67-
"name": "dataconnectors-link2",
67+
"name": "dataconnectors-link1",
6868
"type": "Microsoft.Common.TextBlock",
6969
"options": {
7070
"link": {

0 commit comments

Comments
 (0)