fix: add network policies and scope Vault permissions per service#425
fix: add network policies and scope Vault permissions per service#425
Conversation
|
looks fine but i need to test before merging |
|
these break game node server |
|
this MR needs more work~ |
Network policies: - Default-deny ingress for 5stack namespace - Allow ingress controller to reach web, api, hasura, minio, typesense - TimescaleDB: only reachable from hasura and api - Redis: only reachable from api and connector - Hasura: only from api, web, and ingress - API: only from ingress and connector - Connector: only from api Vault: - Replace wildcard path "*" with explicit per-service read-only paths matching the kv/data/* paths used by migrate_secrets_to_vault - External-secrets can only read specific service secrets, not create/update/delete or access arbitrary vault paths Closes #413
Game server pods (labeled app: game-server) need WebSocket access to the API for match event communication. Without this, match events would be blocked by the default-deny policy.
Per code review — 4 critical/important missing policies: - Hasura → API: needed for auth/event/action webhooks - Backup CronJob → TimescaleDB + MinIO: needed for pg_dump + S3 upload - API → MinIO: needed for S3 operations (demos, assets) - API → Typesense: needed for player search indexing Also adds app: postgres-backup label to backup CronJob pod template so it can be selected by network policies.
Drop default-deny-ingress and allow-ingress policies. Without a default-deny in place, only pods explicitly selected by allow-internal become restricted — game-server pods (and any other unselected pod) remain wide-open, so CS2 client traffic and connector/RCON paths are not affected. Per-service ingress restrictions (TimescaleDB, Redis, Hasura, API, MinIO, Typesense, connector) still apply.
9b0fa10 to
aeef066
Compare
|
@lukepolo scoped this down in aeef066 — dropped What's left:
What this means for game traffic: without If full mesh policies (covering game-server, web, etc.) are something you want later, happy to file a separate issue once we've sorted out what game-server pod ingress actually needs to look like. |
Summary
Network Policies — Implements network segmentation for the 5stack namespace:
default-deny-ingressallow-ingress-to-servicesallow-timescaledb-ingressallow-redis-ingressallow-hasura-ingressallow-api-ingressallow-connector-ingressVault Policy — Replaced wildcard
path "*"with explicit per-service read-only paths:kv/data/api,kv/data/redis, etc.) getsread, listonlycreate, update, deletecapabilities from external-secrets rolemigrate_secrets_to_vaultin setup-env.shTest plan
kubectl kustomize basebuilds successfully (7 NetworkPolicies generated)Closes #413