Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

Tetragon: Runtime Security with eBPF

By Kokil Thapa | Last reviewed: August 2026

Traditional web application firewalls and static analysis tools miss attacks that happen inside the kernel or during legitimate process execution. Tetragon: Runtime Security with eBPF solves this by observing and enforcing security policies directly at the operating system level, independent of your application code. For developers managing Laravel APIs, WordPress sites, or microservices on Linux servers, understanding this tool is now essential for defense-in-depth. If you are evaluating infrastructure hardening alongside server security best practices, Tetragon provides the missing visibility layer between your application and the kernel.

What Is Tetragon: Runtime Security with eBPF and How Does It Work?

Tetragon is not another log aggregator or intrusion detection system that reacts after the fact. It is a proactive enforcement engine built on eBPF (extended Berkeley Packet Filter). In my experience maintaining production Linux environments for legal-tech portals and eCommerce platforms, the gap between "application secure" and "kernel secure" is where most sophisticated breaches occur. Tetragon bridges this gap by attaching probes directly to kernel functions.

Unlike traditional auditd or strace, which can impose significant performance penalties, eBPF programs run in a sandboxed virtual machine within the kernel. They verify safety before execution, meaning they cannot crash the host system. Tetragon leverages this to provide deep observability and enforcement with typically less than 3% CPU overhead on modern kernels (Linux 5.15+ recommended for full feature support).

Tetragon Architecture OverviewLinux KernelSyscall / KprobeseBPF Programs(Safe, Sandboxed)Tetragon AgentPolicy EngineEvent Enrichment(User Space)Output / ActionJSON Logs / SIEMProcess Kill / BlockAlertsRaw EventsEnforced Policy
Tetragon: Runtime Security with eBPF architecture flows from safe kernel probes through user-space enrichment to actionable enforcement outputs.

The architecture operates in three distinct phases. First, eBPF hooks capture raw syscall data (execve, openat, connect) with zero-copy efficiency. Second, the Tetragon agent in user space correlates these events with process genealogy, container metadata, and loaded policies. Third, it either logs the enriched event or signals the kernel to block the action immediately. This separation ensures that complex policy logic doesn't block the hot path in the kernel, maintaining stability even under high load.

How Do You Install and Configure Tetragon on Production Linux Servers?

Deployment strategy depends entirely on whether you run bare-metal/VMs or Kubernetes. On a typical Ubuntu 22.04/24.04 server hosting Laravel or WordPress, I prefer the systemd service approach over Docker containers because Tetragon needs direct kernel access anyway. Running it inside Docker adds unnecessary abstraction layers for a tool that must touch the host kernel.

Bare Metal / VM Installation (Ubuntu/Debian)

For standalone servers, use the official APT repository to ensure you receive security patches automatically. As of 2026, Tetragon v1.4+ is the stable release supporting Linux kernels 5.15 through 6.8.

<!-- Add Cilium GPG key and repository -->
curl -fsSL https://deb.cilium.io/gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/cilium-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/cilium-archive-keyring.gpg] https://deb.cilium.io stable main" | sudo tee /etc/apt/sources.list.d/cilium.list

<!-- Install Tetragon -->
sudo apt update
sudo apt install tetragon

<!-- Enable and start the service -->
sudo systemctl enable --now tetragon
sudo systemctl status tetragon

After installation, verify the eBPF programs are loaded correctly. The tetragon status command should show active probes. If you see "failed to load BPF program," check your kernel version with uname -r. Kernels older than 5.15 lack necessary BTF (BPF Type Format) support, requiring either a kernel upgrade or running Tetragon in compatibility mode with reduced functionality.

Kubernetes Deployment via Helm

In containerized environments, Tetragon runs as a DaemonSet. This is the preferred method for clusters running microservices or multi-tenant SaaS applications. The Helm chart handles RBAC, CRDs, and node selector configuration automatically.

helm repo add cilium https://helm.cilium.io/
helm repo update

