Skip to content

Commit

Permalink
update(userspace/engine): updated no evt.type specified lua warning s…
Browse files Browse the repository at this point in the history
…tring.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
  • Loading branch information
FedeDP authored and jasondellaluce committed Jan 24, 2022
1 parent ae4123b commit 181e7e7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions userspace/engine/lua/rule_loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1059,11 +1059,9 @@ function load_rules(rules_content,

else
num_evttypes = falco_rules.add_filter(rules_mgr, lua_parser, v['rule'], v['source'], v['tags'])
if num_evttypes == 0 or num_evttypes > 100 then
if v['source'] == "syscall" and (num_evttypes == 0 or num_evttypes > 100) then
if warn_evttypes == true then
msg = "Rule "..v['rule']..": warning (no-evttype):\n"
msg = msg.." did not contain any evt.type restriction, meaning it will run for all event types.\n"
msg = msg.." This has a significant performance penalty. Consider adding an evt.type restriction if possible.\n"
msg = "Rule "..v['rule']..": warning (no-evttype):\n".." matches too many evt.type values.\n".." This has a significant performance penalty.\n"
warnings[#warnings + 1] = msg
end
end
Expand Down

0 comments on commit 181e7e7

Please sign in to comment.