Actions
Optimization #4753
openlua: fix inconsistency in the init "needs" key
Effort:
Difficulty:
Label:
Description
In Suricata, there's a difference in the usage of needs key, depending on whether one is writing a match or a log function in the lua scripts.
It is better to have the same behavior for both use cases.
Current behavior:
If one wants to use the log ability, the usage is:
function init (args)
local needs = {}
needs["protocol"] = "tls"
return needs
end
If one wants to write a match function in Lua scripts, then it must be:
function init(args)
local needs = {}
needs["tls"] = "true"
return needs
end
Real-life examples:
Example for match: https://github.com/OISF/suricata-verify/blob/master/tests/dns-lua-rules/test-rrname.lua Example for log: https://github.com/OISF/suricata-verify/blob/master/tests/lua-output-dns/test.lua
Expected behavior:
regardless of what function is being written, users should be able to use needs in the same way.
Actions