spinningfactory /kloak
Cloud native zero trust security for AI agents run environments
★ 299⑂ 11👁 4⑃ 328● 50▤ 7
+0
日增长
299
stars
11
forks
4
watchers
328
prs
50
issues
7
releases
README
Kloak Secure Your Secrets, Agentless Kubernetes eBPF HTTPS interceptor. Transparent secret injection without application changes or sidecars. --- Kloak transparently intercepts outbound TLS traffic in Kubernetes using eBPF uprobes, replacing placeholders with real secrets in-kernel by patching the encrypted TLS record on its way out of the pod. Applications never handle actual credentials, and no sidecars or code changes are required. Features - No code changes -- No SDK, no library, no application modifications. Mount a secret, make HTTPS requests, and Kloak handles the rest. - Secret isolation -- Applications only see random shadow values (kl::…, same length as the real value). The real value is never written into the pod's memory; it is XOR-patched into the AES-GCM ciphertext in-kernel. - Zero overhead -- eBPF uprobes operate in kernel space with negligible latency impact. No userspace proxy or sidecar in the data path. - Kubernetes native -- Works with standard Kubernetes Secrets. Enable with a single label. - Per-pod secret binding -- A pod can only use the secrets it references in its spec (Secret volume, secretKeyRef, envFrom). A placeholder sent by any other pod, even one that learned it, goes out unchanged. - Host and IP filtering -- Secrets annotated with getkloak.io/hosts are only sent to specific destination hostnames or IP addresses, preventing exfiltration to unauthorized servers. Each restricted hostname gets its own virtual IP, so kloak knows which host a connection is for even when hosts share addresses (a CDN, a shared ingress). - Port-based filtering -- Secrets annotated with getkloak.io/port are restricted to connections on a specific destination port. - Broad runtime support -- Hooks into OpenSSL, BoringSSL, and Go's native crypto/tls. Works with Python, Node.js, Bun, Go, Rust, Ruby, PHP, curl, and any OpenSSL-linked runtime. Quick Start Prerequisites - Kubernetes cluster (1.28+) with Linux kernel 5.17+ (6.6+ attaches the tc patch program via TCX; older kernels fall back to a clsact qdisc + cls_bpf filter, see controller.ebpf.tcAttachMode) - The virtual IP ranges kloak hands out (default 198.18.0.0/15 and 2001:2::/48, reserved for benchmarking and never routed) must not be used by the cluster or its nodes. The controller checks this at startup and refuses to start otherwise (controller.ebpf.virtualIPRange). - containerd 2.0+ or CRI-O 1.30+ is recommended: through their NRI hook, kloak sets up a pod's DNS rewrite before its containers start, and attaches each container's TLS uprobes before it starts, so even its first request gets the secret. On other runtimes the rewrite is set up as soon as the pod's sandbox runs and a container is attached once the pod's status reports it running, which leaves a short window at pod start (see controller.nri in the chart values). - Helm 3.12+ - kubectl configured with cluster access Install with Helm bash helm repo add kloak https://chart.getkloak.io helm repo u
Top issues
#228docs/UX: working pattern for `git clone` over HTTPS through Kloak4 comments · 2026-05-19#57feat: investigate rustls support for pure-Rust TLS apps3 comments · 2026-03-27#151Support creating "kloak"-ed secret into another namespace.2 comments · 2026-04-21#236feat: Secret substitution only work for one network interface1 comments · 2026-05-22#109Doc: Mermaid Diagram not rendering1 comments · 2026-04-14#99Headers-only rewrite mode for HTTP/2 (HPACK)1 comments · 2026-04-12#98Headers-only rewrite mode for HTTP/1.11 comments · 2026-04-12#383feat: support secrets longer than 128 bytes (build blocker, verifier cost, unchecked shadow read)0 comments · 2026-11-09
Discussions
#369v0.3.00 comments · 2026-11-02#356v0.3.0-alpha0 comments · 2026-10-26#326Integration with external secret storage systems1 comments · 2026-10-18#322v0.2.00 comments · 2026-10-09#260👋 Welcome to the Kloak community!0 comments · 2026-06-27
Latest release
v0.3.0 v0.3.0 2026-11-02What's Changed chore(bun): track offsets for bun-v1.4.3 by @dhiaayachi in https://github.com/spinningfactory/kloak/pull/323 chore(deps): bump golang.org/x/sys from 0.48.0 to 0.49.0 by @dependabot[bot] in https://github.com/spinningfactory/kloak/pull/324 chore(deps): bump golang.org/x/net from 0.59.0 to 0.61.0 by @dependabot[bot] in https://github.com/spinningfactory/kloak/pull/325 feat(ebpf): only rewrite host-scoped secrets on connections whose SNI is the host by @dhiaayachi in https://github.com/spinningfactory/kloak/pull/329 ci(coverage): fix unit + e2e merge that under-reported c