helm install tetragon cilium/tetragon \
  --namespace kube-system \
  --set tetragon.enabled=true \
  --set export.stdout.enabled=false \
  --set export.aggregator.enabled=true

A common mistake I've seen in production is enabling stdout export in high-traffic clusters. This floods pod logs and consumes disk I/O. Always configure an external exporter (OpenTelemetry, Elasticsearch, or file rotation) for production workloads. For development or debugging, stdout is acceptable, but never leave it enabled on a busy eCommerce site processing hundreds of requests per second.

How Do You Write Effective TracingPolicies for Web Applications?

TracingPolicies are YAML manifests that define what Tetragon watches and how it responds. Unlike generic seccomp profiles that only allow/deny syscalls, TracingPolicies understand process context, file paths, and network destinations. This contextual awareness is what makes Tetragon: Runtime Security with eBPF practical for web developers rather than just kernel engineers.

Blocking Unauthorized Binary Execution

On a hardened web server, your PHP-FPM worker should never spawn a shell. Attackers exploiting RCE vulnerabilities in plugins or dependencies often attempt to execute /bin/bash, /bin/sh, or download scripts via wget/curl. This policy blocks shell execution specifically from the PHP-FPM process tree while allowing legitimate CLI commands during deployment.

apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: prevent-php-shell-execution
spec:
  kprobes:
    - call: "sys_execve"
      syscall: true
      selectors:
        - matchPIDs:
            - operator: In
              values:
                - 1  # init/systemd
          matchActions:
            - action: Sigkill
              kernelReturn: false
        - matchBinaries:
            - path: "/usr/sbin/php-fpm*"
              operator: Prefix
          matchActions:
            - action: Log
              kernelReturn: false
            - action: Override
              overrideAction:
                returnCode: -1  # EPERM
              kernelReturn: true
  options:
    - name: "policy-name"
      value: "prevent-php-shell-execution"

This policy uses two selectors. The first allows PID 1 (systemd) to execute anything unrestricted. The second targets php-fpm binaries specifically, logging attempts and returning EPERM to block execution. The kernelReturn: true flag is critical — without it, Tetragon logs the event but doesn't actually prevent the syscall.

Monitoring Sensitive File Access

Legal-tech portals handling client documents require strict file access auditing. This policy tracks reads to sensitive directories and alerts when unexpected processes access them. Unlike auditd, Tetragon captures the full process ancestry, so you can distinguish between a legitimate backup job and a compromised web worker reading the same files.

apiVersion: cilium.io/v1alpha1
kind: TracingPolicy
metadata:
  name: monitor-sensitive-documents
spec:
  kprobes:
    - call: "sys_openat"
      syscall: true
      selectors:
        - matchPaths:
            - path: "/var/www/legal-portal/storage/documents/"
              operator: Prefix
          matchActions:
            - action: Log
              kernelReturn: false
  lsm:
    - hook: "file_open"
      selectors:
        - matchPaths:
            - path: "/etc/shadow"
              operator: Equal
          matchActions:
            - action: Sigkill
              kernelReturn: false

Note the dual approach: kprobes for broad monitoring with low overhead, LSM (Linux Security Module) hooks for hard enforcement on critical system files. LSM hooks are more restrictive but require kernel 5.7+ with CONFIG_BPF_LSM enabled. Always test LSM policies in log-only mode first; a misconfigured file_open hook can lock you out of SSH.

TracingPolicy Decision FlowSyscall TriggeredMatch SelectorsPID / Binary / PathNo Match?Default: AllowExecute ActionsLog / Kill / OverrideKernel EnforcementBlock / Signal SentCheck RulesMatch FoundOverride/Sigkill
TracingPolicy evaluation determines whether Tetragon: Runtime Security with eBPF logs, allows, or blocks each syscall based on selector matches.

How Does Tetragon Compare to Falco, Auditd, and Seccomp?

