]> git.ipfire.org Git - thirdparty/suricata.git/commit
lua/detect: remove rule sid, rev and gid globals
authorJason Ish <jason.ish@oisf.net>
Fri, 4 Apr 2025 16:52:51 +0000 (10:52 -0600)
committerVictor Julien <victor@inliniac.net>
Mon, 7 Apr 2025 04:57:46 +0000 (06:57 +0200)
commit92d5a3fd0a17554194971101bb658e928643b141
tree6366828a9a141d779ef4cd1e441bd62c5ede18b8
parent3b271b3f5b06d4e47072e4a8aa5e37b7889df22d
lua/detect: remove rule sid, rev and gid globals

For some rules the values are always 0, for others they get set, so not
consistent. Also not documented and not tested and should be replaced by
a "suricata.rule" lib.

For example, these globals would be set for this rule:

alert tcp any any -> any any (flow:to_server;
flowbits:isnotset,dataset_added; lua:dataset.lua;
flowbits:set,dataset_added;sid:1;rev:99;)

But not this rule:

alert dns any any -> any any (msg:"TEST DNS LUA dns.rrname"; \
      content:"org"; lua:test-rrname.lua; sid:1; rev:1;)

Related to ticket
https://redmine.openinfosecfoundation.org/issues/7490 (but not a fix)

This does not affect the functions with similar names for getting rule
details in output context.
src/detect-lua.c
src/detect-lua.h
src/detect-parse.c