Artica Wiki

WAF false positives: targeted exclusions

Artica detects WAF rules that block only legitimate visitors and proposes a targeted exclusion you apply in one click.

Back to the Web Application Firewall section

A WAF rule sometimes blocks your own visitors.
A contact form, a ticket description or a search box can hold text that looks like an attack to the OWASP rules.
The usual reaction is to write whitelist rules by hand.
When that does not work, the administrator disables the WAF for the whole site, and the site loses all its protection.

The False positives page handles this case.
Artica reads the WAF events of the last 7 days and looks for a rule that blocks only legitimate visitors on one path of a site.
When it finds one, it proposes an exclusion limited to that rule, that path, that site and, when it is known, that form field.
Nothing is applied until you click Apply exclusion and confirm.

WAF false positives page with one pending proposal

Benefits

How Artica detects a false positive

The reverse-proxy daemon runs the analysis every hour.
You can also start it with the Analyze now button.

The analysis groups the WAF events of the last 7 days by site, exact path and field.
A field is the part of the request the rule inspected, for example ARGS:description for a form field named description.
When the WAF event names no field, the group covers the whole path.

Each client IP address of a group is then classified.
An IP address is clean when all of the following are true:

An IP address that matches one of these lists is suspicious.
An IP address that cannot be checked, for example a private address with no AS number, is unverified and counts on neither side.
For IPv6, all the addresses of one /56 network count as one visitor.

Artica creates a proposal when a group reaches these three conditions over the 7 days:

  1. At least 5 different clean IP addresses.
  2. No suspicious IP address at all.
  3. At least one request really refused by the WAF.

A group gives one proposal, even when several rules fire on the same field.
The proposal then lists every rule involved.

Requirements

Open the page

There are two ways to reach it.

Web Application Firewall settings of a site with the False positives line

The header shows three counters.
Pending proposals and Applied exclusions count the proposals in each state.
Sites to review counts the sites that have at least one pending proposal.

Under the counters, Artica shows the time of the last analysis and how many groups and IP addresses it checked.
Use Pending, Applied and Rejected to switch lists, and the Site selector to filter on one site.

Read a proposal

Proposal card for two rules on the description field of /support/ticket

In this example, two rules block the description field of the /support/ticket page on the site articatech.main.
The card shows:

Read the evidence before you apply.
Five visitors coming from home ISPs and filling the same form field is a strong sign of a false positive.
If the field should never hold code or SQL, the rule may be doing its job, and you should reject the proposal.

Check the blocked requests

Click Show requests to see the requests of this path that triggered these rules.

Blocked requests window

The list comes from the current access log of the site.
It shows every request of the path that triggered one of the rules, whatever field was involved.
Older events that left the current log are not listed, even though they still count in the evidence.

Apply the exclusion

Click Apply exclusion.
Artica asks for a confirmation and repeats what will change.

Confirmation before applying the exclusion

After you confirm, Artica writes one whitelist entry per rule and rebuilds the WAF rules of the site.
Each entry is limited in four ways:

The directive looks like this:

ctl:ruleRemoveTargetById=942100;ARGS:description

On our test appliance, after the exclusion, the same request on the description field reached the web server.
The same text in another field of /support/ticket was still refused with HTTP 405.

If an analysis changed the list of rules while you were reading the proposal, the page refuses to apply it and asks you to reload.

Applied exclusions

The Applied list shows who applied each proposal and when.

Applied list with the Remove exclusion button

Click Remove exclusion to delete it.
The rules block those requests again as soon as the WAF rules are rebuilt.

The exclusions also appear in Web Firewall > Whitelists, with the exact path and Artica labels.
They are read only on that page.
Remove them from the False positives page, so that the proposal and the whitelist stay in step.

WAF whitelist page with two Artica exclusions

Reject a proposal

Click Reject when the rule is right to block these requests.
The proposal moves to the Rejected list and does not come back by itself.
Click Restore in that list if you change your mind.

Artica also withdraws a pending proposal on its own when a suspicious IP address shows up on the same site, path and field.
A withdrawn proposal can come back only when that suspicious event is more than 7 days old.

Hosting providers

Visitors from data centers, cloud and VPS providers never count as legitimate users.
Artica ships a built-in list of 20 networks, such as OVH, Hetzner Online, Amazon AWS, Microsoft Azure, DigitalOcean and Scaleway.
Click Hosting providers in the header to see it.

Hosting providers list

Notifications

When an analysis creates a new proposal, Artica adds an event to the Web Console notifications.
The event reads WAF: N new false-positive proposal(s) and lists each site, path and field.

Artica AI

Artica AI can list the proposals and their evidence.
It can also apply or reject a proposal, but only after an administrator approves the action.
It never applies an exclusion on its own.

Limitations

Troubleshooting

Message or symptom What to do
The ASN database is missing: IP addresses cannot be classified. Enable the GeoIP database updates.
Without the AS number, Artica cannot tell a home ISP from a hosting provider.
The ipset command is missing: banned IP addresses cannot be checked. Install the ipset package on the appliance.
The WAF audit log holds no event for the last 7 days. Check that the WAF is enabled on your sites and that its events reach the statistics database.
No proposal, although users complain. Check that the default action of the site is Alert and Deny.
Look at the counters under Last analysis: many unverified IP addresses point to a missing database.
This proposal changed since the page was displayed. An analysis added or removed a rule.
Reload the page, read the new list of rules, then apply.
The proposal is applied, but the WAF rules could not be rebuilt. The exclusion is recorded but not active yet.
Read /var/log/reverse-proxy.log, then rebuild the WAF rules.

REST API

The reverse-proxy daemon exposes these routes on its Unix socket /run/reverse-proxy.sock.

Route Purpose
GET /waf/fp/proposals?state=pending&serviceid=91 List the proposals, the counters and the last analysis.
state is pending, applied or rejected.
POST /waf/fp/proposal/{id}/apply Apply a proposal.
Body: {"by":"Manager","rules_key":"941100,942100"}.
POST /waf/fp/proposal/{id}/reject, restore, remove Reject, restore, or remove an applied exclusion.
Body: {"by":"Manager"}.
POST /waf/fp/run Start an analysis in the background.
GET /waf/fp/hosting-asns, POST /waf/fp/hosting-asns Read or change the hosting providers list.
Body: {"action":"add","asn":16276,"name":"OVH"}.

Example:

curl -s --unix-socket /run/reverse-proxy.sock http://localhost/waf/fp/proposals?state=pending