> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1256a.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced rule objects and attributes

The following table contains all available objects and attributes you can use in your advanced rules.

| Object       | Attribute                   | Arguments     | Type      | Description                                                              |
| ------------ | --------------------------- | ------------- | --------- | ------------------------------------------------------------------------ |
| client\_data |                             |               | Container |                                                                          |
|              | fingerprint                 |               | Dict      | Client fingerprint object                                                |
| response     |                             |               | Container | Container for response context                                           |
|              | headers                     |               | Dict      | A dictionary of the response headers                                     |
|              | status                      |               | Var       | Status code from the origin (integer)                                    |
| request      |                             |               | Container | Container for request context                                            |
|              | rate\_limit                 |               | Function  | Returns <code>true</code> if the rate limit is exceeded                  |
|              |                             | content\_type | String    | A string with a maximum of 30 characters (optional)                      |
|              |                             | interval      | Integer   | An integer between 1 and +inf                                            |
|              |                             | ip\_list      | List      | A list of 0-10 items: a string representing an UP address (IPv4 or IPv6) |
|              |                             | method\_list  | List      | A list of 0-9 items of: an HTTP method                                   |
|              |                             | requests      | Integer   | An integer between 20 and +inf                                           |
|              |                             | scope         | Choice    | One of the following values: IP or cluster                               |
|              |                             | status\_list  | List      | A list of 0-20 items: an integer between 100 and 999                     |
|              |                             | url           | URL       | A valid URL                                                              |
|              | ip\_in\_range               |               | Function  | Returns true if the client IP is contained within the given range        |
|              |                             | from\_ip      | IP        | A string representing an IP address (IPv4 or IPv6)                       |
|              |                             | to\_ip        | IP        | A string representing an IP address (IPv4 or IPv6)                       |
|              | headers                     |               | Dict      | A dictionary of the request headers                                      |
|              | ip                          |               | Var       | A string representing the client IP                                      |
|              | is\_ajax                    |               | Function  | Returns true if the request type is AJAX                                 |
|              | is\_api                     |               | Function  | Returns true if the request is an API call                               |
|              | is\_static                  |               | Function  | Returns true if the request type is STATIC                               |
|              | method                      |               | Var       | HTTP method (uppercase)                                                  |
|              | origin\_ip                  |               | Var       | A string representing the client origin IP                               |
|              | path                        |               | Var       | Path of the URL                                                          |
|              | query\_params               |               | Var       | Query params                                                             |
|              | upload\_file\_content\_type |               | Var       | Content type of the uploaded file (e.g., image/PNG)                      |
|              | upload\_file\_extension     |               | Var       | File extension of the uploaded file (e.g., PNG)                          |
|              | uri                         |               | Var       | A full URI string                                                        |
|              | url                         |               | Var       | A full URL string                                                        |
|              | all                         |               | Function  | Returns true if all the given tags exist                                 |
|              | any                         |               | Function  | Returns true if one or more of the given tags exist                      |
|              | exists                      |               | Function  | Returns true if the given tag exists                                     |
|              | tag                         |               | String    | A string with a maximum of 30 characters                                 |
|              | tag\_list                   |               | List      | A list of 1-10 items of a string with max 30 characters                  |
| user\_agent  |                             |               | Container | The User-agent header segments in lowercase                              |
|              | client                      |               | Var       | Client name. For example, Chrome, Firefox.                               |
|              | client\_type                |               | Var       | Client type. For example, major, lib.                                    |
|              | client\_version             |               | Var       | Client version. For example, 47.1.23.                                    |
|              | client\_version\_float      |               | Var       | Client version, major.minor part. For example, 47.1.                     |
|              | cpu                         |               | Var       | CPU brand. For example, Intel.                                           |
|              | device                      |               | Var       | Device brand. For example, iPhone, PlayStation.                          |
|              | device\_type                |               | Var       | Device type. For example, mobile, console.                               |
|              | engine                      |               | Var       | Engine type. For example, Gecko, AppleWebKit.                            |
|              | os                          |               | Var       | Client's OS. For example, Linux, Windows 8.                              |
| whois        |                             |               | Container | Container for WHOIS data of the client IP                                |
|              | country                     |               | Var       | Country code (uppercase)                                                 |
|              | org                         |               | Var       | Organization name                                                        |
|              | owner\_type                 |               | Var       | Owner type                                                               |

## Operators for Dict-type attributes

Attributes of type `Dict` (`client_data.fingerprint`, `request.headers`, and `response.headers`) support a different set of operators than `Var`-type attributes. The following three operators are available for all Dict-type attributes:

| Operator       | Description                                                                      |
| -------------- | -------------------------------------------------------------------------------- |
| key exists     | Evaluates to `true` when the specified key is present in the dictionary.         |
| key not exists | Evaluates to `true` when the specified key is absent from the dictionary.        |
| value equals   | Evaluates to `true` when the value for the specified key matches a given string. |

**Examples**

* **key exists** – match requests that include an `Authorization` header:

```
"Authorization" in request.headers
```

* **key not exists** – match requests that do not include a `User-Agent` header:

```
"User-Agent" not in request.headers
```

* **value equals** – match responses where the `Content-Type` header equals `application/json`:

```
response.headers["Content-Type"] == "application/json"
```
