215 lines
5.9 KiB
YAML
215 lines
5.9 KiB
YAML
|
|
---
|
||
|
|
apiVersion: cilium.io/v2
|
||
|
|
kind: CiliumNetworkPolicy
|
||
|
|
metadata:
|
||
|
|
name: vault-server
|
||
|
|
namespace: vault
|
||
|
|
spec:
|
||
|
|
endpointSelector:
|
||
|
|
matchLabels:
|
||
|
|
app.kubernetes.io/name: vault
|
||
|
|
component: server
|
||
|
|
ingress:
|
||
|
|
# Raft peer-to-peer (intra-namespace only)
|
||
|
|
- fromEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: vault
|
||
|
|
app.kubernetes.io/name: vault
|
||
|
|
component: server
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8200"
|
||
|
|
protocol: TCP
|
||
|
|
- port: "8201"
|
||
|
|
protocol: TCP
|
||
|
|
# port-forward from host (bootstrap: init, unseal, Terraform)
|
||
|
|
- fromEntities:
|
||
|
|
- host
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8200"
|
||
|
|
protocol: TCP
|
||
|
|
# cert-manager: Vault PKI signing via pki_int
|
||
|
|
- fromEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: cert-manager
|
||
|
|
app.kubernetes.io/name: cert-manager
|
||
|
|
app.kubernetes.io/component: controller
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8200"
|
||
|
|
protocol: TCP
|
||
|
|
# VSO controller: reads secrets from Vault API
|
||
|
|
- fromEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: vault
|
||
|
|
app.kubernetes.io/name: vault-secrets-operator
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8200"
|
||
|
|
protocol: TCP
|
||
|
|
- fromEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: argo-opnsense-certificate
|
||
|
|
app.kubernetes.io/name: opnsense-certificate-rotator
|
||
|
|
app.kubernetes.io/instance: opnsense-certificate-rotator
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8200"
|
||
|
|
protocol: TCP
|
||
|
|
- fromEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: stalwart
|
||
|
|
app.kubernetes.io/name: stalwart-controller
|
||
|
|
app.kubernetes.io/instance: stalwart
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8200"
|
||
|
|
protocol: TCP
|
||
|
|
- fromCIDR:
|
||
|
|
- 10.115.187.218/24
|
||
|
|
- 10.63.81.107/24
|
||
|
|
- 10.162.8.60/24
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8200"
|
||
|
|
protocol: TCP
|
||
|
|
egress:
|
||
|
|
# Raft peer-to-peer
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: vault
|
||
|
|
app.kubernetes.io/name: vault
|
||
|
|
component: server
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8200"
|
||
|
|
protocol: TCP
|
||
|
|
- port: "8201"
|
||
|
|
protocol: TCP
|
||
|
|
# Database engine: rotates PostgreSQL static role credentials
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: postgres
|
||
|
|
cnpg.io/cluster: main
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "5432"
|
||
|
|
protocol: TCP
|
||
|
|
# Kubernetes service registration + TokenReview (k8s auth method)
|
||
|
|
- toEntities:
|
||
|
|
- kube-apiserver
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "6443"
|
||
|
|
protocol: TCP
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: kube-system
|
||
|
|
k8s-app: kube-dns
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "53"
|
||
|
|
protocol: UDP
|
||
|
|
- port: "53"
|
||
|
|
protocol: TCP
|
||
|
|
---
|
||
|
|
# vault-secrets-operator: TLS API on 8200, health probes on 8081 from kubelet.
|
||
|
|
apiVersion: cilium.io/v2
|
||
|
|
kind: CiliumNetworkPolicy
|
||
|
|
metadata:
|
||
|
|
name: vault-secrets-operator
|
||
|
|
namespace: vault
|
||
|
|
spec:
|
||
|
|
endpointSelector:
|
||
|
|
matchLabels:
|
||
|
|
app.kubernetes.io/name: vault-secrets-operator
|
||
|
|
control-plane: controller-manager
|
||
|
|
ingress:
|
||
|
|
# Kubelet health/readiness probes + kube-apiserver webhook calls
|
||
|
|
- fromEntities:
|
||
|
|
- host
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8081"
|
||
|
|
protocol: TCP
|
||
|
|
- port: "9443"
|
||
|
|
protocol: TCP
|
||
|
|
egress:
|
||
|
|
# Vault API
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: vault
|
||
|
|
app.kubernetes.io/name: vault
|
||
|
|
component: server
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8200"
|
||
|
|
protocol: TCP
|
||
|
|
# Kubernetes API (watch/patch secrets, TokenReview)
|
||
|
|
- toEntities:
|
||
|
|
- kube-apiserver
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "6443"
|
||
|
|
protocol: TCP
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: kube-system
|
||
|
|
k8s-app: kube-dns
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "53"
|
||
|
|
protocol: UDP
|
||
|
|
- port: "53"
|
||
|
|
protocol: TCP
|
||
|
|
---
|
||
|
|
# Host egress to vault pods (kubectl port-forward during bootstrap) and VSO health probes.
|
||
|
|
apiVersion: cilium.io/v2
|
||
|
|
kind: CiliumClusterwideNetworkPolicy
|
||
|
|
metadata:
|
||
|
|
name: host-egress-vault
|
||
|
|
spec:
|
||
|
|
nodeSelector: {}
|
||
|
|
egress:
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: vault
|
||
|
|
app.kubernetes.io/name: vault
|
||
|
|
component: server
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8200"
|
||
|
|
protocol: TCP
|
||
|
|
# Kubelet → VSO health probes; kube-apiserver → VSO webhook
|
||
|
|
- toEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: vault
|
||
|
|
app.kubernetes.io/name: vault-secrets-operator
|
||
|
|
control-plane: controller-manager
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "8081"
|
||
|
|
protocol: TCP
|
||
|
|
- port: "9443"
|
||
|
|
protocol: TCP
|
||
|
|
---
|
||
|
|
# Same-node Gateway/LB and host bootstrap paths can return to node-local
|
||
|
|
# ephemeral source ports via the host path.
|
||
|
|
apiVersion: cilium.io/v2
|
||
|
|
kind: CiliumClusterwideNetworkPolicy
|
||
|
|
metadata:
|
||
|
|
name: host-ingress-vault-replies
|
||
|
|
spec:
|
||
|
|
nodeSelector: {}
|
||
|
|
ingress:
|
||
|
|
- fromEndpoints:
|
||
|
|
- matchLabels:
|
||
|
|
k8s:io.kubernetes.pod.namespace: vault
|
||
|
|
app.kubernetes.io/name: vault
|
||
|
|
component: server
|
||
|
|
toPorts:
|
||
|
|
- ports:
|
||
|
|
- port: "32768"
|
||
|
|
endPort: 60999
|
||
|
|
protocol: TCP
|