141 lines
2.8 KiB
YAML
141 lines
2.8 KiB
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: vault-server-default-deny
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: vault
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: vault-server-allow-dns-egress
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: vault
|
|
policyTypes:
|
|
- Egress
|
|
egress:
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: kube-system
|
|
podSelector:
|
|
matchLabels:
|
|
k8s-app: kube-dns
|
|
ports:
|
|
- protocol: UDP
|
|
port: 53
|
|
- protocol: TCP
|
|
port: 53
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: vault-server-allow-transit-egress
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: vault
|
|
policyTypes:
|
|
- Egress
|
|
egress:
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: vault-transit
|
|
podSelector:
|
|
matchLabels:
|
|
app: vault-transit
|
|
ports:
|
|
- protocol: TCP
|
|
port: 8200
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: vault-server-allow-postgres-egress
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: vault
|
|
policyTypes:
|
|
- Egress
|
|
egress:
|
|
- to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: platform
|
|
podSelector:
|
|
matchLabels:
|
|
app: postgres
|
|
ports:
|
|
- protocol: TCP
|
|
port: 5432
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: vault-server-allow-kubernetes-api-egress
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: vault
|
|
policyTypes:
|
|
- Egress
|
|
egress:
|
|
- to:
|
|
- ipBlock:
|
|
cidr: 10.43.0.1/32
|
|
ports:
|
|
- protocol: TCP
|
|
port: 443
|
|
- to:
|
|
- ipBlock:
|
|
cidr: 10.208.141.98/32
|
|
ports:
|
|
- protocol: TCP
|
|
port: 6443
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: vault-server-allow-ingress-from-workloads
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: vault
|
|
policyTypes:
|
|
- Ingress
|
|
ingress:
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: auth-dev
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: platform
|
|
ports:
|
|
- protocol: TCP
|
|
port: 8200
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: vault-agent-injector-webhook-ingress
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: vault-agent-injector
|
|
policyTypes:
|
|
- Ingress
|
|
ingress:
|
|
- ports:
|
|
- protocol: TCP
|
|
port: 8080
|