-
Notifications
You must be signed in to change notification settings - Fork 83
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
k8saudit plugin - Log File Backend, recursively check the directory #182
Comments
Hey @AleksVAnd Thank you for reporting this! A book author here, and IMO you are right 😸 The example in the book with We should consider fixing this in Falco (since the yaml conversion happens there) or in the plugin. 🤔 cc @jasondellaluce |
I think this should be fixed on two fronts:
|
Thank you for the quick response! There seems to be a nice module for this https://github.com/karrick/godirwalk |
Thank you, Yarden. The audit log configuration for Kubernetes includes rotation of the files but it's a flat structure - only a single directory. Therefore, it is not necessary to recursively search the input path. I would like to try and implement a for loop logic in k8saudit.go - please assign me. |
Since falcosecurity/falco#2267 already addresses the fiexes on the Falco side, I'm gonna move this issue to falcosecurity/plugins for clarity. |
/assign AleksVAnd It would be great if you're willing to help making these changes to the k8saudit plugin! Please let me know if you encounter any difficulties. |
Thank you for the guidance, Jason! I look forward to becoming more experienced in Falco and contributing further. |
Describe the bug
The k8s audit plugin doesn't recursively search the directory for log files.
How to reproduce it
For retention purposes, configure k8s to save audit logs as files. Modify the values.yaml of to mount the volume from the host to /var/log/k8saudit on the Falco containers. Configure the plugin's open_params to point to the container audit directory.
Expected behaviour
According to the Falco book (O'Reilly, 2022, page 153), for log files the config should be with ">":
open_params: >
/file/path
The greater than (>) sign includes the carriage return (\n) which is an invalid symbol for the Golang URL parser. It worked when I just typed the URL on the same line as the key.
Falco opens the directory, recursively searches the contents and parses each audit file it finds.
Evidence
Environment
0.32.2
23~20.04.2-Ubuntu SMP
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
Linux testlab-0 5.15.0-1017-gcp 23~20.04.2-Ubuntu SMP x86_64
Helm chart
Additional context
None
The text was updated successfully, but these errors were encountered: