root@wall:~/coraza # git clone https://github.com/corazawaf/coraza-spoa.gitCloning into 'coraza-spoa'...remote: Enumerating objects: 965, done.remote: Counting objects: 100% (451/451), done.remote: Compressing objects: 100% (178/178), done.remote: Total 965 (delta 315), reused 311 (delta 265), pack-reused 514Receiving objects: 100% (965/965), 288.82 KiB | 999.00 KiB/s, done.Resolving deltas: 100% (497/497), done.root@firewall:~/coraza # cd ./coraza-spoaroot@firewall:~/coraza/coraza-spoa # makemake: "/root/coraza/coraza-spoa/Makefile" line 22: Invalid line typemake: "/root/coraza/coraza-spoa/Makefile" line 24: Invalid line typemake: "/root/coraza/coraza-spoa/Makefile" line 28: Invalid line typemake: "/root/coraza/coraza-spoa/Makefile" line 29: warning: duplicate script for target "ifeq" ignoredmake: "Makefile" line 23: warning: using previous script for "ifeq" defined heremake: "/root/coraza/coraza-spoa/Makefile" line 29: warning: duplicate script for target "(,)" ignoredmake: "Makefile" line 23: warning: using previous script for "(,)" defined heremake: "/root/coraza/coraza-spoa/Makefile" line 30: Invalid line typemake: Fatal errors encountered -- cannot continuemake: stopped in /root/coraza/coraza-spoa
defaults log global option httplog timeout client 1m timeout server 1m timeout connect 10s timeout http-keep-alive 2m timeout queue 15s timeout tunnel 4h # for websocketfrontend test mode http bind *:80 unique-id-format %[uuid()] unique-id-header X-Unique-ID filter spoe engine coraza config /etc/haproxy/coraza.cfg # Currently haproxy cannot use variables to set the code or deny_status, so this needs to be manually configured here http-request redirect code 302 location %[var(txn.coraza.data)] if { var(txn.coraza.action) -m str redirect } http-response redirect code 302 location %[var(txn.coraza.data)] if { var(txn.coraza.action) -m str redirect } http-request deny deny_status 403 hdr waf-block "request" if { var(txn.coraza.action) -m str deny } http-response deny deny_status 403 hdr waf-block "response" if { var(txn.coraza.action) -m str deny } http-request silent-drop if { var(txn.coraza.action) -m str drop } http-response silent-drop if { var(txn.coraza.action) -m str drop } # Deny in case of an error, when processing with the Coraza SPOA http-request deny deny_status 504 if { var(txn.coraza.error) -m int gt 0 } http-response deny deny_status 504 if { var(txn.coraza.error) -m int gt 0 } use_backend test_backendbackend test_backend mode http http-request return status 200 content-type "text/plain" string "Welcome!\n"backend coraza-spoa mode tcp balance roundrobin timeout connect 5s # greater than hello timeout timeout server 3m # greater than idle timeout server s1 127.0.0.1:9000