corazawaf / coraza

OWASP Coraza WAF is a golang modsecurity compatible web application firewall library
https://www.coraza.io
Apache License 2.0
2.23k stars 221 forks source link

Action 'exec' does not work #1048

Open gassonet9 opened 6 months ago

gassonet9 commented 6 months ago

Description

Hello, good morning everyone, I have installed coraza+haproxy, and I am having trouble executing a script in a rule, I edit a file adding the default rule that is in the documentation with the 'exec' parameter but when I restart the service, this one falls. I thought it could be a problem with the user running coraza, who does not have permissions, but this is more than proven. It would be of great help to be able to implement this measure

I get the rule of the documention of coraza with the parameter exec, but when i restart de service, this don't up. Rules that i implement: {

Run external program on rule match

SecRule REQUEST_URI "^/cgi-bin/script.pl" "phase:2,id:112,t:none,t:lowercase,t:normalizePath,block,\ exec:/etc/coraza-spoa/script/test.sh"

Run Lua script on rule match

SecRule ARGS:p attack "phase:2,id:113,block,exec:/etc/coraza-spoa/script/exec.lua" }

Expected result

The expected result is that the service will restart and detect when you make a request via url for the rule to be activated

Actual result

Since I took the rule from the official cuirass document, I thought it would work but the service crashes when restarting it.

jcchavezs commented 4 months ago

Check https://github.com/jcchavezs/coraza-exec-action-wasm