Choosing the right runtime security tool requires understanding trade-offs. I've deployed all four in various client environments, and each serves different purposes. Tetragon isn't always the answer — sometimes simpler tools suffice. This comparison reflects real production usage on Ubuntu 22.04/24.04 servers running PHP/Laravel workloads in 2026.

FeatureTetragonFalcoauditdSeccomp
TechnologyeBPF (kprobe + LSM)eBPF / kernel moduleKernel audit subsystemBPF / prctl
EnforcementReal-time block + logDetect only (no block)Log onlyBlock only (no context)
Performance OverheadLow (<3%)Medium (5-10%)High (10-20%+)Negligible
Process ContextFull ancestry + containerFull ancestry + containerLimited (PID only)None
Policy GranularityPath + binary + args + netSyscall + args + fieldsSyscall + path + UIDSyscall numbers only
Kubernetes NativeYes (CRDs, auto-enrich)Yes (Helm, sidecar)No (host-level)Pod-level annotations
Best ForPrevention + observabilityThreat detection + alertingCompliance auditingHardened containers

When to choose Tetragon: You need to actively block attacks, not just detect them. You want unified observability and enforcement in one tool. Your workload is latency-sensitive (eCommerce, APIs) and can't tolerate auditd overhead.

When to stick with Falco: Your primary goal is threat detection and SOC integration. You have existing Falco rulesets and don't need blocking. You're running older kernels without LSM BPF support.

When auditd still wins: Regulatory compliance (PCI-DSS, HIPAA) explicitly requires audit subsystem logs. You need guaranteed logging regardless of eBPF availability. Forensic investigation where completeness matters more than performance.

When seccomp is sufficient: You're hardening immutable containers with known syscall sets. You don't need runtime flexibility or context-aware decisions. Performance is absolutely critical and you've profiled the exact syscall surface.

What Are Common Production Pitfalls When Deploying Tetragon?

I've debugged enough Tetragon deployments to know where things break. These aren't theoretical concerns — they're issues I've encountered on live systems serving real traffic. Avoiding them saves hours of 3 AM troubleshooting.

  • Missing BTF support: Tetragon requires BTF (BPF Type Format) for advanced features. Run ls /sys/kernel/btf/vmlinux to verify. If missing, install linux-image-generic with BTF or compile your kernel with CONFIG_DEBUG_INFO_BTF=y. Without BTF, Tetragon falls back to limited kprobe-only mode, losing LSM enforcement and some context.
  • Overly broad selectors: A policy matching path: "/" with Prefix operator will trigger on every single file operation system-wide. This kills performance and generates terabytes of logs. Always scope to specific binaries, paths, or PIDs. Test with tetragon policy trace before deploying to production.
  • Ignoring kernel version mismatches: eBPF features vary significantly between kernel versions. A policy using bprm_check_security LSM hook works on 5.15+ but fails silently on 5.4. Document your minimum kernel requirement and validate during CI/CD, not at deploy time.
  • Forgetting cgroup v2 requirements: Container-aware features require cgroup v2. Check with stat -fc %T /sys/fs/cgroup/ — it should return "cgroup2fs". If you're on cgroup v1, Tetragon can't correlate events to containers accurately. Migrate to cgroup v2 or accept reduced container visibility.
  • Log rotation misconfiguration: Tetragon's JSON output grows fast. Default journald limits may drop events. Configure explicit log rotation in /etc/tetragon/tetragon.yaml with max file size and retention count. For high-volume systems, ship directly to OpenTelemetry Collector rather than writing to local disk.
Production Deployment Checklist1. Verify PrerequisitesKernel ≥5.15 + BTFcgroup v2 enabled2. Test Policies SafelyLog-only mode firstScoped selectors only3. Configure ExportOTel / File rotationDisable stdout prod4. Validate EnforcementTrigger test violationsConfirm blocks + logs5. Monitor OverheadCPU <3% baselineWatch dropped events6. Document + AutomateGit-managed policiesCI validation pipeline
Six-step production checklist prevents common Tetragon: Runtime Security with eBPF deployment failures on Linux servers.

