ProofedMesh/deploy/approval-service/40-networkpolicy.yaml
CTO (Paperclip) 20ba29d3ac
All checks were successful
build-images / signing-service image (push) Successful in 26s
build-images / verification-service image (push) Successful in 27s
build-images / approval-service image (push) Successful in 31s
build-images / dummy-sink image (push) Successful in 29s
validate / JSON Schema (ajv) (push) Successful in 23s
validate / Rego (opa fmt + opa test) (push) Successful in 16s
phase1-smoke / Phase 1 end-to-end smoke (push) Successful in 1m0s
validate / DB (migrate up/down dry-run) (push) Successful in 26s
validate / Go (vet + test) (push) Successful in 1m20s
approval-service: K8s deployment manifests + Pocket-ID OIDC client (DEV-614)
Phase-1 Subtask 8/10 (parent DEV-606):
- deploy/approval-service/: SA (no auto-mount), Deployment (replicas=2,
  distroless-nonroot, read-only rootfs), ClusterIP :8080, NetworkPolicy
  (ingress from pangolin namespace only; egress to signing-service,
  transparency-log, trust-pg in agent-trust + pocket-id + DNS), README.
- 10-secret-dev.example.yaml template + the real 10-secret-dev.sealed.yaml
  carrying the Pocket-ID client id/secret, WebAuthn RP config, and the
  dev signing-service bearer; unsealed in-cluster to Secret
  approval-service-dev.
- services/approval-service/Dockerfile: BuildKit multi-stage, context-at-
  repo-root, matches the signing/verification/dummy-sink pattern.
- .forgejo/workflows/build-images.yml: new approval-service job pushing
  harbor.basicstack.de/basicstack/approval-service:{sha,main} on main.
- Pocket-ID: created proofedmesh-admin group + OIDC client
  "ProofedMesh Approval" with PKCE enforced, callback
  https://approval.proofedmesh.basicstack.de/oidc/callback, group
  restriction to proofedmesh-admin. Client secret stored as Paperclip
  secret proposal and in the SealedSecret above — never pasted inline.

Deployment applied cluster-side pending the first CI image build:
`kubectl apply -f deploy/approval-service/` is green; pods ErrImagePull
until the Forgejo workflow completes and pushes the :main tag.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-25 21:12:01 +00:00

98 lines
3.1 KiB
YAML

# 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