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.

Environment-local extensions​

Copy prompt → paste config → validate → save/apply is enough.

In App Env → Settings → Security settings, use Copy AI prompt, send it to your preferred AI agent, and describe the traffic you need to block or the false positive you observed. The prompt includes the supported format, constraints and an example, and asks the agent to clarify missing details. Use redacted request examples; never paste credentials or access tokens.

Paste the resulting JSON into WAF extensions, choose Validate, then Save. Save repeats validation on the server and adds pending changes; it neither enables WAF nor deploys automatically. Review the existing Pending Apply → View diff, then use Apply. Deployment History preserves the JSON snapshot and before/after diffs. To restore a policy, copy its previous JSON from History, paste, validate, save and apply. Rolling back an application image does not automatically restore security settings.

Extensions belong only to this environment, across its HTTP hosts and ingress paths. They are available for Connect and Direct HTTP applications, not Databases, Functions, Jobs or TCP applications. With WAF off, saved extensions remain inactive. Empty text or {"version":1,"rules":[]} removes extensions on the next Apply. Existing environments do not change until configured.

Supported JSON​

One format; no raw ModSecurity/nginx syntax or arbitrary regular expressions. Unknown properties are rejected. Maximum 20 rules. Rules have unique printable ASCII names (up to 80 characters). Enabled rules must also compile to at most 3,584 bytes of ModSecurity rules, because the ingress passes them to nginx as a single parameter. Validate, Save and Apply reject larger policies; prefer one tokensIn or urlMatches condition over one rule per value.

PropertySupported values
version1
rules[].enabledBoolean; defaults to true
rules[].pathoperator: equals or startsWith; value: absolute path using letters, digits and ._~/-, maximum 256 characters
rules[].methodsNonempty unique list of GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS
rules[].conditionsArray of zero to five conditions; all must match
Condition source / fieldquery or header; field starts with a letter, then letters/digits/underscore/hyphen, maximum 64 characters. Field must occur exactly once
Condition operator / valueequals with a literal printable ASCII string, maximum 256 characters; tokensIn with a list of tokens; or urlMatches with schemes and hosts
Token matchingtokensIn: one to ten unique tokens of printable ASCII without spaces, maximum 256 characters each. Matches a single-space-separated value made only of those tokens, in any order, such as an OAuth scope
URL matchinghttp and/or https; one to ten exact lowercase DNS names or IPv4 addresses. Optional port 1–65535 and path/query. No userinfo, wildcard hosts, IPv6, fragments, whitespace or backslashes
actionblock returns 403; excludeRuleTargets excludes selected detection rules for one constrained query field

Exclusions require an exact path, GET/HEAD methods, a matching condition for the excluded query field, and one to ten unique CRS detection IDs from 920000 through 944999. They apply only to bodyless requests; duplicate query parameters are not exempted. Other rules/fields remain protected. No global allow action, engine-off directive, request-body exceptions or arbitrary rule IDs. Query values are URL-decoded by ModSecurity before matching. URL matching uses a conservative ASCII path/query subset; unsupported characters remain subject to the ordinary WAF policy.

Example: Google sign-in callback​

Google returns the granted OAuth scopes in the callback scope parameter, in varying order. userinfo.profile can trigger CRS rule 930120 (OS file access), blocking sign-in with a 403. This rule exempts only that field, only for the exact listed scopes:

{
"version": 1,
"rules": [
{
"name": "Google OAuth callback scope",
"enabled": true,
"path": { "operator": "equals", "value": "/_oauth/google" },
"methods": ["GET"],
"conditions": [
{
"source": "query",
"field": "scope",
"operator": "tokensIn",
"value": [
"email",
"profile",
"openid",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile"
]
}
],
"action": {
"type": "excludeRuleTargets",
"ruleIds": [930120],
"target": { "source": "query", "field": "scope" }
}
}
]
}

Example: local OAuth callbacks​

Configure this on the environment serving the OAuth authorization endpoint, not automatically on the MCP server environment. Confirm rule IDs in WAF logs and verify a fresh authorization flow before claiming the incident is fixed.

{
"version": 1,
"rules": [
{
"name": "Local OAuth callbacks",
"enabled": true,
"path": { "operator": "equals", "value": "/oauth/authorize" },
"methods": ["GET"],
"conditions": [
{
"source": "query",
"field": "redirect_uri",
"operator": "urlMatches",
"value": {
"schemes": ["http"],
"hosts": ["localhost", "127.0.0.1"]
}
}
],
"action": {
"type": "excludeRuleTargets",
"ruleIds": [934110, 931100],
"target": { "source": "query", "field": "redirect_uri" }
}
}
]
}

Example: block a path​

{
"version": 1,
"rules": [
{
"name": "Block private HTTP endpoint",
"path": { "operator": "startsWith", "value": "/private/" },
"methods": ["GET", "POST"],
"conditions": [],
"action": { "type": "block" }
}
]
}

These are WAF policies, not replacements for application authentication or OAuth redirect validation. AI output is untrusted: validation checks supported shape and compilation, not whether your chosen policy fits your application. Conflicting internal ModSecurity/OWASP annotation overrides must be resolved by an operator; the editor never silently overwrites them. Shared platform rules and audit logging remain unchanged.