Repository navigation
FAQ: including the rules, and the errors that come with getting it wrong #41
Unanswered
fabriziosalmi
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This thread collects the questions that come up repeatedly in issues, with the answer and the reasoning behind it. If yours is not here, reply below.
Full guides live on the documentation site; this is the short form.
Which files am I supposed to include in Nginx?
Only the two aggregate files, each in its own context:
Not the per-category files, and not a glob such as
include .../nginx/*.conf.Why does including a category file fail?
Because
attack.conf,xss.conf,bots.confand the others contain bothmapdirectives, which Nginx only accepts in thehttpblock, andifdirectives, which it only accepts inserverorlocation. No single include context satisfies both, so whichever you pick produces"if" directive is not allowed hereor"map" directive is not allowed here.Reported in #17, #8 and #6.
Nginx says "too long parameter, probably missing terminating character"
Nginx caps a single configuration parameter at 4096 characters, and some generated regular expressions exceed it. It is not a quoting mistake in your file: the line really is that long.
The occurrence in
xss.confwas fixed in #7. A later report againstwaf_maps.confis open and lists the offending lines: #22.Nothing is blocked on HAProxy
Almost always an ACL comparing the request against the literal path of the file rather than loading the patterns from it. These two lines look similar and behave completely differently:
Same for the bot list. Reported in #14, which also led to fixes in
owasp2json.py,json2haproxy.pyandimport_haproxy_waf.py.HAProxy rejects
includeinside a frontendHAProxy has no
includedirective there. Keep theacllines inhaproxy.cfgand point them at the generated files with-f, which is what the shipped ACL archives are for.Does this work with Caddy?
Not through this project. Caddy has its own implementation: caddy-waf. The Caddy importer that used to live here was removed, so issues about it in the tracker predate that split.
Will it block Google and other search engines?
No. The bad-bot list targets SEO crawlers, AI training bots and known scanners, and explicitly allows Google, Bing, DuckDuckGo, Yandex and Baidu. Adjust the generated blocklist or the source lists in
badbots.pyfor a stricter or looser policy.How often are the rules updated?
Daily. A scheduled workflow re-fetches the upstream Core Rule Set, regenerates every backend and publishes a release. Pin a specific release if you need reproducible deployments, since
latestmoves.I edited a file under
waf_patterns/and my change disappearedThat directory holds generated output and is rebuilt by the daily workflow. Changes belong in the converter that produced the file,
json2nginx.pyand its siblings, or upstream inowasp2json.pywhen the problem affects every backend.How do I check my configuration before deploying it?
Then confirm the limit actually fires, because a config that parses is not the same as a config that blocks. A Traefik middleware no router references is silently inert.
Questions welcome below. Bugs and feature requests still belong in issues.
All reactions