← Developers
Level 0: resolver Environment

Kubernetes

A namespace maps directly to a policy. Assign the namespace its own Securd site (or virtual site) bound to its own policy, since the first-seen baseline is maintained per policy, set the pod resolver, and restrict DNS egress with a NetworkPolicy.

Configuration and reference code for Kubernetes

Pod resolver

dnsPolicy None causes the pod to bypass the cluster resolver and query the assigned Securd resolvers directly. The resolver addresses are shown on the site in the console.

pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: research-agent
  namespace: agents-research
spec:
  dnsPolicy: "None"
  dnsConfig:
    nameservers:
      - <primary resolver IP from your Securd site>
      - <secondary resolver IP from your Securd site>
    options:
      - name: ndots
        value: "1"
  containers:
    - name: agent
      image: ghcr.io/example/research-agent:1.4
      env:
        - name: SECURD_BLOCK_ADDRS
          value: "<block page address from the console>"

Pin DNS egress

This rule restricts DNS to the assigned resolvers. A pod attempting to reach another resolver on port 53 is denied. A pod attempting DNS-over-HTTPS on port 443 is permitted by this rule, which is why the DoH provider category should be blocked in the policy.

networkpolicy.yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: dns-only-to-securd
  namespace: agents-research
spec:
  podSelector: {}
  policyTypes: ["Egress"]
  egress:
    - to:
        - ipBlock: { cidr: <primary resolver IP>/32 }
        - ipBlock: { cidr: <secondary resolver IP>/32 }
      ports:
        - { protocol: UDP, port: 53 }
        - { protocol: TCP, port: 53 }
    - to:
        - ipBlock: { cidr: 0.0.0.0/0 }
      ports:
        - { protocol: TCP, port: 443 }

Cluster-wide alternative: CoreDNS forward

If every workload in the cluster is to share one policy, forward CoreDNS instead of configuring individual pods. This removes per-namespace scoping in exchange for a single configuration change.

Corefile
.:53 {
    errors
    health
    kubernetes cluster.local in-addr.arpa ip6.arpa {
        pods insecure
        fallthrough in-addr.arpa ip6.arpa
    }
    forward . <primary resolver IP> <secondary resolver IP>
    cache 30
    loop
    reload
}

Scope of this configuration

This configuration restricts DNS, not HTTPS. A workload that already holds an IP address can connect to it on port 443. The egress firewall remains in place and can consume Securd events. The Greywall applies to every destination the workload resolves by name.

Evaluate Agent DNS with your own agent traffic

Deploy on a single policy in learning mode and review the recorded destinations with your team.