
t
tpmlsm
Open Source๐ Alt to SELinux policiesAn eBPF kernel guard for vTPM access control
๐ณ Self-Hostable๐ No Sign-upโก Editorial Signal: 72/100โ
2 Stars
git clone https://github.com/bschaatsbergen/tpmlsm.gittpmlsm is a security tool leveraging eBPF to monitor and restrict access to virtual Trusted Platform Modules (vTPMs) at the kernel level. It addresses the challenge of securing cloud-native workloads by enforcing strict isolation and access policies for sensitive cryptographic hardware states.
Intercepts and evaluates vTPM access requests using eBPF LSM (Linux Security Modules).
Enforces fine-grained policies to determine which processes can interact with the vTPM.
Runs efficiently inside the Linux kernel without adding significant latency to IO operations.
Hardening multi-tenant Kubernetes clusters against unauthorized vTPM access
Auditing containerized workloads that attempt to utilize cryptographic hardware
Implementing zero-trust security postures for virtualized infrastructure
Unlike static SELinux policies, tpmlsm utilizes eBPF to dynamically inspect and govern vTPM calls with greater flexibility and lower configuration friction.
DevSecOps engineers and infrastructure security specialists hardening Linux and cloud-native environments.
tpmlsm is engineered to eliminate critical operational friction in devops & cloud. From an architectural standpoint, the system adopts a local-first, self-contained deployment posture, ensuring streamlined onboarding and minimal setup overhead.
Because the underlying code is fully open-source, engineering teams can audit security implementations, inspect telemetry vectors, and extend functionality via custom fork without risk of sudden vendor deprecation.
tpmlsm represents an advanced systems security implementation that enforces strict access control over virtual and physical Trusted Platform Modules (vTPMs) at the Linux kernel boundary. Architected around the BPF Linux Security Module (LSM) framework, tpmlsm attaches directly to the security_file_open kernel hook, intercepting all process interactions directed toward TPM device character nodes, specifically /dev/tpm0 and /dev/tpmrm0. When a process issues an open syscall targeting a TPM device, the kernel-space eBPF program executes synchronously within the syscall path. Rather than relying on easily manipulated process identifiers or user privileges, tpmlsm invokes the bpf_ima_file_hash kernel helper function to compute an immutable SHA-256 cryptographic digest of the invoking executable binary directly from page cache memory. This cryptographic hash, paired with the binary's canonical filesystem path, is cross-referenced against a high-speed BPF_MAP_TYPE_HASH lookup map maintained in locked kernel memory. If the calling binary's path and hash do not match an authorized allowlist entry, the eBPF hook instantly denies access, returning an -EPERM error code. Crucially, this enforcement supersedes standard Unix DAC permissions, completely neutralizing unauthorized access attempts even from root or container escape vectors, while maintaining strict verifier-enforced memory safety.
The operational ergonomics of tpmlsm are centered on a lightweight Go userland daemon built on the robust cilium/ebpf library, providing clean management of kernel BPF programs without external C runtime dependencies. Security administrators define granular enforcement policies through straightforward YAML or JSON configuration manifests. The daemon parses specified binary paths, pre-computes or validates their SHA-256 digests, and populates kernel BPF maps during service initialization. For developer workflows, tpmlsm provides intuitive CLI subcommands to inspect active kernel maps, dynamically register new allowlisted binaries, and audit operational access requests. Debugging and observability telemetry are engineered for zero-loss monitoring: tpmlsm leverages BPF ring buffers (BPF_MAP_TYPE_RINGBUF) to stream real-time access events, including process IDs, parent process names, binary hashes, timestamps, and allow/deny verdicts directly to standard systemd journald and structured JSON logs. Prometheus metrics exporters can scrape daemon statistics for cluster-wide visualization. When an unauthorized binary attempts to interact with the TPM, tpmlsm logs an explicit security alert with detailed context, eliminating cryptic kernel oops messages and empowering security engineers to diagnose policy violations and update legitimate cryptographic software binaries with minimal operational friction.
An audit of tpmlsm's total cost of ownership confirms its standing as an exceptionally economical, high-efficiency security primitive for modern infrastructure. Distributed as open-source software under a permissive license, tpmlsm incurs zero recurring licensing fees or proprietary vendor subscriptions. From a compute and hardware resource perspective, tpmlsm imposes virtually imperceptible overhead on host operating systems. The kernel-space eBPF program executes in sub-microsecond timeframes per open syscall, consuming less than one-tenth of a percent of CPU utilization even under heavy container orchestration workloads. Memory utilization is strictly bounded: the userland Go daemon maintains a resident set size (RSS) of less than twenty megabytes, while kernel-space BPF hash maps require only a few kilobytes of non-swappable kernel memory. However, organizations must account for specific kernel prerequisites: host nodes must run Linux kernel version 5.18 or newer, compiled with CONFIG_BPF_LSM=y, CONFIG_IMA=y, and modern BPF JIT compilation enabled. Because tpmlsm eliminates the need for heavyweight commercial endpoint protection agents or cumbersome custom SELinux policy modules, total deployment and ongoing maintenance expenditures remain exceptionally low across enterprise server fleets, reducing both infrastructure overhead and administrative friction.
tpmlsm is decisively production-ready for infrastructure security engineers, cloud providers, and DevSecOps teams responsible for hardening multi-tenant Kubernetes clusters, confidential computing nodes, and enterprise bare-metal hypervisors. In environments where sensitive cryptographic material, disk encryption keys, or remote attestation secrets are bound to vTPMs, tpmlsm provides vital defense-in-depth against malicious root processes and container breakout attacks. Conversely, organizations operating legacy Linux distributions with kernels prior to version 5.18, or systems lacking kernel BPF LSM compilation flags, cannot deploy tpmlsm and should instead rely on strict cgroup device rules or AppArmor profiles. For production rollout, tpmlsm should be deployed as a privileged systemd service on host operating systems or packaged as a privileged DaemonSet across Kubernetes worker nodes. Platform teams must integrate binary hash updates into continuous deployment (CI/CD) pipelines to ensure legitimate software upgrades (such as systemd-cryptsetup or TPM attestation daemons) automatically refresh kernel allowlist maps without service disruptions. Teams should also configure audit-only staging modes to validate binaries before enabling active blocking. When deployed with automated pipeline synchronization, tpmlsm delivers robust, hardware-backed cryptographic isolation with uncompromising performance and security guarantees.
tpmlsm is 100% free and open-source under an open software license. There are no mandatory monthly subscription fees to access the source code or run it locally.
Unlike static SELinux policies, tpmlsm utilizes eBPF to dynamically inspect and govern vTPM calls with greater flexibility and lower configuration friction.
Yes. tpmlsm is designed for self-hosting via Docker or direct server deployment. Running on your own infrastructure allows you to maintain direct control over your local compute, database storage, and operational environment.
No account creation or credit card is required to evaluate tpmlsm. You can immediately access core features or run it locally without onboarding friction.
You can launch or test tpmlsm quickly using the following command: git clone https://github.com/bschaatsbergen/tpmlsm.git Visit the official portal at https://github.com/bschaatsbergen/tpmlsm for documentation and guides.
ToolsRadar maintains strict editorial independence. This review of tpmlsm was conducted using our standardized 5-pillar evaluation framework (Setup, Code Auditability, Maintenance Vitality, Cost Advantage, and Community Signal). We do not accept paid placements to inflate benchmark scores.
Maintainers of tpmlsm and community advocates can display this real-time verification badge in your GitHub README, official documentation, or landing page.
[](https://lordorange.top/tool/tpmlsm)<a href="https://lordorange.top/tool/tpmlsm" target="_blank"><img src="https://lordorange.top/badge/tpmlsm.svg" alt="Featured on ToolsRadar" /></a>Compare other trending developer tools and open-source projects in this space.
Cross-referenced architectural playbooks and category rankings featuring tpmlsm.
High-signal, production-tested utilities with transparent codebases and active communities.
Take back data ownership by replacing expensive monthly cloud subscriptions with self-hosted software.
The definitive guide to escaping SaaS subscription sprawl with Coolify, Traefik, Tailscale, and automated S3 backup pipelines.
Replace sluggish 1970s Unix utilities with blisteringly fast, memory-safe Rust and Go modern CLI powerhouses.