# Reference only. This policy is effective only when the cluster CNI enforces
# NetworkPolicy. Standard NetworkPolicy filters IPs and ports, not provider
# hostnames or TLS identities. Put an audited egress proxy at the selected
# endpoint, restrict that proxy to approved provider destinations, then prove
# direct provider access fails before setting direct_provider_egress=BLOCKED.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: mandateshield-gate-egress
  namespace: payments
spec:
  podSelector:
    matchLabels:
      app.kubernetes.io/name: mandateshield-gate
  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
    - to:
        - namespaceSelector:
            matchLabels:
              kubernetes.io/metadata.name: security
          podSelector:
            matchLabels:
              app.kubernetes.io/name: approved-payment-egress-proxy
      ports:
        - protocol: TCP
          port: 8443
