mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-28 07:37:32 +00:00
Allow unknown top level objs as warnings
When parsing a rules file, if a top level object is not one of the known types rule, macro, list, required_engine_version, instead of failing parsing, add a warning instead. This adds some forwards-compatibility to rules files. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
This commit is contained in:
parent
07abb89f36
commit
4f192e89fa
@ -448,14 +448,14 @@ function load_rules_doc(rules_mgr, doc, load_state)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
-- Remove the context from the table, so the table is exactly what was parsed
|
|
||||||
local context = v['context']
|
local context = v['context']
|
||||||
v['context'] = nil
|
|
||||||
return false, build_error_with_context(context, "Unknown rule object: "..table.tostring(v)), warnings
|
arr = build_error_with_context(context, "Unknown top level object: "..table.tostring(v))
|
||||||
|
warnings[#warnings + 1] = arr[1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return true, {}, {}
|
return true, {}, warnings
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Returns:
|
-- Returns:
|
||||||
|
Loading…
Reference in New Issue
Block a user