One subtle issue worth highlighting: Tetragon policies are eventually consistent. When you apply a new policy via tetragon policy apply, there's a brief window (milliseconds to seconds depending on load) where the old policy still applies. For zero-downtime deployments, maintain backward-compatible policies during transitions. Never delete and recreate policies atomically — update them in place using versioned names.

Another gotcha involves namespace isolation in Kubernetes. By default, Tetragon policies apply cluster-wide. If you're running multi-tenant SaaS applications (like those discussed in multi-tenant Laravel architectures), scope policies to specific namespaces using matchNamespaces selectors. Otherwise, a policy intended for tenant A might inadvertently block legitimate operations in tenant B's pods.

Implementing Tetragon: Runtime Security with eBPF in Your Stack

Tetragon represents a fundamental shift from reactive security monitoring to proactive kernel-level enforcement. For teams running PHP/Laravel applications, WordPress sites, or microservices on Linux, it closes the gap between application-layer WAFs and traditional host-based IDS. The key to successful adoption is starting small: deploy in log-only mode, validate against your actual workload patterns, then gradually enable enforcement for high-confidence rules.

Don't try to replace all your security tooling at once. Tetragon complements existing WAFs, vulnerability scanners, and compliance auditors — it doesn't substitute for them. Use it specifically for the attack vectors those tools miss: runtime exploitation, privilege escalation, and unauthorized binary execution. Pair it with solid current cybersecurity practices and regular dependency updates for comprehensive coverage.

If you're managing infrastructure for Nepal-based clients or global SaaS platforms and need help designing a runtime security strategy that balances protection with performance, reach out to discuss your specific architecture. Proper eBPF security requires understanding both your application's legitimate behavior patterns and your threat model — generic policies rarely survive contact with production traffic.

Frequently Asked Questions

Tetragon is an open-source runtime security enforcement tool built on eBPF that observes and blocks malicious behavior at the kernel level. Unlike auditd or AppArmor, it provides real-time visibility into syscalls, file access, and network activity with minimal overhead, enabling precise policy enforcement without modifying application code or relying solely on static signatures.

Yes, Tetragon requires Linux kernel 5.15 or higher for full eBPF tracing support. Kernel 6.x is recommended for advanced features like kprobe multi-attach and improved performance. On older kernels, functionality degrades significantly. Ubuntu 22.04 LTS and Debian 12 ship compatible kernels by default, making them safe choices for production deployments in Nepal or elsewhere.

Tetragon is Apache 2.0 licensed and free for any use, including commercial production systems. Cilium Enterprise offers paid support and managed policies starting around USD 500/month (NPR 67,000), but the core engine remains fully open source with no feature gating.

Tetragon can both monitor and enforce. Using TracingPolicy with action: SIGKILL or action: ENOENT, it terminates or denies system calls matching defined rules. Enforcement happens in-kernel via eBPF LSM hooks, so blocked actions never reach userspace. This makes it suitable for preventing credential theft, reverse shells, or unauthorized file writes in real time.

Install via the official APT repository: add the Cilium GPG key, add the repo, then run apt install tetragon. Enable and start the service with systemctl enable --now tetragon. Verify with tetra status. For production, pin the package version and test policies in dry-run mode first. Avoid installing from source unless you need custom eBPF program modifications.

Overly broad tracing policies cause high CPU usage due to excessive event generation. Always scope policies to specific binaries, namespaces, or cgroups. Avoid tracing high-frequency syscalls like read/write globally. Use sampling or rate limiting in non-critical environments. In my experience running eBPF tools on shared EC2 instances, unscoped policies have caused 30%+ CPU spikes during peak traffic. Monitor /sys/kernel/debug/tracing/trace_pipe for backpressure signals.

