# Wallarm Documentation — Full Text > Concatenated full text of every page in https://docs.wallarm.com/ for LLM consumption. > See https://docs.wallarm.com/llms.txt for the indexed (link-only) version. --- ## https://docs.wallarm.com/
| Control | Specifics | Enumerates | Attack |
|---|---|---|---|
| Brute force protection | Counts the number of unique values seen for each parameter within a specified timeframe. | password |
Brute force |
| BOLA protection | object ID, user ID |
BOLA |
|
| Enumeration attack protection | Any parameter | Enum |
|
| Forced browsing protection | Counts the number of unique endpoints accessed in a configured timeframe. | URLs |
Forced browsing |
! " # % ' , - / : ; < = > @ ] _ ` }
* Whitespaces
Characters that must be placed into square brackets `[]` instead of escaping with `\`:
* `. $ ^ { [ ( | ) * + ? \ & ~`
Characters that must be converted to ASCII according to ISO‑8859:
* UTF‑8 characters (for example, the character `ʃ` converted to ASCII is `Ê`)
Character groups:
* `.` for any character except a newline
* `()` for grouping regular expressions, searching symbols present inside `()` or establishing a precedence order
* `[]` for a single character present inside `[]` (case sensitive); the group can be used for the specific cases:
* to ignore case (for example, `[cC]`)
* `[a-z]` to match one of lowercase Latin letters
* `[A-Z]` to match one of capital Latin letters
* `[0-9]` to match one of digits
* `[a-zA-Z0-9[.]]` to match one of lowercase, or capital Latin letters, or digits, or dot
Logic characters:
* `~` is equal to NOT. The inverted expression and the character must be placed into `()`,/.git
```
/[.]git
```
* To match any string that includes .example.com
```
[.]example[.]com
```
* To match any string ending with /.example.*.com where `*` can be any character repeated any number of times
```
/[.]example[.].*[.]com$
```
* To match all IP addresses excluding 1.2.3.4 and 5.6.7.8
```
^(~((1[.]2[.]3[.]4)|(5[.]6[.]7[.]8)))$
```
* To match any string ending with /.example.com.php
```
/[.]example[.]com[.]php$
```
* To match any string that includes sqlmap with letters in lower and upper case: sqLmAp, SqLMap, etc.
```
[sS][qQ][lL][mM][aA][pP]
```
* To match any string that includes one or several values: admin\\.exe, admin\\.bat, admin\\.sh, cmd\\.exe, cmd\\.bat, cmd\\.sh
```
(admin|cmd)[\\].(exe|bat|sh)
```
* To match any string that includes one or several values: onmouse with letters in lower and upper case, onload with letters in lower and upper case, win\\.ini, prompt
```
[oO][nN][mM][oO][uU][sS][eE]|[oO][nN][lL][oO][aA][dD]|win[\\].ini|prompt
```
* To match any string that starts with `Mozilla` but does not contain the string `1aa875F49III`
```
^(Mozilla(~(.*1aa875F49III.*)))$
```
* To match any string with one of the values: `python-requests/`, `PostmanRuntime/`, `okhttp/3.14.0`, `node-fetch/1.0`
```
^(python-requests/|PostmanRuntime/|okhttp/3.14.0|node-fetch/1.0)
```
#### Condition type: ABSENT (`∅`)
The request should not contain the designated part. In this case, the comparison argument is not used.
## Ruleset lifecycle
All created rules and [mitigation controls](https://docs.wallarm.com/about-wallarm/mitigation-controls-overview.md) form a custom ruleset. The Wallarm node relies on the custom ruleset during incoming request analysis.
Changes of rules and mitigation controls do NOT take effect instantly. Changes are applied to the request analysis process only after the custom ruleset **building** and **uploading to the filtering node** are finished.
### Custom ruleset building
Adding a new rule/mitigation control, deleting or changing existing ones in the Wallarm Console → **Security Controls** → **Rules WAF** or **Mitigation Controls** launches a custom ruleset build. During the building process, rules and controls are optimized and compiled into a format adopted for the filtering node. The process of building a custom ruleset typically takes from a few seconds for a small number of rules to up to an hour for complex rule trees.
### Uploading to filtering node
Custom ruleset build is uploaded to the filtering node during the filtering node and Wallarm Cloud synchronization. By default, synchronization of the filtering node and Wallarm Cloud is launched every 2‑4 minutes. [More details on the filtering node and Wallarm Cloud synchronization configuration →](https://docs.wallarm.com/admin-en/configure-cloud-node-synchronization-en.md)
The status of uploading a custom ruleset to the filtering node is logged to the `/opt/wallarm/var/log/wallarm/wcli-out.log` file.
All Wallarm nodes connected to the same Wallarm account receive the same set of default and custom rules for traffic filtering. You still can apply different rules for different applications by using proper application IDs or unique HTTP request parameters like headers, query string parameters, etc.
### Backup and restore
To protect yourself from accidentally misconfigured or deleted rules, you can backup your current custom ruleset.
There are the following rule backup options:
* Automatic backup creation after each [custom ruleset build](#custom-ruleset-building). The number of automatic backups is limited to 7: for each day when you change the rules several times, only the last backup is kept.
* Manual backup creation at any time. The number of manual backups is limited to 5 by default. If you need more, contact the [Wallarm technical support](mailto:support@wallarm.com) team.
You can:
* Access current backups: in the **Rules WAF** section, click **Backups**.
* Create a new backup manually: in the **Backups** window, click **Create backup**.
* Set name and description for the manual backup and edit them at any moment.
!!! info "Naming for automatic backups"
The automatic backups are named by the system and cannot be renamed.
* Load from existing backup: click **Load** for the required backup. When loading from the backup, your current rule configuration is deleted and replaced with the configuration from the backup.
* Delete backup.

!!! warning "Rule modification restrictions"
You cannot create or modify rules or mitigation controls until creating a backup or loading from a backup is complete.
## API calls to get rules
To get custom rules, you can [call the Wallarm API directly](https://docs.wallarm.com/api/request-examples.md#get-all-configured-rules).
## Migrating between tenants
If you have [multiple tenants](https://docs.wallarm.com/installation/multi-tenant/overview.md), you can [migrate](https://docs.wallarm.com/installation/multi-tenant/overview.md#migrating-rules) (copy) rules between them **along with** mitigation controls and Credential Stuffing Detection settings.
To start, click **Migrate rules** in the **WAF Rules** section.
---
## https://docs.wallarm.com/user-guides/rules/rate-limiting/
# Rate Limiting
The [unrestricted resource consumption](https://github.com/OWASP/API-Security/blob/master/editions/2023/en/0xa4-unrestricted-resource-consumption.md) is included in the [OWASP API Top 10 2023](https://docs.wallarm.com/user-guides/dashboards/owasp-api-top-ten.md#wallarm-security-controls-for-owasp-api-2023) list of most serious API security risks. Lack of rate limiting is one of the main causes of this risk. Without proper rate limiting measures, APIs are vulnerable to attacks such as denial-of-service (DoS), brute force and API overuse. This article explains how to safeguard your API and users with Wallarm's rate limit regulation rule.
Wallarm provides the **Advanced rate limiting** [rule](https://docs.wallarm.com/user-guides/rules/rules.md) to help prevent excessive traffic to your API. This rule enables you to specify the maximum number of connections that can be made to a particular scope, while also ensuring that incoming requests are evenly distributed. If a request exceeds the defined limit, Wallarm rejects it and returns the code you selected in the rule.
Wallarm examines various request parameters such as cookies or JSON fields, which allows you to limit connections based not only on the source IP address, but also on session identifiers, usernames, or email addresses. This additional level of granularity enables you to enhance the overall security of a platform based on any origin data.
Note that rate limiting described in this article is one of the ways for load control provided by Wallarm - alternatively, you can apply [brute force protection](https://docs.wallarm.com/admin-en/configuration-guides/protecting-against-bruteforce.md). Use rate limiting to slow down incoming traffic and brute-force protection to completely block the attacker.
## Creating and applying the rule
To set and apply rate limit:
1. Proceed to Wallarm Console:
* **Rules WAF** → **Add rule** or your branch → **Add rule**.
* **Attacks** / **Incidents** → attack/incident → hit → **Rule**.
* **API Discovery** (if [enabled](https://docs.wallarm.com/api-discovery/setup.md)) → your endpoint → **Create rule**.
1. Choose **Mitigation controls** → **Advanced rate limiting**.
1. In **If request is**, [describe](https://docs.wallarm.com/user-guides/rules/rules.md#configuring) the scope to apply the rule to.
1. Set a desired limit for connections to your scope:
* Maximum number for the requests per second or minute.
* **Burst** - maximum number of excessive requests to be buffered once the specified RPS/RPM is exceeded and to be processed once the rate is back to normal. `0` by default.
If the value is different from `0`, you can control whether to keep the defined RPS/RPM between buffered excessive requests execution.
**No delay** points to simultaneous processing of all buffered excessive requests, without the rate limit delay. **Delay** implies simultaneous processing of the specified number of excessive requests, others are processed with delay set in RPS/RPM.
* **Response code** - code to return in response to rejected requests. `503` by default.
Below is an example of rate limiting behavior with a limit of 5 r/s, burst 12 and delay 8.

The first 8 requests (the value of delay) are transferred by Wallarm node without delay. The next 4 requests (burst - delay) are delayed so that the defined rate of 5 r/s is not exceeded. The next 3 requests are rejected because the total burst size has been exceeded. Subsequent requests are delayed.
1. In **In this part of request**, specify request points for which you wish to set limits. Wallarm will restrict requests that have the same values for the selected request parameters.
All available points are described [here](https://docs.wallarm.com/user-guides/rules/request-processing.md), you can choose those matching your particular use case, e.g.:
* `remote_addr` to limit connections by origin IP
* `json` → `json_doc` → `hash` → `api_key` to limit connections by the `api_key` JSON body parameter
!!! info "Restrictions on the value length"
The maximum allowed length of parameter values by which you measure limits is 8000 characters.
1. Wait for the [rule compilation and uploading to the filtering node to complete](https://docs.wallarm.com/user-guides/rules/rules.md#ruleset-lifecycle).
## Rule examples
### Limiting connections by IP to ensure high API availability
Suppose a healthcare company's REST API letting doctors submit patient information through a POST request to the `/patients` endpoint of the `https://example-host.com` host. Accessibility of this endpoint is critically important, and thus it should not be overwhelmed by a large number of requests.
Limiting connections by IP within a certain period of time specifically for the `/patients` endpoint could prevent this. This ensures the stability and availability of the endpoint to all doctors, while also protecting the security of patient information by preventing DoS attacks.
For example, limit can be set to 5 POST requests per minute for each IP address as follows:

### Limiting connections by sessions to prevent brute force attacks on auth parameters
By applying rate limiting to user sessions, you can restrict brute force attempts to find real JWTs or other authentication parameters in order to gain unauthorized access to protected resources. For example, if rate limit is set to allow only 10 requests per minute under a session, an attacker attempting to discover a valid JWT by making multiple requests with different token values will quickly hit the rate limit, and their requests will be rejected until the rate limit period expires.
Suppose your application assigns each user session with a unique ID and reflects it in the `X-SESSION-ID` header. The API endpoint at the URL `https://example.com/api/login` accepts POST requests that include a Bearer JWT in the `Authorization` header. For this scenario, the rule limiting connections by sessions will appear as follows:

The [regexp](https://docs.wallarm.com/user-guides/rules/rules.md#condition-type-regex) used for the `Authorization` value is ``^Bearer\s+([a-zA-Z0-9-_]+[.][a-zA-Z0-9-_]+[.][a-zA-Z0-9-_]+)$`.
If you use JWT (JSON Web Tokens) to manage user sessions, you can adjust the rule to [decrypt](https://docs.wallarm.com/user-guides/rules/request-processing.md#jwt) the JWT and extract the session ID from its payload as follows:

### Limiting connections by customer IDs to prevent server overwhelm
Let us consider a web service that provides access to customer orders data for an online shopping platform. Rate limiting by customer ID can help prevent customers from placing too many orders in a short period of time, which can put a strain on inventory management and order fulfillment.
For example, the rule limiting each customer by 10 POST requests per minute to `https://example-domain.com/orders` may look as below. This example considers a customer ID is [passed](https://docs.wallarm.com/user-guides/rules/request-processing.md#json_doc) in the `data.customer_id` JSON body object.

## Limitations and peculiarities
The rate limit functionality has the following limitations and peculiarities:
* Rate limiting rule is supported by [Security Edge Inline](https://docs.wallarm.com/installation/security-edge/inline/overview.md) and [self-hosted NGINX Node](https://docs.wallarm.com/installation/nginx-native-node-internals.md#nginx-node) only.
The following deployment options do not support the rule:
* [OOB Wallarm deployment](https://docs.wallarm.com/installation/oob/overview.md)
* [Wallarm Connectors](https://docs.wallarm.com/installation/connectors/overview.md)
* The maximum allowed length of parameter values by which you measure limits is 8000 characters.
* If you have multiple Wallarm nodes and the incoming traffic on each node meets the rate limit rule, they are limited independently.
* When multiple rate limit rules apply to incoming requests, the rule with the lowest rate limit is used to limit the requests.
* If an incoming request does not have the point specified in the **In this part of request** rule section, then this rule is not applied as a limitation for that request.
* If your web server is configured to limit connections (e.g. by using the [`ngx_http_limit_req_module`](http://nginx.org/en/docs/http/ngx_http_limit_req_module.html) NGINX module) and you also apply the Wallarm rule, the web server rejects requests by the configured rules but Wallarm does not.
* Wallarm does not save requests exceeding the rate limit, it only rejects them by returning the code chosen in the rule. The exceptions are requests with [attack signs](https://docs.wallarm.com/about-wallarm/protecting-against-attacks.md) - they are recorded by Wallarm even if they are rejected by the rate limiting rule.
## Difference with rate abuse protection
For restricting resource consumption and preventing attacks using massive amounts of requests, besides the described rate limiting, Wallarm provides the [rate abuse protection](https://docs.wallarm.com/api-protection/dos-protection.md).
The rate limiting delays some requests if the rate is too high (puts them to a buffer) and rejects the remaining ones when the buffer is full; when the rate is back to normal, buffered requests are delivered, and no blocking is applied by IP or session, **while** rate abuse protection blocks attackers by their IPs or sessions for some time.
---
## https://docs.wallarm.com/user-guides/rules/vpatch-rule/
# Virtual Patching
In cases when it is impossible to fix a critical [vulnerability](https://docs.wallarm.com/user-guides/vulnerabilities.md) in the code of your application or install the necessary updates quickly, you can create a virtual patch to block all or specific requests to the endpoints that may allow exploiting these vulnerabilities. A virtual patch will block requests even in the monitoring and safe blocking [modes](https://docs.wallarm.com/admin-en/configure-wallarm-mode.md), except the ones originating from the [allowlisted](https://docs.wallarm.com/user-guides/ip-lists/overview.md) IPs.
Wallarm provides the following [rules](https://docs.wallarm.com/user-guides/rules/rules.md) to create a virtual patch:
* **Create a virtual patch** rule - allows creating a virtual patch that blocks requests containing in its selected part one of the [known](https://docs.wallarm.com/attacks-vulns-list.md) attack signs, such as SQLi, SSTi, RCE, etc. Also, you can select **Any request** to block specific requests without any attack signs.
* **Custom attack detector** rule with **Virtual patch** option selected - allows creating a virtual patch that blocks requests containing your own attack signs or your own reason for blocking (see [example](#blocking-all-requests-with-incorrect-x-authentication-header)) that are described with regular expressions. Details on working with a rule based on regular expressions are described [here](https://docs.wallarm.com/user-guides/rules/regex-rule.md).
## Creating and applying the rule
1. Proceed to Wallarm Console:
* **Rules WAF** → **Add rule** or your branch → **Add rule**.
* **Attacks** / **Incidents** → attack/incident → hit → **Rule**.
* **API Discovery** (if [enabled](https://docs.wallarm.com/api-discovery/setup.md)) → your endpoint → **Create rule**.
1. Choose **Mitigation controls** →
* **Virtual patch** or
* **Custom attack detector** (with **Virtual patch** option - see [details](https://docs.wallarm.com/user-guides/rules/regex-rule.md))
1. In **If request is**, [describe](https://docs.wallarm.com/user-guides/rules/rules.md#configuring) the scope to apply the rule to.
1. For the common **Create a virtual patch** rule, set whether to block any request or only the ones containing specific attack signs (**Any request** vs. **Selected**).
1. In **In this part of request**, specify request points for which you wish to set the rule. Wallarm will restrict requests that have the same values for the selected request parameters.
All available points are described [here](https://docs.wallarm.com/user-guides/rules/request-processing.md), you can choose those matching your particular use case.
1. Wait for the [rule compilation and uploading to the filtering node to complete](https://docs.wallarm.com/user-guides/rules/rules.md#ruleset-lifecycle).
## Rule examples
### Blocking specific requests for selected endpoint
Let us say your application's online purchase section accessible at the `example.com/purchase` endpoint crashes upon processing the `refresh` query string parameter. Before the bug is fixed, you need to block requests leading to the crash.
To do so, set the **Create a virtual patch** rule as displayed on the screenshot:

### Blocking exploitation attempts for discovered but not yet fixed vulnerability
Let us say your application accessible at the `example.com` domain has a discovered but not yet fixed vulnerability: the application's `id` parameter is vulnerable to SQL injection attacks. Meanwhile, the Wallarm filtering node is set to monitoring mode and yet you need to immediately block the vulnerability exploitation attempts.
To do so, set the **Create a virtual patch** rule as displayed on the screenshot:

### Blocking all requests with incorrect `X-AUTHENTICATION` header
Let us say your application, accessible at the `example.com` domain, uses the `X-AUTHENTICATION` header in a 32-hex-symbol format for user authentication and you want to reject tokens with an incorrect format.
To do so, set the **Create regexp-based attack indicator** rule and set it to **Virtual patch** as displayed in the screenshot, including:
* Regular expression: `^(.{0,31}|.{33,}|[^0-9a-fA-F]+)$`
* Request part: `header` - `X-AUTHENTICATION`

## API calls for virtual patches
To create virtual patches, you can call the Wallarm API directly. Consider the examples:
* [Create the virtual patch to block all requests sent to `/my/api/*`](https://docs.wallarm.com/api/request-examples.md#create-the-virtual-patch-to-block-all-requests-sent-to-myapi)
* [Create the virtual patch for a specific application instance ID to block all requests sent to `/my/api/*`](https://docs.wallarm.com/api/request-examples.md#create-the-virtual-patch-for-a-specific-application-instance-id-to-block-all-requests-sent-to-myapi)
---
## https://docs.wallarm.com/user-guides/rules/regex-rule/
# Custom Attack Detectors
Wallarm provides the **Custom attack detector** [rule](https://docs.wallarm.com/user-guides/rules/rules.md) to define your own attack signs that are described with regular expressions.
## Creating and applying rule
To set and apply your own attack detector:
1. Proceed to Wallarm Console:
* **Rules WAF** → **Add rule** or your branch → **Add rule**.
* **Attacks** / **Incidents** → attack/incident → hit → **Rule**.
* **API Discovery** (if [enabled](https://docs.wallarm.com/api-discovery/setup.md)) → your endpoint → **Create rule**.
1. Choose **Custom controls** → **Custom attack detector**.
1. In **If request is**, [describe](https://docs.wallarm.com/user-guides/rules/rules.md#configuring) the scope to apply the rule to.
1. Set your attack indicator parameters:
* **Regular expression** - regular expression (signature). If the value of the following parameter matches the expression, that request is detected as an attack. Syntax and specifics of regular expressions are described in the [instructions on adding rules](https://docs.wallarm.com/user-guides/rules/rules.md#condition-type-regex).
!!! warning "Changing the regular expression specified in the rule"
Changing the regular expression specified in the existing rule of the type **Custom attack detector** results in automatic deletion of the rules [**Disable custom attack detector**](#partial-disabling) that use the previous expression.
To disable attack detection by a new regular expression, please create a new **Disable custom attack detector** rule with the new regular expression specified.
* **Experimental** - this flag allows you to safely check the triggering of a regular expression without blocking requests. The requests will not be blocked even when the filter node is set to the blocking mode. These requests will be considered as attacks detected by the experimental method and will be hidden from the event list by default. They can be accessed using search query `experimental attacks`.
* **Attack** - the type of attack that will be detected when the parameter value in the request matches the regular expression.
1. In **In this part of request**, specify [request parts](https://docs.wallarm.com/user-guides/rules/request-processing.md) in which you want to search for attack signs.
1. Wait for the [rule compilation and uploading to the filtering node to complete](https://docs.wallarm.com/user-guides/rules/rules.md#ruleset-lifecycle).
## Rule examples
### Blocking all requests with incorrect `X-AUTHENTICATION` header
Let us say your application, accessible at the `example.com` domain, uses the `X-AUTHENTICATION` header in a 32-hex-symbol format for user authentication and you want to reject tokens with an incorrect format.
To do so, set the **Create regexp-based attack indicator** rule and set it to **Virtual patch** as displayed in the screenshot, including:
* Regular expression: `^(.{0,31}|.{33,}|[^0-9a-fA-F]+)$`
* Request part: `header` - `X-AUTHENTICATION`

### Block all requests with `class.module.classLoader.*` body parameters
One of the ways to exploit the 0-day vulnerability in [Spring Core Framework](https://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/overview.html) (Spring4Shell) is to send the POST request with certain malicious payloads injected into the following body parameters:
* `class.module.classLoader.resources.context.parent.pipeline.first.pattern`
* `class.module.classLoader.resources.context.parent.pipeline.first.suffix`
* `class.module.classLoader.resources.context.parent.pipeline.first.directory`
* `class.module.classLoader.resources.context.parent.pipeline.first.prefix`
* `class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat`
If you use vulnerable Spring Core Framework and the Wallarm node [mode](https://docs.wallarm.com/admin-en/configure-wallarm-mode.md#available-filtration-modes) is different from blocking, you can prevent vulnerability exploitation using the virtual patch. The following rule will block all requests with listed body parameters even in the monitoring and safe blocking modes:

The regular expression field value is:
```bash
(class[.]module[.]classLoader[.]resources[.]context[.]parent[.]pipeline[.]first[.])(pattern|suffix|directory|prefix|fileDateFormat)
```
The Wallarm node operating in the blocking [mode](https://docs.wallarm.com/admin-en/configure-wallarm-mode.md#available-filtration-modes) blocks such vulnerability exploitation attempts by default.
The Spring Cloud Function component also has the active vulnerability (CVE-2022-22963). If using this component and the Wallarm node mode is different from blocking, create the virtual patch as described [below](#block-all-requests-with-class-cloud-function-routing-expression-header).
### Block all requests with `CLASS-CLOUD-FUNCTION-ROUTING-EXPRESSION` header
The Spring Cloud Function component has the active vulnerability (CVE-2022-22963) that can be exploited by injecting malicious payloads into the `CLASS-CLOUD-FUNCTION-ROUTING-EXPRESSION` or `CLASS.CLOUD.FUNCTION.ROUTING-EXPRESSION` header.
If using this component and the Wallarm node [mode](https://docs.wallarm.com/admin-en/configure-wallarm-mode.md#available-filtration-modes) is different from blocking, you can prevent vulnerability exploitation using the virtual patch. The following rule will block all requests containing the `CLASS-CLOUD-FUNCTION-ROUTING-EXPRESSION` header:

!!! info "Blocking requests with the `CLASS.CLOUD.FUNCTION.ROUTING-EXPRESSION` header"
This rule does not block requests with the `CLASS.CLOUD.FUNCTION.ROUTING-EXPRESSION` header but NGINX drops requests with this header as invalid ones by default.
The Wallarm node operating in the blocking [mode](https://docs.wallarm.com/admin-en/configure-wallarm-mode.md#available-filtration-modes) blocks such vulnerability exploitation attempts by default.
There is also the 0-day vulnerability in [Spring Core Framework](https://docs.spring.io/spring-framework/docs/3.2.x/spring-framework-reference/html/overview.html) (Spring4Shell). Learn how to block its exploitation attempts with the [reqexp-based virtual patch](#block-all-requests-with-classmoduleclassloader-body-parameters).
### Block traffic coming from certain USER-AGENT
Let us say you want to deny an `l9explore` automated vulnerability scanner (of any version) to scan your applications for vulnerabilities. As its activity is marked by the corresponding `USER-AGENT` header, configure the rule as displayed on the screenshot:

In the rule:
* Selecting **Virtual patch** as attack type leads to blocking
* All requests containing `l9explore` in the `USER-AGENT` header will be blocked whether they are followed by anything (like version number - `l9explore/1.2.0`) or not (`l9explore`)
## Partial disabling
If the created rule should be partially disabled for a particular branch, this can easily be done by creating the **Disable custom attack detector** rule with the following fields:
- **Regular expression**: previously created regular expressions that must be ignored.
!!! warning "Behavior of the rule if the regular expression was changed"
Changing the regular expression specified in the existing rule of the type [**Custom attack detector**](#creating-and-applying-rule) results in automatic deletion of the rules **Disable custom attack detector** that use the previous expression.
To disable attack detection by a new regular expression, please create a new rule **Disable custom attack detector** with the new regular expression specified.
- **in this part of request**: indicates the parameter that requires setting up an exception.
**Example: Permit an Incorrect X-Authentication Header for a Designated URL**
Let us say you have a script at `example.com/test.php`, and you want to change the format of the tokens for it.
To create the relevant rule:
1. Go to the **WAF Rules** tab
1. Find or create the branch for `example.com/test.php` and click **Create rule**.
1. Choose **Fine-tuning attack detection** → **Disable custom attack detector**.
1. Select the regular expression that you want to disable.
1. Set the point `Header X-AUTHENTICATION`.
1. Click **Create**.

## API call to create the rule
To create the regexp-based attack indicator, you can [call the Wallarm API directly](https://docs.wallarm.com/api/request-examples.md#create-a-rule-to-consider-the-requests-with-specific-value-of-the-x-forwarded-for-header-as-attacks).
---
## https://docs.wallarm.com/user-guides/rules/sensitive-data-rule/
# Masking Sensitive Data
Wallarm provides the **Mask sensitive data** [rules](https://docs.wallarm.com/user-guides/rules/rules.md) to configure data masking so that sensitive data does not leak outside the trusted environment. These rules cut the original value of the specified request point before sending the request to the postanalytics module and Wallarm Cloud. This article describes how to use these rules.
## Overview
In the [hybrid](https://docs.wallarm.com/about-wallarm/shared-responsibility.md#overview) Wallarm installations, when you manage the Wallarm filtering nodes in your infrastructure, and Wallarm manages the Wallarm Cloud component, it is crucial that sensitive data in your requests remains secure within your infrastructure and is not transmitted to any third-party service including [Wallarm Cloud](https://docs.wallarm.com/about-wallarm/api-security-overview.md#how-wallarm-api-security-works).
This goal is achieved using the [shared responsibility model](https://docs.wallarm.com/about-wallarm/shared-responsibility.md): from its side, Wallarm never transmits data exceeding the protection goal and stores all the obtained data [securely](https://docs.wallarm.com/about-wallarm/shared-responsibility.md#client-data-storage-in-cloud) - to your side, Wallarm provides full visibility of what data is sent from node to Cloud and a [set of tools](https://docs.wallarm.com/admin-en/export-to-cloud.md) to shape this transfer to your needs - masking of sensitive data is one of these tools.
!!! info "Other deployment forms"
In **security edge** [installations](https://docs.wallarm.com/about-wallarm/shared-responsibility.md#overview), data is outside your security perimeter; you can still use masking rules to restrict access to the sensitive data by the users of Wallarm Console.
## Side effects
Consider that using **Mask sensitive data** rules can affect:
* The display of [attacks](https://docs.wallarm.com/user-guides/events/check-attack.md)
* The [enumeration attack protection](https://docs.wallarm.com/api-protection/enumeration-attack-protection.md)
* The API Sessions [grouping](https://docs.wallarm.com/api-sessions/setup.md#session-grouping) and [display of context parameters](https://docs.wallarm.com/api-sessions/setup.md#extra-parameters)
## Creating and applying rule
To set and apply data mask:
1. Proceed to Wallarm Console:
* **Rules WAF** → **Add rule** or your branch → **Add rule**.
* **Attacks** / **Incidents** → attack/incident → hit → **Rule**.
* **API Discovery** (if [enabled](https://docs.wallarm.com/api-discovery/setup.md)) → your endpoint → **Create rule**.
1. Choose **Change requests/responses** → **Mask sensitive data**.
1. In **If request is**, [describe](https://docs.wallarm.com/user-guides/rules/rules.md#configuring) the scope to apply the rule to.
1. In **In this part of request**, specify [request points](https://docs.wallarm.com/user-guides/rules/request-processing.md) for which the original value should be cut.
1. Wait for the [rule compilation and uploading to the filtering node to complete](https://docs.wallarm.com/user-guides/rules/rules.md#ruleset-lifecycle).
## Example: masking of a cookie value
Let us say your application accessible at the `example.com` domain uses the `PHPSESSID` cookie for user authentication and you want to deny access to this information for employees using Wallarm.
To do so, set the **Mask sensitive data** rule as displayed on the screenshot.
Note that options you add to **In this part of request** should go in a particular order to reflect in which order Wallarm will [apply parsers](https://docs.wallarm.com/user-guides/rules/request-processing.md) to read the required request element.

---
## https://docs.wallarm.com/user-guides/rules/request-processing/
# Parsing Requests
When analyzing requests, the Wallarm filtering node uses a comprehensive set of parsers. After identifying the request parts, parsers are sequentially applied to each of them to provide request meta parameters further used for attack detection. Available parsers, logic of their usage and possible configurations for this logic are described in this article.
For effective parsing, Wallarm follows these principles:
* Work with the same data as the protected application. For example:
If an application provides a JSON API, then the processed parameters will be also encoded in JSON format. To get parameter values, Wallarm uses JSON parser. There are also more complex cases where the data is encoded several times — for example, JSON to Base64 to JSON. Such cases require decoding with several parsers.
* Consider the context of data processing. For example:
The parameter `name` can be passed in creation requests both as the product name and as a username. However, the processing code for such requests can be different. To define the method of analyzing such parameters, Wallarm may use the URL to which the requests were sent, or other parameters.
## Identifying and parsing the request parts
Starting from the top level of the HTTP request, the filtering node attempts to sequentially apply each of the suitable parsers to each part. The list of applied parsers depends on the nature of the data and the results of the previous training of the system.
The output from the parsers becomes an additional set of parameters that has to be analyzed in a similar way. Parser output sometimes becomes a complex structure like JSON, array, or associative array.
!!! info "Parser tags"
Each parser has an identifier (tag). For example, `header` for the parser of request headers. In the event details in Wallarm Console, the **Parameter** field shows the tags of the parsers applied to reach the request part where the attack was detected, with the final point highlighted.
For example, a **GraphQL aliases** attack detected in the `query` parameter that Wallarm reached through the `post` → `json_doc` → `hash` parsers:

### URL
Each HTTP request contains a URL. To find attacks, the filtering node analyzes both the original value and its individual components: **path**, **action_name**, **action_ext**, **query**.
The following tags correspond to the URL parser:
* **uri** for the original URL value without the domain (for example, `/blogs/123/index.php?q=aaa` for the request sent to `http://example.com/blogs/123/index.php?q=aaa`).
* **path** for an array with URL parts separated by the `/` symbol (the last URL part is not included in the array). If there is only one part in the URL, the array will be empty.
* **action_name** for the last part of the URL after the `/` symbol and before the first period (`.`). This part of the URL is always present in the request, even if its value is an empty string.
* **action_ext** for the part of the URL after the last period (`.`). It may be missing in the request.
!!! warning "Boundary between **action_name** and **action_ext** when several periods"
If there are several periods (`.`) in the last part of the URL after the `/` symbol, problems with the boundary between **action_name** and **action_ext** may occur, such as:
* Boundary set based on the **first** period, for example:
`/modern/static/js/cb-common.ffc63abe.chunk.js.map` →
* ...
* `action_name` — `cb-common`
* `action_ext` — `ffc63abe.chunk.js.map`
* Some elements are missing after parsing, for the example above this could be:
* `action_name` — `cb-common`
* `action_ext` — `ffc63abe`
To fix this, manually edit the **action_name** and **action_ext** points in the [advanced edit form](https://docs.wallarm.com/user-guides/rules/rules.md#advanced-edit-form) of the URI constructor.
* **query** for [query string parameters](#query-string-parameters) after the `?` symbol.
Example:
`/blogs/123/index.php?q=aaa`
* `[uri]` — `/blogs/123/index.php?q=aaa`
* `[path, 0]` — `blogs`
* `[path, 1]` — `123`
* `[action_name]` — `index`
* `[action_ext]` — `php`
* `[query, 'q']` — `aaa`
### Query string parameters
Query string parameters are passed to the application in the request URL after the character `?` in the `key=value` format. The **query** tag corresponds to the parser.
Request example | Query string parameters and values
---- | -----
`/?q=some+text&check=yes` | gRPC-based external processing filter for Istio-managed APIs
Deploy the NGINX Ingress Controller with integrated Wallarm services
Deploy Wallarm to secure APIs managed by Kong Ingress Controller
Run the Native Node in Kubernetes (for connectors and Istio filter)
Deploy Wallarm Sidecar controller for pod security
Out-of-band deployment on Kubernetes using the eBPF technology
Artifacts for Wallarm deployment on AWS
Artifacts for Wallarm deployment on GCP
Artifacts for Wallarm deployment on Microsoft Azure
Artifacts for Wallarm deployment on Alibaba Cloud
Build a Wallarm Docker image and run it on Heroku
Deploy Wallarm in a private or hybrid cloud
Artifacts for Wallarm deployment on AWS
Use the official Amazon Machine Image for NGINX Node (in-line)
Use the official Amazon Machine Image for Native Node (connectors)
Use the Docker image with Elastic Container Service
Use the Terraform module for Wallarm deployment on AWS
Use the Terraform module for Wallarm deployment on AWS
Terraform module for Wallarm on AWS
Wallarm as proxy in AWS Virtual Private Cloud
Wallarm as proxy for Amazon API Gateway protection
Artifacts for Wallarm deployment on GCP
Use the official Google Cloud Machine Image for NGINX Node
Use the Docker image with Google Compute Engine
Artifacts for Wallarm deployment on Microsoft Azure
Use the Docker image with Azure Container Instances
Artifacts for Wallarm deployment on Alibaba Cloud
Use the Docker image with Alibaba Elastic Compute Service
Secure APIs running on Akamai EdgeWorkers
Deploy Wallarm to secure traffic delivered through Amazon CloudFront
Secure APIs running on Azion Edge
Deploy Wallarm to secure traffic running via Cloudflare
Deploy Wallarm to secure APIs running on Fastly
Use Wallarm Node to secure APIs managed by Mulesoft
Deploy Wallarm to secure APIs managed by Azure API Management
Secure APIs running on Apigee
Deploy Wallarm to secure APIs managed through IBM API Connect
Secure APIs managed with SAP Integration Suite API Management
Use Wallarm Node to secure APIs managed by Mulesoft
Deploy Wallarm to secure APIs managed by the Flex Gateway
Deploy Wallarm to secure APIs managed by the Mule Gateway
Let Wallarm detect your OS version to install the appropriate modules
Use the NGINX-based or Native Node Docker image for Wallarm deployment
Run Nodes for multiple tenants with per-account data and access isolation, ideal for SaaS and MSPs
Deploy postanalytics on a dedicated host to scale independently and offload the Filtering Node
Use Wallarm with a custom NGINX build when standard packages do not match your stack
Need something else? Request a custom deployment or integration