Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This flag allows to mount (read-only)
/sys/kernel/security
directory in Tetragon container./sys/kernel/security/lsm
file is used to check if LSM BPF is enabled on system.Description
It was a long story about how we tried to fix LSM sensor for k8s environment: #3392 #3404 #3456.
The only way is to mount
/sys/kernel/security directory
to Tetragon container . It works fine, I tested on my minikube cluster.minikube start --driver=docker --mount --mount-string="/sys/kernel/security:/sys/kernel/security" --memory=8096 --cpus=8 minikube ssh -- sudo mount bpffs -t bpf /sys/fs/bpf
Install Tetragon:
Demo Pod:
Apply Policy and monitor logs:
kubectl apply -f ./go/src/github.com/cilium/tetragon/examples/tracingpolicy/lsm_file_open.yaml kubectl exec -ti -n kube-system ds/tetragon -c tetragon -- tetra getevents -o compact --pods xwing
Check policy: