Segmentación de Red — NetworkPolicy
Default Deny All
namespace: ingestion
PSS: baseline
kafka-consumer
api-gateway
validator
→
:8080
✓ TCP
✓ TCP
✕
directo
bloqueado
bloqueado
namespace: processing
PSS: restricted
ml-pipeline
aggregator
exporter
→
:3000
✓ TCP
✓ TCP
namespace: frontend
PSS: baseline
dashboard-ui
auth-service
bff-api
network-policy/default-deny-all.yaml
NetworkPolicy
apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: default-deny-all namespace: ingestion # aplicado en los 3 ns spec: podSelector: {} # todos los pods policyTypes: - Ingress - Egress
network-policy/allow-ingestion-to-processing.yaml
NetworkPolicy
spec: podSelector: matchLabels: app: aggregator ingress: - from: - namespaceSelector: matchLabels: name: ingestion podSelector: matchLabels: app: validator ports: - protocol: TCP port: 8080
RBAC — Mínimo Privilegio por Equipo
3 Roles definidos
| Equipo / SA | Scope | Recursos | Verbos permitidos |
|---|---|---|---|
| backend-dev | ingestion, processing | pods, deployments, services | ✓ get, list, watch |
| backend-dev | ingestion, processing | deployments | ✓ update, patch |
| frontend-dev | frontend | pods, services, configmaps | ✓ get, list |
| frontend-dev | ❌ ingestion, processing | todos | ✗ sin acceso |
| sre-ops | cluster-wide | nodes, namespaces, events | ✓ get, list, watch |
| sre-ops | cluster-wide | networkpolicies, rbac | ✓ CRUD |
| sa/ml-pipeline | processing | secrets | ✓ get (solo propios) |
rbac/backend-team-rolebinding.yaml
RBAC
apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: backend-dev-binding namespace: processing subjects: - kind: Group name: dataflow:backend # Google OIDC group apiGroup: rbac.authorization.k8s.io roleRef: kind: Role name: backend-developer apiGroup: rbac.authorization.k8s.io