Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Commit

Permalink
Fix script execution error
Browse files Browse the repository at this point in the history
Previously, execution of this script would fail with the following error in the audit log:

```
Message: Lua: Script execution failed: /usr/share/modsecurity-crs/lua/gather_ip_data.lua:8: attempt to concatenate local 'remote_addr' (a nil value)
```

using REMOTE_ADDR instead of ARGS.REMOTE_ADDR in the script fixes this issue.
  • Loading branch information
sam-hobbs committed Aug 29, 2016
1 parent c7b2761 commit 5b30211
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/gather_ip_data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require("io");
function main()
local anomaly_score = m.getvar("TX.ANOMALY_SCORE", "none");
m.log(4, "Anomaly Score is: " .. anomaly_score .. ".");
local remote_addr = m.getvar("ARGS.REMOTE_ADDR", "none");
local remote_addr = m.getvar("REMOTE_ADDR", "none");
m.log(4, "Remote IP is: " .. remote_addr .. ".");
local ip_hostname = m.getvar("IP.HOSTNAME", "none");

Expand Down

0 comments on commit 5b30211

Please sign in to comment.