# NetworkPolicy for approval-service. # # Cluster-wide NetworkPolicy enforcement is already active on BasicStack # (see cluster memory on NetworkPolicy activation). Any pod in agent-trust # without a policy is isolated by default; this file is the explicit # allow-list for approval-service. # # Ingress: only from the Pangolin ingress edge (public traffic terminates # at Pangolin/Traefik; nothing in-cluster calls approval-service # directly in Phase 1). # Egress: signing-service (:8081) + transparency-log (:8080) in # agent-trust, Pocket-ID (:1411) for OIDC discovery/JWKS, DNS, and (once # trust-pg lands) a Postgres :5432 egress to trust-pg in agent-trust. apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: approval-service namespace: agent-trust labels: app.kubernetes.io/name: approval-service app.kubernetes.io/part-of: proofedmesh spec: podSelector: matchLabels: app.kubernetes.io/name: approval-service policyTypes: - Ingress - Egress ingress: # Public traffic reaches approval-service only via the Pangolin edge # (Traefik lives inside the Pangolin namespace). Keep this list # conservative — add additional callers on demand, not speculatively. - from: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: pangolin ports: - port: 8080 protocol: TCP egress: # signing-service (ADR-0005 signer) + transparency-log (Trillian frontend) # live in the same agent-trust namespace; future trust-pg will too. - to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: agent-trust podSelector: matchLabels: app.kubernetes.io/name: signing-service ports: - port: 8081 protocol: TCP - to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: agent-trust podSelector: matchLabels: app.kubernetes.io/name: transparency-log ports: - port: 8080 protocol: TCP # Future trust-pg Postgres egress — pre-authorised here so the pod # does not need a NetworkPolicy edit when DEV-607's prod store lands. - to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: agent-trust podSelector: matchLabels: app.kubernetes.io/name: trust-pg ports: - port: 5432 protocol: TCP # Pocket-ID for OIDC discovery + token endpoint. - to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: pocket-id podSelector: matchLabels: app: pocket-id ports: - port: 1411 protocol: TCP # DNS egress to kube-system CoreDNS. - to: - namespaceSelector: matchLabels: kubernetes.io/metadata.name: kube-system podSelector: matchLabels: k8s-app: kube-dns ports: - port: 53 protocol: UDP - port: 53 protocol: TCP