falco: version 0.33.1, chart 2.4.3 EKS: k8saudit-eks plugin does not load
Describe the bug
I have successfully deployed falco for syscall events on EKS and wanted to enable support for EKS audit events in the same deployment. However it does not work because k8saudit-eks and json plugins do not load. I followed the documentation https://falco.org/blog/k8saudit-eks-plugin/
How to reproduce it
Here are the configuration of the initial deployement:
falco:
plugins:
- name: k8saudit-eks
library_path: libk8saudit-eks.so
init_config:
shift: 10
polling_interval: 10
use_async: false
buffer_size: 500
open_params: "sandbox-1"
- name: json
library_path: libjson.so
init_config: ""
load_plugins: [json, k8saudit-eks]
falcosidekick:
config:
customfields: "environment:sandbox,source:falco"
datadog:
apikey: ""
minimumpriority: warning
host: "https://api.datadoghq.com"
enabled: true
replicaCount: 2
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
webui:
enabled: true
replicaCount: 1
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
http_output:
enabled: true
url: "http://falcosidekick:2801/"
image:
tag: "0.33.1"
json_output: true
json_include_output_property: true
log_level: debug
resources:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 100m
memory: 512Mi
tty: true
serviceAccount:
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::1234567890:role/FalcoAuditEKS
create: true
name: falco-audit-eks
customRules:
syscall_custom_rules.yaml: |-
There are no logs showing that the plugins are loading:
k logs -l app.kubernetes.io/name=falco -f
Thu Jan 5 13:40:53 2023: Falco version: 0.33.1 (x86_64)
Thu Jan 5 13:40:53 2023: Falco initialized with configuration file: /etc/falco/falco.yaml
Thu Jan 5 13:40:53 2023: Loading rules from file /etc/falco/falco_rules.yaml
Thu Jan 5 13:40:54 2023: Loading rules from file /etc/falco/falco_rules.local.yaml
Thu Jan 5 13:40:55 2023: Loading rules from file /etc/falco/rules.d/syscall_custom_rules.yaml
Thu Jan 5 13:40:56 2023: The chosen syscall buffer dimension is: 8388608 bytes (8 MBs)
Thu Jan 5 13:40:56 2023: Starting health webserver with threadiness 4, listening on port 8765
Thu Jan 5 13:40:56 2023: Enabled event sources: syscall
Thu Jan 5 13:40:56 2023: Opening capture with Kernel module
Thu Jan 5 13:40:56 2023: Falco version: 0.33.1 (x86_64)
Thu Jan 5 13:41:04 2023: Falco version: 0.33.1 (x86_64)
Thu Jan 5 13:41:04 2023: Falco initialized with configuration file: /etc/falco/falco.yaml
Thu Jan 5 13:41:04 2023: Loading rules from file /etc/falco/falco_rules.yaml
Thu Jan 5 13:41:05 2023: Loading rules from file /etc/falco/falco_rules.local.yaml
Thu Jan 5 13:40:56 2023: Falco initialized with configuration file: /etc/falco/falco.yaml
Thu Jan 5 13:40:56 2023: Loading rules from file /etc/falco/falco_rules.yaml
Thu Jan 5 13:40:57 2023: Loading rules from file /etc/falco/falco_rules.local.yaml
Thu Jan 5 13:40:58 2023: Loading rules from file /etc/falco/rules.d/syscall_custom_rules.yaml
Thu Jan 5 13:40:59 2023: The chosen syscall buffer dimension is: 8388608 bytes (8 MBs)
Thu Jan 5 13:40:59 2023: Starting health webserver with threadiness 4, listening on port 8765
Thu Jan 5 13:40:59 2023: Enabled event sources: syscall
Thu Jan 5 13:40:59 2023: Opening capture with Kernel module
Thu Jan 5 13:41:06 2023: Loading rules from file /etc/falco/rules.d/syscall_custom_rules.yaml
Thu Jan 5 13:41:07 2023: The chosen syscall buffer dimension is: 8388608 bytes (8 MBs)
Thu Jan 5 13:41:07 2023: Starting health webserver with threadiness 4, listening on port 8765
Thu Jan 5 13:41:07 2023: Enabled event sources: syscall
Thu Jan 5 13:41:07 2023: Opening capture with Kernel module
I tried to install on another cluster following the documentation https://github.com/falcosecurity/charts/tree/master/falco and have the same problem
driver:
enabled: false
collectors:
enabled: false
controller:
kind: deployment
falco:
rules_file:
- /etc/falco/k8s_audit_rules.yaml
- /etc/falco/rules.d
plugins:
- name: k8saudit-eks
library_path: libk8saudit-eks.so
init_config:
region: "us-east-1"
profile: "default"
shift: 10
polling_interval: 10
use_async: false
buffer_size: 500
open_params: "my-cluster"
- name: json
library_path: libjson.so
init_config: ""
load_plugins: [k8saudit-eks, json]
Expected behaviour
Plugins specified under load_plugins should load
Screenshots
Environment
- Falco version: 0.33.1
- System info: EKS 1.21/1.22
- Cloud provider or hardware configuration:
- OS: AmazonLinux2
- Kernel: 5.4.226-129.415.amzn2.x86_64
- Installation method: Helm
Additional context
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 21 (5 by maintainers)
Here’s my whole
values.yamlI’m using for my demos:I’ve a different daemonset for falco + falcosidekick + falcosidekick-ui, this is why I set also the
json_*andhttp_outputvalues.I think your missing config is :
I will hijack this issue and use this comment to document me trying to get it to work.
I download the plugin and built my own image. For now I am using the stable version of the plugin. I get it from here:
Building the image in the following temporary repo:
I got the plugin to load!
@rtalipov, maybe there is something wrong with your config?
Here is are my overrides:
Next I will add the certificates to the custom image. There is already a PR open for that by @Issif, but I don’t want to wait.
Installing certs works.
Next I will configure permissions.
These seem to be enough:
I have also overridden the included k8s audit rules because the images don’t contain the latest versions.
Still not working. Now it is complaining about plugin requirements:
But I definitely have placed 0.1.0 version of plugin and the rules yaml looks right.
I finally figured it out. The chart is bringing it’s own rules and it is overwriting the rules within the image.
You can use any value you want for “name” (alphanumeric chars and - work definitely). It is just used as an identifier for the respective exception.
Here’s the minimal policy you need: https://github.com/falcosecurity/plugins/tree/master/plugins/k8saudit-eks#aws-iam-policy-permissions
@Issif, yes that was the case, now it’s working, thanks a lot!