Closed nnoromuche closed 1 month ago
@Nnoromuche There are some possible reasons for this issue, in my case when I was running Falco in the least privileged mode it didn't have the necessary permissions to load the eBPF driver. If we use Pod Security policies in the Kubernetes cluster, they might restrict the capabilities of the Falco pods, preventing them from loading the eBPF driver.
Here are the key permissions required to run Falco with eBPF driver:
You can check whether these necessary permissions are given or not in Kubernetes least privileged mode.
@rashim27us thanks, I am running falco with the below deployment.yaml
file and the SYS_ADMIN_Capability
is being set.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: test-falco
namespace: test
spec:
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 10%
selector:
matchLabels:
app: test-falco
template:
metadata:
name: test-falco
namespace: test
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: "/metrics"
prometheus.io/port: "12076"
prometheus.istio.io/merge-metrics: "false"
sidecar.istio.io/inject: "false"
labels:
app: test-falco
addonmanager.kubernetes.io/mode: Reconcile
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
tolerations:
- operator: Exists
volumes:
- name: dshm
emptyDir:
medium: Memory
- name: containerd-socket
hostPath:
path: /run/containerd/containerd.sock
- name: proc-fs
hostPath:
path: /proc
- name: boot-fs
hostPath:
path: /boot
- name: lib-modules
hostPath:
path: /lib/modules
- name: usr-fs
hostPath:
path: /usr
- name: etc-fs
hostPath:
path: /etc
- name: root-falco-fs
emptyDir: {}
containers:
- name: test-falco
image: (( concat "{{ FALCO_IMAGE_REPO_HOSTNAME}}/test/test-falco:" metadata.annotations.version ))
env:
- name: HOST_ROOT
value: "/host"
securityContext:
capabilities:
drop:
- all
add:
- SYS_ADMIN
- SYS_RESOURCE
- SYS_PTRACE
livenessProbe:
httpGet:
path: /liveness
port: 12077
periodSeconds: 60
failureThreshold: 10
readinessProbe:
httpGet:
path: /readiness
port: 12077
periodSeconds: 60
failureThreshold: 10
volumeMounts:
- mountPath: /host/run/containerd/containerd.sock
name: containerd-socket
- mountPath: /host/proc
name: proc-fs
readOnly: true
- mountPath: /host/boot
name: boot-fs
readOnly: true
- mountPath: /host/lib/modules
name: lib-modules
readOnly: false
- mountPath: /host/usr
name: usr-fs
readOnly: true
- mountPath: /dev/shm
name: dshm
- mountPath: /host/etc
name: etc-fs
readOnly: true
- mountPath: /root/.falco
name: root-falco-fs
resources:
requests:
cpu: 25m
memory: 230Mi
limits:
memory: 400Mi
The edpf driver
is installed using falcoctl commands
/usr/bin/falcoctl driver config --type ebpf
/usr/bin/falcoctl driver install --compile --download
Wondering is there a missing configuration in the above deployment.yaml
file?
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/falcosecurity/community.
/lifecycle rotten
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
Provide feedback via https://github.com/falcosecurity/community. /close
@poiana: Closing this issue.
Describe the bug When I run falco as a demonset in least priviledge mode using the edpf driver on a red hat enterprise linux 8.9, I see multiple falco process restarts in the logs on a kubernetes environment. When I run falco with the edpf driver in privilege mode, it works fine, however running in least privilege results in multiple restarts.
How to reproduce it Add the following capabilities to the security context in the deployment.yaml file
Logs shows
Expected behaviour
I will like falco to run in least priviledge mode on a red hat enterprise linux 8.9 machine without multiple restarts.
Environment