Closed GLVSKiriti closed 7 months ago
@FedeDP @leogr this rule also triggering fine but the question is whats your feedback on generating an executable binary with go build command.
In order to execute this event to trigger the rule we need a executable binary which is not part of base image. So IMO best option is creating a executable, so I used go build. Wdyt? Is there any better alternative to generate this event
@FedeDP @leogr this rule also triggering fine but the question is whats your feedback on generating an executable binary with go build command.
I think we should definitively avoid depending on any compiler, including Go.
I hope we can exploit the event-generator
binary itself for these purposes. I'm waiting @loresuso for this https://github.com/falcosecurity/event-generator/pull/198#pullrequestreview-1980059940, then we will see.
Thank you for your patience :innocent:
@leogr @FedeDP I came up with a new solution please provide the feedback.
Instead of creating a new binary be relying on go lang etc..
I copied the binary file of ls command i.e, /bin/ls and created a new binary in /bin i.e, /bin/ls-created-by-event-generator
Now I executed the command ls-created-by-event-generator which is new binary created by us in container i.e, it is not part of docker image used to create container. So even the command is unsuccessful it triggers the rule.
I tested it by running the following commands in alpine container
cp /bin/ls /bin/ls-created-by-event-generator"
ls-created-by-event-generator"
And this method is working fine. It triggers the rule perfectly
It LGTM, cc @leogr wdyt?
LGTM label has been added.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: GLVSKiriti, leogr
The full list of commands accepted by this bot can be found here.
The pull request process is described here
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area events
What this PR does / why we need it:
Added an event for default stable rule 'Drop and execute new binary in container' as mentioned here
Which issue(s) this PR fixes:
Fixes #195
Special notes for your reviewer: