Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUESTION] lua m.log(2, "4444") where is the log message? #185

Open
leveryd opened this issue Jan 15, 2024 · 5 comments
Open

[QUESTION] lua m.log(2, "4444") where is the log message? #185

leveryd opened this issue Jan 15, 2024 · 5 comments

Comments

@leveryd
Copy link

leveryd commented Jan 15, 2024

docker run --privileged --rm -ti owasp/modsecurity-crs:3.3.5-nginx-alpine-202401080101

/etc/modsecurity.d # grep SecRule setup.conf
SecRuleScript "/tmp/2.lua" "id:23333,deny"

/etc/modsecurity.d/owasp-crs # cat /tmp/2.lua
function main()
    --error("4444")
    --print("4444")
    m.log(1,"4444")
    m.log(2,"4444")
    return nil;
end

I am sure lua script have been exectued, but i checked "console output"、"nginx error log", and can not found the log message "4444".

So where is the log message?

@leveryd leveryd changed the title [QUESTION] lua m.log(2, "xxxx") where is the log message? [QUESTION] lua m.log(2, "4444") where is the log message? Jan 15, 2024
@theseion
Copy link
Contributor

I had the same experience. With httpd the log message appeared in the error log, as expected, with nginx, it was nowhere to be found.

@theseion
Copy link
Contributor

Technically, this is not an issue of the images but of ModSecurity, unless Lua logging works with a standard installation. Do you know, @leveryd?

@fzipi
Copy link
Member

fzipi commented Feb 15, 2024

@azurit do you have some experience with this problem?

@azurit
Copy link
Member

azurit commented Feb 15, 2024

@leveryd Try adding this line before m.log:
pcall(require, "m")

@leveryd
Copy link
Author

leveryd commented Mar 12, 2024

@leveryd Try adding this line before m.log: pcall(require, "m")

It still behave the same, i can not find the log message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants