Custom rules
Custom rules add your own detections on top of the built-in coverage (SQL injection, XSS, path traversal, command injection and the rest, plus the OWASP Core Rule Set). They never replace or switch off the built-in checks. Custom rules are on the Business plan and above, and during a free trial.
Write a rule
In Settings › Custom rules, fill in:
| Field | Values |
|---|---|
| Rule name | A short name, up to 80 characters, for example block-legacy-endpoint |
| Applies to | Path + query + body (any), Path only (path), Query string only (query), Body only (body) |
| Match type | Contains text (substring) or Regular expression (regex, RE2 syntax) |
| Pattern | Up to 200 characters |
An account can hold up to 100 custom rules.
Examples:
| Name | Applies to | Match type | Pattern | Catches |
|---|---|---|---|---|
block-legacy-endpoint | Path only | Contains text | /old-api/ | Calls to an endpoint you retired |
no-internal-key | Path + query + body | Contains text | INTERNAL-ONLY- | A token prefix that must never come from outside |
wp-login-probe | Path only | Regular expression | ^/wp-login\.php$ | WordPress login probes on a site that isn't WordPress |
Regular expressions use RE2, which runs in linear time: patterns that could backtrack catastrophically are refused, and so are lookarounds and back-references.
From draft to enforcing
A new rule is a draft and matches nothing. It goes live in five steps:
| Step | Button | What happens |
|---|---|---|
| 1. Draft | Save as draft | Saved, matches nothing |
| 2. Validate | Validate | Checks the syntax, that a regex is linear time, and what one evaluation costs, then replays your recent traffic to show what the rule would have caught. It must pass |
| 3. Monitoring | Start monitoring | Runs on live traffic in report-only mode: matches are recorded on the traffic feed and the rule's card, nothing is blocked |
| 4. Approve | Ask to enforce, then Approve and enforce | Another admin approves. If your account has only one admin, you can approve your own request |
| 5. Enforce | A match counts as a detection like any built-in one, with the reason custom_rule:<name> |
- Edit sends a rule back to draft, so a changed pattern is validated and monitored again before it blocks.
- Stop enforcing (roll back to monitoring) takes effect at once.
- Pause stops a rule matching anything; resume it later.
- Every definition is kept in the rule's history, and an older version can be restored.
- An enforcing rule blocks only while Protection is on Block attacks. On Monitor only its matches are recorded as incidents marked
monitor.
Global vulnerability feed
SecOps also adds rules automatically for newly published CVEs whose description names a concrete, matchable attack path. They appear under Global vulnerability feed with their CVE ID, apply to every account, and are managed by Ausbab.
Fixing a false positive
| Blocked by | Narrowest fix |
|---|---|
| Your custom rule | Edit the pattern (it goes back through validation) or pause the rule |
A CRS rule (crs_*) | Add a CRS exclusion for that rule, input and path in Settings › OWASP Core Rule Set |
| Built-in or ML content checks | Raise "Attack score needed to block" a little, for example 0.5 to 0.6 |
| Rate limits | Raise the requests per second or per minute |