Web firewall: rules and exceptions
Every rule of the web firewall with what it reads, and how to keep it on for APIs, code and chat messages.
How the firewall decides
Each rule that matches adds its score; a request with 5 or more is blocked with a 403 page in "block" mode and only recorded in "detect" mode. Most rules score 5 on their own; level 2 and 3 rules score 3.
The sensitivity of the zone (1 standard, 2 strict, 3 very strict) decides which rules run: a rule runs at its level and above.
The 403 page shows the request id. Search it under Security analytics -> Security events to see the rule that matched.
What a rule reads
- uri: the path and query of the request line, URL-decoded
- path: the path nginx routes on
- args: query argument names and values
- body: form fields, or the raw body of a JSON or XML request: the whole body up to 1 MB, of a larger one its first 1 MB and last 64 KB (file uploads are not read)
- headers: every header value except Cookie
- cookies, ua (User-Agent), method
The rules
| ID | Category | Matches | Reads | Level |
|---|---|---|---|---|
| 100100 | Attack tool or scanner | Attack tool user agent | ua | 1 standard |
| 100110 | Attack tool or scanner | Known exploit or probe path | path | 1 standard |
| 100200 | Attack tool or scanner | Missing or scripted user agent | ua | 3 very strict |
| 200100 | Malformed or abusive request | Method not allowed | method | 1 standard |
| 200110 | Malformed or abusive request | Null byte | uri, args, body, headers | 1 standard |
| 200120 | Malformed or abusive request | HTTP header injection | uri, args | 1 standard |
| 300100 | Path traversal or local file access | Path traversal | uri, args, body, cookies | 1 standard |
| 300110 | Path traversal or local file access | Operating system file access | uri, args, body, cookies, headers | 1 standard |
| 300120 | Path traversal or local file access | System path in a parameter | args, body, cookies | 2 strict |
| 310100 | Access to sensitive files | Hidden configuration file | path | 1 standard |
| 310110 | Access to sensitive files | Configuration backup file | path | 1 standard |
| 310120 | Access to sensitive files | Backup or dump file | path | 2 strict |
| 400100 | Command injection | Unix or Windows command | uri, args, body, cookies, headers | 1 standard |
| 400110 | Command injection | Shell path | uri, args, body, cookies, headers | 1 standard |
| 400120 | Command injection | Shellshock | headers, ua, cookies | 1 standard |
| 400130 | Command injection | Short shell command | args, body, cookies | 2 strict |
| 500100 | PHP code injection | PHP open tag | uri, args, body, cookies | 1 standard |
| 500110 | PHP code injection | PHP stream wrapper | uri, args, body, cookies | 1 standard |
| 500120 | PHP code injection | PHP function call | uri, args, body, cookies | 1 standard |
| 500130 | PHP code injection | Code evaluation or PHP object injection | args, body, cookies | 2 strict |
| 600100 | Cross-site scripting | Script tag | uri, args, body, cookies, headers | 1 standard |
| 600110 | Cross-site scripting | Event handler in a tag | uri, args, cookies | 1 standard |
| 600120 | Cross-site scripting | Dangerous HTML tag | uri, args, cookies | 1 standard |
| 600130 | Cross-site scripting | Script URL | uri, args, cookies | 1 standard |
| 600140 | Cross-site scripting | Event handler, script URL or dangerous tag in the body | body | 2 strict |
| 600150 | Cross-site scripting | Script function | uri, args, body, cookies | 2 strict |
| 700100 | SQL injection | UNION SELECT | uri, args, body, cookies | 1 standard |
| 700110 | SQL injection | SQL tautology | uri, args, body, cookies | 1 standard |
| 700120 | SQL injection | SQL time delay | uri, args, body, cookies, headers | 1 standard |
| 700130 | SQL injection | SQL system table or variable | uri, args, body, cookies | 1 standard |
| 700140 | SQL injection | Stacked SQL query | uri, args, body, cookies | 1 standard |
| 700150 | SQL injection | SQL file access or error-based function | uri, args, body, cookies | 1 standard |
| 700160 | SQL injection | Quote followed by an SQL comment | args, body, cookies | 2 strict |
| 700170 | SQL injection | SQL statement | args, body, cookies | 2 strict |
| 700180 | SQL injection | SQL SELECT or string function | args, body, cookies | 3 very strict |
| 800100 | Java and template injection | Log4Shell (JNDI lookup) | uri, args, body, cookies, headers, ua | 1 standard |
| 800110 | Java and template injection | Java class manipulation | uri, args, body | 1 standard |
| 800120 | Java and template injection | Server-side template injection | uri, args, body, cookies | 2 strict |
| 800130 | Java and template injection | XML external entity | body | 1 standard |
| 810100 | Server-side request forgery | Cloud metadata address | uri, args, body | 1 standard |
| 810110 | Server-side request forgery | Unusual URL scheme | args, body | 2 strict |
| 820100 | NoSQL injection | MongoDB operator in a parameter | uri, args | 1 standard |
| 820110 | NoSQL injection | MongoDB operator in JSON | body | 2 strict |
Rules that read the body
These rules also read the request body. A body that holds code (a programming exercise, an AI chat message, a pasted file) can match them although it is not an attack:
- SQL injection: 700100, 700110, 700120, 700130, 700140, 700150, 700160, 700170, 700180
- PHP code injection: 500100, 500110, 500120, 500130
- Cross-site scripting: 600100, 600140, 600150
- Command injection: 400100, 400110, 400130
- Path traversal or local file access: 300100, 300110, 300120
Exceptions for code and user content
On the Web firewall page, under Exceptions, one line per exception. A path matches as a prefix: /api/run covers /api/run, /api/run/42 and also /api/runner, so end a path with / where you mean a folder.
/api/run every rule skips this path
/api/run body the body is user content: no rule reads it,
the address, query and headers are still checked
/api/run body 500100 only rule 500100 skips the body here
/api/exercises/ 500100,600100 these rules are off on this path
500100 rule 500100 is off for the whole zone For a code runner such as /api/run, "/api/run body" is the safest choice: an attack in the address, query or headers is still blocked. Turning every rule off for the path (no rule ids) is wider than needed.
Exceptions by address, header or method
Attack protection -> Exceptions skips the firewall, the browser check or the limits for requests that match a path, addresses, a user agent part, a header (present or equal) and methods, for example webhooks from Telegram's addresses or calls that carry your own secret header. Ready-made: Telegram bot webhooks, an API or MCP path, a Bale or other webhook.
Verified bots
Two lists of bots are let through the browser check and robot blocks, each with its own switch under Attack protection -> Access rules, both on by default. A bot is verified only by the networks its service publishes, never by its user agent: a request that only claims to be Googlebot gets the same checks as anyone. Neither list skips the web firewall.
- Search engines ("Let search engines through"): Google (common and special crawlers), Bing, Apple (Applebot) and DuckDuckGo, from their published lists. They also skip the request limits.
- Link previews and monitors ("Let link previews and monitors through"): Telegram (its published networks), WhatsApp, Facebook and Instagram previews (Meta, AS32934), X/Twitter (AS13414), LinkedIn (AS14413), UptimeRobot, Pingdom and Better Stack (their published address lists). The request limits still apply.
- Not in the lists: Slack and Discord fetch previews from shared cloud networks and publish no ranges, so they cannot be verified. Add an exception by path or header for them if you need to.
- The lists are fetched at most once a day; a source that cannot be reached keeps its last list.
API and MCP
# firewall exceptions (the whole list)
curl -X POST -H "Authorization: Bearer oscust_..." -H "Content-Type: application/json" \
-d '{"exclusions":"/api/run body\n/api/exercises/ body"}' \
https://my.cloud9.ir/api/customer/v1/domains/example.com/services/wafexcl
# find a blocked request by its id
curl -H "Authorization: Bearer oscust_..." \
"https://my.cloud9.ir/api/customer/v1/domains/example.com/security-events?rid=1a42c81abc80d1bdbe04440c04bd1fb9" Our own panel addresses (/mcp, /api/, /oauth/ and any request with an Authorization header on my.cloud9.ir and admin.cloud9.ir) never get the browser check; their limits still apply.
No answer here? Sign in to the portal and open a ticket. Open a ticket