Closed leogr closed 7 months ago
@leogr Can I take up this issue?
@leogr Can I take up this issue?
Yes, please! :+1:
@GLVSKiriti if you want to work on this, please type /assign
in a comment of this issue :pray:
/assign
@GLVSKiriti if you want to work on this, please type
/assign
in a comment of this issue 🙏
Yeah sure! Already raised a PR for this issue. Pls provide our feedback
Describe the bug
Actions that skip due to a non-supported context/prerequisite (e.g., those using
h.InContainer()
) should returnevents.ErrSkipped
with a properReason
. This allows the event-generator to automatically log the correct message.Not OK example
https://github.com/falcosecurity/event-generator/blob/939b3e05a3e7806101031d82866ad0d11c43ed83/events/syscall/change_namespace_privileges_via_unshare.go#L31-L42
The action is supposed to run in a container-only context, so it should return
events.ErrSkipped
whenh.InContainer()
is false.OK example
https://github.com/falcosecurity/event-generator/blob/939b3e05a3e7806101031d82866ad0d11c43ed83/events/syscall/user_mgmt_binaries.go#L29-L36
The action is not supposed to run in a container, so it correctly returns
events.ErrSkipped
whenh.InContainer()
is true.Additional context
This should also be documented in https://github.com/falcosecurity/event-generator/tree/main/events#readme, so /kind documentation
cc @FedeDP @LucaGuerra