Skip to content
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

helm: enableLsmSensor flag #3485

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

anfedotoff
Copy link
Contributor

@anfedotoff anfedotoff commented Mar 8, 2025

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:

helm install --namespace kube-system \
        --set tetragon.grpc.address="unix:///var/run/cilium/tetragon/tetragon.sock" \
--set tetragon.enableLsmSensor=true \
tetragon .

Demo Pod:

kubectl create -f https://raw.githubusercontent.com/cilium/cilium/v1.15.3/examples/minikube/http-sw-app.yaml

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:

kubectl exec -ti xwing -- bash -c 'cat /etc/passwd'

@anfedotoff anfedotoff requested a review from a team as a code owner March 8, 2025 17:59
@anfedotoff anfedotoff requested a review from olsajiri March 8, 2025 17:59
Copy link

netlify bot commented Mar 8, 2025

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit 2e3c1ba
🔍 Latest deploy log https://app.netlify.com/sites/tetragon/deploys/67cc85818ef3390008d2d227
😎 Deploy Preview https://deploy-preview-3485--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

Signed-off-by: Andrei Fedotov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant