Can I set WAF rules to Log by default and override specific ones to Block?

Rupesh Sonawane 0 Reputation points
2025-02-10T06:40:19.2766667+00:00

Hey, I have set the WAF in Prevention mode to allow my custom rules like Rate limiting to be in effect with Blocking action. However as I was facing so many false positives with Microsoft_DefaultRuleSet 2.1, I changed the action as Log for it so that I can monitor the false postiives and do exclusions. Now I want to enable individual rules to be in Block mode while keeping others in Log action. When I'm performing this, it is only allowing me to set the action to either Log or Anomalyscoring. Although, even keeping Anomalyscoring action it Logs the request with Rule 949110 (The default rule which triggers when anomaly score has exceeded) and do not Blocks it! (Showing Log on Anomaly in portal)
Can anyone help me here or clarify if there is a possibility to keep all the rules in Log action by default and then override the specific rules to perform real Blocking action?

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
750 questions
Azure Web Application Firewall
{count} votes

1 answer

Sort by: Most helpful
  1. Vallepu Venkateswarlu 80 Reputation points Microsoft Vendor
    2025-02-13T11:31:39.5266667+00:00

    Hi @Rupesh Sonawane

    Thanks for your response.

    But again this will be a real challenge to easily identify the rules which could have contributed to the Rule trigger if they were set to anomalyscoring, through Log Analytics.

    To answer your questions,here is the KQL query to check which requests are being blocked by anomalyscoring in the WAF policy.

    AzureDiagnostics
    | where Category =="ApplicationGatewayFirewallLog"
    | where Message contains "Anomaly Score Exceeded"
    | project TimeGenerated, Category,ruleId_s,Resource,Message,action_s
    

    Output
    User's image

    Note: Block and Allow actions are available only for WAF Policy for Regional WAF (Application Gateway), not for Global WAF (Front Door).

    Portal result of Regional WAF( Application Gateway)
    User's image

    I hope this helps to resolve your issue!

    If this helps to resolve your query, please click Accept Answer on this post to assist other community members facing similar issues in finding the correct solution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.