Skip to content

v3/master Lua unknown error #1809

Closed
Closed
@theMiddleBlue

Description

@theMiddleBlue

Hi,

I've a problem using exec: or defining a SecRuleScript with a test Lua script. Following my configurations and test:

Rule:

SecRule REQUEST_FILENAME "^/test" "phase:2,id:41,pass,exec:/opt/modseclua/test.lua

# or

SecRuleScript "/opt/modseclua/test.lua" "phase:5,pass"

My test Lua script:

function main()
	-- m.log(1, "Hello world!");
	return nil;
end

In both cases I got an empty response and an unknown error makes nginx workers to crash:

modsecurity debug log:

[4] (Rule: 41) Executing operator "Rx" with param "^/test" against REQUEST_FILENAME.
[9] Target value: "/test" (Variable: REQUEST_FILENAME)
[9] Matched vars updated.
[4] Rule returned 1.
[9] (SecDefaultAction) Running action: log
[9] Saving transaction to logs
[9] (SecDefaultAction) Running action: auditlog
[4] (SecDefaultAction) ignoring action: deny (rule does not cotains block)
[9] (SecDefaultAction) Running action: status
[4] Not running disruptive action: pass. SecRuleEngine is not On
[4] Running (non-disruptive) action: exec
[8] Running script... /opt/modseclua/test.lua

nginx error.log

2018/06/20 14:05:12 [alert] 10192#0: worker process 10276 exited on signal 11

I've try to run my script and it works:

root@mywebsite:~# cat /opt/modseclua/test.lua 
function main()
	print("test")
	-- m.log(1, "Hello world!");
	return nil
end

main()
root@mywebsite:~# 
root@mywebsite:~# 
root@mywebsite:~# lua5.2 /opt/modseclua/test.lua 
test
root@mywebsite:~# 

Any idea? Am I doing something wrong?

thanks.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions