mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-27 15:17:50 +00:00
update(userspace/falco/app): check illegal source setup in live inspectors
Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
This commit is contained in:
parent
893a3c90da
commit
9d29a3afb2
@ -187,6 +187,23 @@ falco::app::run_result falco::app::actions::init_inspectors(falco::app::state& s
|
|||||||
{
|
{
|
||||||
return run_result::fatal(err);
|
return run_result::fatal(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// in live mode, each inspector should have registered at most two event sources:
|
||||||
|
// the "syscall" on, loaded at default at index 0, and optionally another
|
||||||
|
// one defined by a plugin, at index 0
|
||||||
|
if (!s.is_capture_mode())
|
||||||
|
{
|
||||||
|
const auto& sources = src_info->inspector->event_sources();
|
||||||
|
if (sources.size() == 0 || sources.size() > 2 || sources[0] != falco_common::syscall_source)
|
||||||
|
{
|
||||||
|
std::string err;
|
||||||
|
for (const auto &s : sources)
|
||||||
|
{
|
||||||
|
err += (err.empty() ? "" : ", ") + s;
|
||||||
|
}
|
||||||
|
return run_result::fatal("Illegal sources setup in live inspector for source '" + src + "': " + err);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if some plugin remains unused
|
// check if some plugin remains unused
|
||||||
|
Loading…
Reference in New Issue
Block a user