Network policy
How the chart restricts the traffic between the platform pods. All traffic is denied by default, and pod labels allow each flow.
The chart restricts the traffic between the platform pods with Cilium policies. All traffic is denied by default. A pod label allows each flow. A new workload gets labels, not a new policy. No policy lists each internal peer.
Cilium must run on the cluster. The chart renders CiliumNetworkPolicy and
CiliumClusterwideNetworkPolicy objects, and Cilium enforces them. The chart
renders no Kubernetes NetworkPolicy.
The default: deny all, allow DNS
One CiliumClusterwideNetworkPolicy selects each pod in the release
namespace. It denies all ingress and all egress for these pods. It allows one
flow: DNS to kube-dns in kube-system, on port 53 over UDP and TCP.
A pod that has no label from this page can only resolve names. It cannot reach another pod, a data store, the API server or the internet.
Cilium allows a flow only when the egress side and the ingress side both allow it. Thus a pod with no client label cannot reach a data store, even when it has the internet label.
Each policy has the Argo CD sync wave -20. Argo CD applies the policies
before each hook Job of the release.
The labels
All labels use the gibson.zeroroot.ai/ prefix.
The role label
Each platform pod has the label gibson.zeroroot.ai/net-role. The label has
one of three values:
| Value | What it allows |
|---|---|
platform | The pod reaches each other pod with the role platform, on each port. These pods reach it too. |
datastore | The pod is a data store. Only the pods with its client label reach it. It also needs the gibson.zeroroot.ai/datastore label. |
system | A cluster operator or a plugin. The pod is in no shared group. It gets only what its other labels allow. |
Each pod with a role label, of any value, gets two more flows:
- It reaches the edge listener on TCP port 10000.
- The cluster scrapers reach its metrics ports. A scraper is a pod with the
label
app.kubernetes.io/name: prometheusorapp: grafana-agent, in any namespace.
The data store labels
Four data stores have an allow list. A data store pod has the label
gibson.zeroroot.ai/datastore with the name of the store. A client pod has
the client label of the store, with the value "true".
| Data store | Client label | Ports (TCP) |
|---|---|---|
| Postgres | gibson.zeroroot.ai/client-postgres | 5432, 8000 |
| Redis | gibson.zeroroot.ai/client-redis | 6379 |
| OpenBao | gibson.zeroroot.ai/client-openbao | 8200 |
| Neo4j | gibson.zeroroot.ai/client-neo4j | 7687, 7474 |
A client label allows egress from the client to these ports only. The data store accepts ingress on these ports only from pods with the client label.
The policies have three more rules for the data stores:
- The OpenBao replicas reach each other on TCP port 8201.
- OpenBao reaches the SPIRE OIDC provider on TCP ports 8443 and 443. OpenBao reads the public keys of the provider when it writes its JWT auth configuration.
- On a cluster where the CloudNativePG operator and External Secrets run in their own namespaces, these operators reach Postgres on port 8000 and OpenBao on port 8200.
The other labels
Each of these labels has the value "true".
| Label | What it allows |
|---|---|
gibson.zeroroot.ai/kube-api | Egress to the Kubernetes API server. |
gibson.zeroroot.ai/egress-internet | Egress to each host outside the cluster (the Cilium world entity), on each port. |
gibson.zeroroot.ai/egress-fqdn | Egress to the host names of one group only (Cilium toFQDNs), on each port. The value is the name of the group. |
gibson.zeroroot.ai/egress-namespaces | Egress to pods in other namespaces, for example setec and the tenant plugins. The policies of those namespaces still apply. |
gibson.zeroroot.ai/ingress-edge | Ingress from each source on the edge listener, TCP port 10000. |
gibson.zeroroot.ai/ingress-control-plane | Ingress from the API server, the nodes and the platform pods on TCP ports 8081, 9443 and 10250. Admission webhooks and the SPIRE server use it. |
Cilium knows the addresses of the API server on each cluster. If your API
server answers from other addresses, add them to
global.networkPolicy.apiServerCIDRs. The kube-api policy then also allows
these CIDRs on TCP ports 443 and 6443.
Components that reach the internet
A component gets the egress-internet label only when its hosts are not
known when the chart renders. These components have the label:
| Component | External hosts | Why the host list is open |
|---|---|---|
| The daemon | The LLM and embedding provider APIs, the OAuth token endpoints of connector vendors, and the SMTP relay. | A tenant sets the base URL of each provider. |
| Each plugin | The API of its vendor, for example api.github.com or gitlab.com. | The hosts differ for each plugin and include self-hosted vendor instances. The plugin manifest lists them, and the SDK enforces that list in the plugin process. |
| Velero and the Velero node agent | The S3 bucket of the backups. | The Velero release names the bucket endpoint, and the umbrella chart cannot read it. |
A component with a known host list gets the egress-fqdn label. The chart
makes the list from your values. One CiliumNetworkPolicy allows the host
names of each group. If a group has no host, the chart renders no policy for
it, and the component reaches no host outside the cluster.
| Group | Components | External hosts |
|---|---|---|
zitadel | ZITADEL and its login UI | The SMTP relay in platformBootstrap.zitadel.smtp.host. External identity providers are off. |
tenant-operator | The tenant operator | The SMTP relay of the welcome mail. AWS KMS and STS when kms.keyARN is set. An external Vault, JWKS URL or tenant Postgres host. |
cert-manager | The cert-manager controller | The Let's Encrypt ACME directory. For http01, the public host names of the edge certificate. For dns01-route53, Route53, STS and the Route53 name servers. Nothing when the Let's Encrypt issuers are off. |
external-dns | external-dns | Route53 and STS for the aws provider. Nothing for inmemory. |
object-store | Postgres instances, CloudNativePG Jobs and the Redis backup CronJob | AWS S3 in any region and STS, or the host of platformPostgres.backup.endpointURL. |
A host in the cluster is never in a group. A toFQDNs rule names a host.
Thus a value that gives an IPv4 address gets a /32 CIDR rule instead.
These components have no egress label:
- The SPIRE server. It uses the disk key manager, no upstream authority and no federation.
- The connector operator. It calls only the API server and the daemon.
- The ZITADEL init, setup and cleanup Jobs.
- The cert-manager webhook and cainjector.
Add labels to your own workload
If you add a workload to the release namespace, the default deny selects it. Give it the labels for the flows it needs.
- Find the flows that the workload needs.
- Add
gibson.zeroroot.ai/net-roleto the pod template. - For each data store that the workload reads, add its client label.
- If the workload calls the Kubernetes API, add the
kube-apilabel. - If the workload reaches known hosts outside the cluster, add the
egress-fqdnlabel with the name of its group. - If the hosts are not known when the chart renders, add the
egress-internetlabel.
This example is a worker that reads Redis and calls the Kubernetes API:
spec:
template:
metadata:
labels:
gibson.zeroroot.ai/net-role: platform
gibson.zeroroot.ai/client-redis: "true"
gibson.zeroroot.ai/kube-api: "true"
Inside the chart, the gibson.netLabels helper writes these labels. It
fails the render for an unknown role, data store name or egress group.
Check the rules
Use these commands to read the policies and the labels. Replace gibson
with your release namespace.
# The default deny policy.
kubectl get ciliumclusterwidenetworkpolicies
# The label policies of the release.
kubectl -n gibson get ciliumnetworkpolicies
# The network labels of each pod.
kubectl -n gibson get pods \
-L gibson.zeroroot.ai/net-role \
-L gibson.zeroroot.ai/egress-internet \
-L gibson.zeroroot.ai/egress-fqdn \
-L gibson.zeroroot.ai/kube-api
# The policy that Cilium enforces on each endpoint.
kubectl -n kube-system exec ds/cilium -- cilium-dbg endpoint list
Use Hubble to read the flows. These commands need the Hubble relay and the
hubble CLI.
# Forward the Hubble relay port to your workstation.
cilium hubble port-forward &
# The flows that a policy denied in the release namespace.
hubble observe --namespace gibson --verdict DROPPED
# The flows of one pod.
hubble observe --pod gibson/<pod-name>
If a pod cannot reach a peer, look for a DROPPED flow from that pod. Then
compare the labels of the two pods with the tables on this page.
Mission traffic
The traffic of a mission is controlled separately, for each mission node.
Each node reaches only its targets. A node with research: true has open
egress. See the node fields in Missions.
Isolation
One gate decides how a component runs. It denies the component, puts it in a Firecracker microVM, or runs it in process. It reads the component's declared content trust and the deployment shape, and it fails closed.
Tenancy
Tenants do not share a graph database. The connection is the isolation, not a filter. There is no cross-tenant query to get wrong.