Skip to content

Limits ​

This page lists all hard limits in Kloak. Most are imposed by eBPF program constraints (verifier complexity, map sizes, stack/memory budgets) and cannot be changed without recompiling the eBPF programs. Secret value limits are also enforced at admission time by the validating webhook.

The controller runs as a DaemonSet -- one pod per node -- so all BPF map limits are per node. Per-call limits apply to individual TLS writes (SSL_write or Go crypto/tls.(*Conn).Write) or DNS packets.

Secret Limits ​

LimitValueScopeConstantDescription
Min secret value length8 bytesPer secret valueSECRET_KEY_LEN / minDataLenShorter values are rejected by the validating webhook. Without the webhook, no shadow is created for the whole Secret, so pods referencing it are denied.
Max secret value length128 bytesPer secret valueSECRET_MAX_LEN / maxDataLenLonger values are rejected by the validating webhook. If the webhook is not installed they are truncated, producing an incorrect rewrite.
HPACK Huffman feasibility--Per secret valueCanShadowThe value's HPACK Huffman bit density must be achievable by a same-length kl:: placeholder. Values that can't be matched are rejected ("use a different value or a longer secret").
Max secrets per TLS write4Per TLS writeXOR_MAX_MATCHESMaximum number of kl:: placeholders rewritten in a single TLS write. Additional placeholders are sent unmodified.
Max secret map entries4096Per nodesecret_map max entriesEach secret value uses two entries (plaintext plus its HTTP/2 HPACK Huffman form), so about 2048 secret values per node.
Placeholder key length8 bytesPer secretSECRET_KEY_LENBPF map lookup key size (kl:: + 4 characters). The first 8 bytes of each placeholder must be unique; the controller regenerates on collision.

Protocol Limits ​

LimitValueScopeDescription
Cipher suitesAES-128-GCM, AES-256-GCMPer connectionOnly AES-GCM suites (TLS 1.2 and 1.3) are rewritten. Connections using ChaCha20-Poly1305 or other suites send the placeholder.
Destination address familyIPv4 onlyPer connectionOnly IPv4 destinations are rewritten.

Host Filtering Limits ​

LimitValueScopeConstantDescription
Max hostname length63 charactersPer hostnamemaxHostLen (MAX_HOST_LEN = 64)Longer hostnames are rejected by the validating webhook. Without the webhook, the secret is skipped and never rewritten.
Hosts per secret1Per secretallowed_host fieldgetkloak.io/hosts takes a single hostname, IP, or *. A comma-separated value is rejected by the validating webhook (#102).
Max watched hostnames1024Per 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 containers4096Per 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 TLS write4Per TLS writeXOR_MAX_PATCHESCiphertext patches carried from the uprobe to the tc program for one TLS write.

Observability Limits ​

LimitValueScopeConstantDescription
TLS events ring buffer256 KBPer nodetls_events max entriesReserved for rewrite events; currently unused (no eBPF program writes to it).
Process events ring buffer64 KBPer nodeproc_events max entriesRing buffer for exec/exit events.

Released under the GNU AGPL-3.0 License.