-
Notifications
You must be signed in to change notification settings - Fork 912
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add k8s event generator #997
Conversation
Currently, the falco event generator only generates system call activity. This adds support for k8s_audit events by adding a script + supporting k8s object files that generate activity that matches the k8s audit event ruleset. The main script is k8s_event_generator.sh, which loops over the files in the yaml subdirectory, running kubectl apply -f for each. In the interests of keeping things self-contained, all objects are created in a `falco-event-generator` namespace. This means that some activity related with cluster roles/cluster role bindings is not performed. Each k8s object has annotations that note: 1. The specific falco rules that should trigger. 2. A user-friendly message to print when apply-ing the file. You can provide a specific rule name to the script. If provided, only those objects related to that rule will trigger. The default is "all", meaning that all objects are created. The script loops forever, deleting the falco-event-generator namespace after each iteration. Additionally, the docker image has been updated to also copy the script + supporting files, as well as fetching the latest available `kubectl` binary. The entrypoint is now a script that allows choosing between: - syscall activity: run with .... "syscall" - k8s_audit activity: run with .... "k8s_audit" - spawn a shell: run with .... "bash" The default is "syscall" to preserve existing behavior. In most cases, you'll need to provide kube config files/directories that allow access to your cluster. A command like the following will work: ``` docker run -v $HOME/.kube:/root/.kube -it falcosecurity/falco-event-generator k8s_audit ``` Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
Noticed these while compiling in the latest alpine image. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
/lgtm |
LGTM label has been added. Git tree hash: fe4cb8e312533f3c6333d3b8760f09fd6f3efe8c
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks @mstemm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fntlnz, markyjackson-taulia The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
It's normal that Circle fails right now, it's not yet enabled on the dev branch and forks so I'm going to merge this. |
falcosecurity/falco#997 recently added support for k8s audit rules to the event generator. This updates the docs to reflect those changes. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
falcosecurity/falco#997 recently added support for k8s audit rules to the event generator. This updates the docs to reflect those changes. Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area integrations
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: