Use Tetragon to detect privilege escalation by monitoring kernel credential change functions with a TracingPolicy kprobe

domain: tetragon.io · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Create a TracingPolicy with a kprobe on the commit_creds kernel function, which is called whenever a process's credentials are updated
  2. Declare the cred struct as the first argument so Tetragon can extract UID, GID, and capability fields from the new credentials
  3. Add a matchArgs or matchCaps selector that triggers when the new UID equals 0 or when capabilities such as CAP_SYS_ADMIN are gained
  4. Optionally add matchBinaries to flag only unexpected binaries performing the privilege change
  5. Apply the policy and simulate a privilege escalation (e.g., via a setuid binary in a test container); confirm Tetragon emits a process_kprobe event
  6. Forward events to a SIEM via tetra getevents --output json for correlation and alerting

Known gotchas

Related routes

Define a Cilium Tetragon TracingPolicy with a kprobe to monitor exec of specific binaries
tetragon.io · 6 steps · unrated
Write a Tetragon TracingPolicy using a kprobe on tcp_connect to monitor outbound TCP connections at the process level
tetragon.io · 6 steps · unrated
Define a Tetragon TracingPolicyNamespaced to scope a kprobe policy to a single Kubernetes namespace without cluster-admin privileges
tetragon.io · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans