I have an App GW WAF v2 where I need to set up a custom rule to check for the presence of a Request Header. I couldn't get it to work. So next I set up a very simple check.
"customRules":[{
"name":"blockTEST",
"priority":1,
"ruleType":"MatchRule",
"matchConditions":
[{"matchVariables":
[{"variableName":"RequestHeaders","selector":"My-Header"}],
"operator":"Contains",
"negationConditon":false,
"matchValues":["evil"],
"transforms":["Lowercase"]
}],
"action":"Block"
}]
I am submitting a request with "My-Header" as a header and with the value of "evil". But it doesn't block it. Have also tried various comparison operators including Starts With, Contains, Equals, ... but nothing works
So far the only custom rule that works is when I set a Block based on IP. But thats not what I want.
Any suggestions? Jake.