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:

FieldValues
Rule nameA short name, up to 80 characters, for example block-legacy-endpoint
Applies toPath + query + body (any), Path only (path), Query string only (query), Body only (body)
Match typeContains text (substring) or Regular expression (regex, RE2 syntax)
PatternUp to 200 characters

An account can hold up to 100 custom rules.

Examples:

NameApplies toMatch typePatternCatches
block-legacy-endpointPath onlyContains text/old-api/Calls to an endpoint you retired
no-internal-keyPath + query + bodyContains textINTERNAL-ONLY-A token prefix that must never come from outside
wp-login-probePath onlyRegular 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:

StepButtonWhat happens
1. DraftSave as draftSaved, matches nothing
2. ValidateValidateChecks 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. MonitoringStart monitoringRuns on live traffic in report-only mode: matches are recorded on the traffic feed and the rule's card, nothing is blocked
4. ApproveAsk to enforce, then Approve and enforceAnother admin approves. If your account has only one admin, you can approve your own request
5. EnforceA 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 byNarrowest fix
Your custom ruleEdit 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 checksRaise "Attack score needed to block" a little, for example 0.5 to 0.6
Rate limitsRaise the requests per second or per minute