homelab-gitops/platform/default-network-policies/kube-system-restrict-external-egress.yaml
gwg313 bfe8435665
update default deny
Signed-off-by: gwg313 <gwg313@pm.me>
2026-05-17 00:05:02 -04:00

30 lines
590 B
YAML

apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: kube-system-restrict-external-egress
namespace: kube-system
spec:
endpointSelector: {}
egress:
# Allow Kubernetes API
- toEntities:
- kube-apiserver
# Allow internal cluster communication
- toEntities:
- cluster
- host
- remote-node
# Allow DNS
- toEndpoints:
- matchLabels:
k8s:k8s-app: kube-dns
toPorts:
- ports:
- port: "53"
protocol: UDP
- port: "53"
protocol: TCP