Skip to content

Limits

This page lists all hard limits in Kloak. These limits are imposed by eBPF program constraints (verifier complexity, map sizes, stack/memory budgets) and cannot be changed without recompiling the eBPF programs.

The controller runs as a DaemonSet -- one pod per node -- so all BPF map limits are per node. Per-call limits apply to individual SSL_write invocations or DNS packets.

Secret Limits

LimitValueScopeConstantDescription
Max secret value length128 bytesPer secretSECRET_MAX_LENMaximum length of a secret value that can be rewritten. Longer values are truncated. Covers most API keys, tokens, and passwords.
Max secrets per TLS write4Per SSL_write callXOR_MAX_MATCHESMaximum number of kloak: placeholders detected and rewritten in a single SSL_write call.
Max secrets tracked1024Per nodesecret_map max entriesTotal number of distinct secret entries (shadow prefix → real value) across all pods on a node.
Placeholder prefix length8 bytesPer secretSECRET_KEY_LENBPF map lookup key size (kloak:XX). First 8 bytes of each placeholder must be unique.
Full prefix verification42 bytesPer secretSECRET_PREFIX_MAXMaximum prefix bytes verified after the initial 8-byte key match.

Host Filtering Limits

LimitValueScopeConstantDescription
Max hostname length64 charactersPer hostnameMAX_HOST_LENHostnames longer than 64 characters are truncated in BPF maps.
Hosts per secret1Per secretallowed_host fieldOnly the first hostname in a comma-separated getkloak.io/hosts list is enforced (#102).
Max watched hostnames256Per nodewatched_hosts max entriesTotal unique hostnames from all secrets that DNS responses are captured for.
Max DNS cache entries8192Per nodedns_ip_map max entriesLRU cache of DNS-verified IP → hostname mappings. Oldest entries evicted when full.
Max DNS answers parsed8Per DNS responseMAX_DNS_ANSWERSA/AAAA records parsed per DNS response packet.
Max DNS packet size512 bytesPer DNS responseMAX_DNS_PKTMaximum DNS response payload parsed by the kprobe. Standard DNS limit.
Max trusted DNS servers32Per nodetrusted_dns_servers max entriesNumber of DNS server IPs in the trusted whitelist.

Connection Tracking Limits

LimitValueScopeConstantDescription
Max tracked connections16384Per nodeconn_ip_map max entriesLRU cache of TCP connections (fd → destination IP).
Max SSL fd cache entries4096Per nodessl_fd_map max entriesLRU cache mapping SSL pointers to file descriptors.
Max verified fd entries16384Per nodelast_verified_fd max entriesCache of last DNS-verified fd per process.

Process and Container Limits

LimitValueScopeConstantDescription
Max tracked processes16384Per nodetracked_tgids max entriesProcesses opted in for DNS/connect tracking.
Max tracked containers256Per nodetracked_cgroups max entriesContainers with eBPF enabled.

TLS Connection Limits

LimitValueScopeConstantDescription
Max TLS connection state entries4096Per nodetls_conn_state max entriesPer-connection GHASH H key cache. LRU eviction when full.
Max pending XOR patches4096Per nodexor_pending max entriesPending ciphertext patches between uprobe and kprobe.
Max patches per packet4Per packetXOR_MAX_PATCHESCiphertext patches applied per outbound packet in TC egress.

Observability Limits

LimitValueScopeConstantDescription
TLS events ring buffer256 KBPer nodetls_events max entriesRing buffer for rewrite events sent to userspace.
Process events ring buffer64 KBPer nodeproc_events max entriesRing buffer for exec/exit events.

Released under the GNU AGPL-3.0 License.