The Simplest Way to Make Cilium and LDAP Work Like They Should
Running cilium and ldap together links Kubernetes pod network rules with central user directories. This setup lets cluster apps check user groups while network rules guard the traffic path. Teams use this pair to keep old directory servers safe from broad cluster traffic. Only the right pods can reach the directory to check user logins and roles. How traffic and logins flow between cilium and ldap Cilium runs inside the Linux kernel using eBPF to watch and filter pod traffic. It drops or all
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Running cilium and ldap together links Kubernetes pod network rules with central user directories. This setup lets cluster apps check user groups while network rules guard the traffic path.
Teams use this pair to keep old directory servers safe from broad cluster traffic. Only the right pods can reach the directory to check user logins and roles.
How traffic and logins flow between cilium and ldap
Cilium runs inside the Linux kernel using eBPF to watch and filter pod traffic. It drops or allows packets based on pod labels rather than changing IP addresses.
LDAP stores user accounts, passwords, and group memberships in a central tree structure. Internal apps query this directory to check who a person is during login.
When an app inside the cluster needs to check a user, it sends a query. Cilium checks the pod identity before the packet ever leaves the Kubernetes node.
If the pod label matches the network rule, the packet flows to the directory server. The directory server checks the bind account, runs the search, and sends back group data.
Admins also sync directory groups with Kubernetes role bindings for cluster access. A central identity provider reads the directory and issues tokens for cluster users.
Once the user has a token, Kubernetes checks their group roles for pod actions. Cilium then enforces network rules for any pods that user starts or runs.
Common failure modes and how to scope network paths
Many teams open access to the directory server from every node in the cluster. This mistake lets any compromised pod reach the directory and test stolen passwords.
Another common risk comes from shared bind accounts with read access to all user attributes. If one app leaks its bind password, attackers can read the whole company directory.
Unlogged directory queries also create blind spots during a security review. Network logs might show a packet, but they miss which user account ran the search.
LDAP Directory Services + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
To fix network reach, write egress rules that match only specific auth pods. Block all other namespaces and pods from sending packets to the directory ports.
Use DNS rules in Cilium to point pods to the exact directory host names. This stops pods from talking to rogue servers or scanning the internal network.
Next, create a separate bind account in the directory for each app in the cluster. Give each bind account read access only to the group branches it truly needs.
Turn on TLS for all directory traffic so passwords never cross the wire in plain text. Cilium can track the encrypted flows while the directory logs each bind and search.
Keeping directory checks fast and reliable at scale
Directory servers often slow down when hundreds of pods open new network sockets at once. Each pod login check can trigger a fresh handshake and a full tree search.
When pods scale up fast, this burst of traffic can lock up the directory server. Other apps outside the cluster then fail to log users in on time.
To prevent this bottleneck, route pod queries through a single auth service inside the cluster. Only that single service gets a network rule allowing egress to the directory.
Keep connection pools small and set short timeouts on all directory search calls. Check Cilium flow logs often to spot dropped packets before users report login errors.
Review directory bind logs every week to find old service accounts that still run queries. Delete unused accounts and tighten network rules whenever you retire an internal app.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can Cilium read LDAP group names inside encrypted traffic?
No, Cilium cannot read inside encrypted LDAPS traffic by default. It filters traffic using pod identities, IP addresses, ports, and DNS names instead.
How do I stop pods from brute-forcing the directory server?
Write a strict Cilium egress rule that only allows traffic from your main auth pods. Block all other workloads from reaching the directory server IP and ports.
Should every microservice have its own LDAP bind account?
Only apps that must query the directory directly should have their own bind account. Most apps should trust a central login service instead of talking to the directory.
Related guides
In this post