EmergingThreats / et-luajit-scripts

76 stars 18 forks source link

Don't require modules inside functions #2

Open jasonish opened 7 years ago

jasonish commented 7 years ago

Using require inside a function like https://github.com/EmergingThreats/et-luajit-scripts/blob/master/suri-xor-non-zero.lua#L39 will not allow the rule to fail and Suricata startup time. Instead the script will be run each time the rule triggers, then fail.

It also makes it harder to do a dependency pass to make sure all scripts that will be loaded have their dependencies.