Falco uses kernel modules or eBPF probes primarily for detection and alerting, while Tetragon emphasizes in-kernel enforcement with lower latency. Tetragon’s policy language is declarative YAML tied directly to eBPF programs, whereas Falco relies on Lua rules evaluated in userspace. For blocking attacks in real time, Tetragon is superior. For compliance logging and forensic analysis across diverse environments, Falco has broader ecosystem integrations. Many teams now run both: Tetragon for prevention, Falco for audit trails.

Yes, Tetragon exports structured JSON events via stdout, gRPC, or Prometheus metrics. Configure output to Fluent Bit, Vector, or OpenTelemetry Collector for forwarding to Elasticsearch, Loki, or Datadog. Events include process lineage, syscall args, and container metadata. On legal-tech portals I’ve secured, we pipe Tetragon logs to a centralized Loki stack alongside Laravel application logs for unified incident investigation. Ensure log volume is manageable by filtering at the policy level before export.

Create a TracingPolicy targeting sshd binary, monitoring connect and accept syscalls. Add a matcher for failed authentication patterns using return value checks. Combine with rate-limiting logic or pair with fail2ban for IP blocking. Pure eBPF cannot track state across connections easily, so use Tetragon for signal generation and external tools for response. Test thoroughly in monitor mode first; false positives can lock out legitimate admins during maintenance windows.

Yes, when configured correctly. Tetragon adds negligible overhead (<2% CPU) with scoped policies. Avoid tracing PHP-FPM worker processes globally; instead target specific binaries like artisan, queue workers, or suspicious shell executions. On Laravel projects I maintain, Tetragon monitors file writes outside storage/ and blocks unexpected outbound connections from PHP processes. Always validate policies in a staging environment mirroring production load before enabling enforcement.

Use tetra observe --debug to see raw eBPF events and verify matchers fire. Check dmesg for eBPF verifier rejections or map allocation failures. Confirm binary paths and namespace filters are exact; wildcards behave differently than anticipated. Validate kernel compatibility with bpftool feature. If events appear but actions don’t execute, ensure LSM hooks are enabled (CONFIG_BPF_LSM=y). On Ubuntu 22.04, some cloud kernels disable LSM by default, requiring manual kernel parameter tuning.

Yes, Tetragon natively integrates with Kubernetes via DaemonSet deployment and understands pod metadata, labels, and namespaces. Policies can target containers by image name, label selector, or service account. It enforces security boundaries between pods more precisely than network policies alone. For Laravel apps deployed on K8s, I use Tetragon to restrict configmap mounts and block privilege escalation attempts within PHP containers. Ensure your cluster runs a compatible kernel and has BPF LSM enabled.

Tetragon lacks user-space behavioral analytics, memory forensics, endpoint isolation, and automated threat hunting workflows found in commercial EDRs. It operates purely at the syscall layer and cannot inspect encrypted payloads or correlate events across hosts without external tooling. Think of it as a precision scalpel, not a replacement for CrowdStrike or SentinelOne. Best used as a complementary control plane for critical infrastructure where low-level visibility and enforcement matter most.

Upgrade via package manager with apt upgrade tetragon, then reload the service. Tetragon preserves loaded eBPF programs during restart if systemd unit uses Type=notify and proper ExecReload directives. For zero-downtime updates in CI/CD pipelines, deploy new version alongside old, validate health, then swap. Always backup current policies in /etc/tetragon/tetragon.yaml.d/. On production servers I manage, we automate this via GitLab CI with pre-deploy validation scripts to catch incompatible policy syntax before rollout.

The official Tetragon examples repository includes generic web server policies adaptable to Laravel. Community contributions exist in the Cilium GitHub org under tetragon/policies/. For Laravel-specific rules, adapt templates monitoring artisan commands, queue job execution, and file operations in storage/app/. On legal-tech platforms I’ve built, custom policies restrict database CLI access and block curl/wget from PHP contexts. Start with monitor-only mode, collect baseline behavior for two weeks, then refine into enforcement rules based on actual traffic patterns.

Share this article

Quick Contact Options
Choose how you want to connect me: