corazawaf / coraza-caddy

OWASP Coraza middleware for Caddy. It provides Web Application Firewall capabilities
https://www.coraza.io/
Apache License 2.0
330 stars 41 forks source link

parsing caddyfile tokens for 'coraza_waf': invalid key for filter directive: load_owasp_crs #105

Open rmGFW opened 10 months ago

rmGFW commented 10 months ago
{"level":"info","ts":1700875769.2244117,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":"caddyfile"}
Error: adapting config using caddyfile: parsing caddyfile tokens for 'coraza_waf': invalid key for filter directive: load_owasp_crs, at /etc/caddy/Caddyfile:7
{
    order coraza_waf first
}

http://127.0.0.1:8080 {
 coraza_waf {
    load_owasp_crs
    directives `
    Include @coraza.conf-recommended
    Include @crs-setup.conf.example
    Include @owasp_crs/*.conf
    SecRuleEngine On
    `
  }
  reverse_proxy http://127.0.0.1:5173
}

command output of caddy list-modules


  Standard modules: 106

dns.providers.alidns
http.handlers.waf

  Non-standard modules: 2

  Unknown modules: 0

build command

    xcaddy build v2.7.5 --with github.com/caddy-dns/alidns --with github.com/corazawaf/coraza-caddy
jptosso commented 10 months ago

You missed /v2 xcaddy build v2.7.5 --with github.com/caddy-dns/alidns --with github.com/corazawaf/coraza-caddy/v2

jcchavezs commented 6 months ago

Can we close this?

Simbiat commented 3 months ago

This should be somewhere in the documentation, that you need to use /v2 or it should be the version picked up by default, I believe. I had the same issue and googling was not really finding anything for me.

M4tteoP commented 1 month ago

This should be somewhere in the documentation

Hey, the command provided in the readme under Build Caddy with Coraza WAF already shows it, what we can do it adding an extra note line close to that command trying to catch the reader's attention.