Skip to main content

Web Application Firewall (WAF)

The OWASP Web Application Firewall (WAF) is a powerful security layer that protects your web applications from various types of attacks. It can be enabled at the ingress level using OWASP Core Rule Set (CRS) rules.

What is OWASP WAF?

The OWASP WAF is based on the ModSecurity engine and the OWASP Core Rule Set (CRS), which is a set of generic attack detection rules for use with ModSecurity or compatible web application firewalls. The CRS aims to protect web applications from a wide range of attacks, including the OWASP Top Ten, while minimizing false positives.

We are using version 4.15.0. You can view the rules from the official repository on GitHub.

Key Benefits

  • Comprehensive Protection: Covers the OWASP Top 10 vulnerabilities.
  • Real-time Monitoring: Detects and blocks malicious requests in real-time.
  • Attack Prevention: Blocks common attack vectors like SQL injection, XSS, and file inclusion attacks.

Enabling WAF

To enable the WAF at the ingress level:

  1. Configure the OWASP rules as shown in the following image o the Settings tab.

    WAF enabling interface

  2. Make a new deployment clicking on Apply changes

Enabled Rule Sets

The following table lists the enabled OWASP Core Rule Set (CRS) version 4.15.0 rule sets (grouped by configuration files) with their descriptions:

Rule Set IDRule FileDescription
900REQUEST-900-EXCLUSION-RULES-BEFORE-CRS.confExclusion rules that should be processed before the main CRS rules
901REQUEST-901-INITIALIZATION.confInitialization rules that set up the basic CRS environment
905REQUEST-905-COMMON-EXCEPTIONS.confCommon exception rules for legitimate traffic patterns
911REQUEST-911-METHOD-ENFORCEMENT.confRules to enforce allowed HTTP methods and block unauthorized ones
913REQUEST-913-SCANNER-DETECTION.confRules to detect and block automated scanning tools and bots
920REQUEST-920-PROTOCOL-ENFORCEMENT.confProtocol enforcement rules to ensure requests follow HTTP standards
921REQUEST-921-PROTOCOL-ATTACK.confDetection rules for protocol-based attacks
922REQUEST-922-MULTIPART-ATTACK.confRules to detect attacks in multipart form data
930REQUEST-930-APPLICATION-ATTACK-LFI.confLocal File Inclusion (LFI) attack detection rules
931REQUEST-931-APPLICATION-ATTACK-RFI.confRemote File Inclusion (RFI) attack detection rules
932REQUEST-932-APPLICATION-ATTACK-RCE.confRemote Code Execution (RCE) attack detection rules
933REQUEST-933-APPLICATION-ATTACK-PHP.confPHP-specific attack detection rules
934REQUEST-934-APPLICATION-ATTACK-GENERIC.confGeneric application attack detection rules
941REQUEST-941-APPLICATION-ATTACK-XSS.confCross-Site Scripting (XSS) attack detection rules
942REQUEST-942-APPLICATION-ATTACK-SQLI.confSQL Injection attack detection rules
943REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION.confSession fixation attack detection rules
944REQUEST-944-APPLICATION-ATTACK-JAVA.confJava-specific attack detection rules
949REQUEST-949-BLOCKING-EVALUATION.confRules for evaluating and determining blocking actions
950RESPONSE-950-DATA-LEAKAGES.confRules to detect data leakage in HTTP responses
951RESPONSE-951-DATA-LEAKAGES-SQL.confSQL-specific data leakage detection rules
952RESPONSE-952-DATA-LEAKAGES-JAVA.confJava-specific data leakage detection rules
953RESPONSE-953-DATA-LEAKAGES-PHP.confPHP-specific data leakage detection rules
954RESPONSE-954-DATA-LEAKAGES-IIS.confIIS-specific data leakage detection rules
955RESPONSE-955-WEB-SHELLS.confWeb shells detection rules
959RESPONSE-959-BLOCKING-EVALUATION.confResponse-based blocking evaluation rules
980RESPONSE-980-CORRELATION.confRules for correlating request and response data
999RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.confExclusion rules that should be processed after the main CRS rules

Viewing WAF Logs

To view the WAF logs:

  1. Go to the Logs tab.

    Logs tab interface

  2. In the filter, select Log Type -> WAF and click Apply.

    WAF log filter selection

Now you will see WAF blocking events.

WAF logs view

  1. You can filter for specific content using the search function.

    WAF log search filter

Downloading WAF Logs

To download the logs:

  1. Filter the desired content as demonstrated in the Viewing WAF Logs section.

  2. Select the Download filtered logs option.

    Download WAF logs option

A file with the log content will be generated and will appear in the list to be downloaded.

Generated WAF log file for download

The log file will have the following field structure:

FieldDescription
dateTimeThe timestamp of the WAF event.
clientIpThe IP address of the client making the request.
requestMethodThe HTTP method used (e.g., GET, POST).
responseHttpCodeThe HTTP status code returned (e.g., 403 for blocked).
requestHostThe host header value.
requestUriThe requested URL path.
uniqueIdA unique identifier for the request.
messagesDetails of the triggered rules and reasons for blocking.

Retention Period

Logs are retained for a period of 20 days. After this period, older logs are automatically deleted from the system. Make sure to download any important logs that you might need for future reference before they expire.