iac/infrastructure/security-audit/base/networkpolicy-access-collector.yaml

34 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Дополняет общую audit-collector (DNS, Kafka, Vault, 13133): политики складываются.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: access-collector
spec:
podSelector:
matchLabels:
security-audit/collector: access
policyTypes: [Ingress, Egress]
ingress:
# OTLP gRPC только от ingress-шлюза. Селектор шлюза — заглушка, контур задаёт его патчем оверлея;
# без патча не совпадёт ни с одним подом (закрыто по умолчанию).
- from:
- namespaceSelector:
matchLabels: {kubernetes.io/metadata.name: istio-system}
podSelector:
matchLabels: {security-audit/gateway: unset}
ports:
- {port: 4317, protocol: TCP}
# istio-proxy: 15020 — переписанные probe'ы приложения (kubelet), 15021 — readiness самого sidecar.
- ports:
- {port: 15020, protocol: TCP}
- {port: 15021, protocol: TCP}
egress:
# xDS и сертификаты istio-proxy от istiod.
- to:
- namespaceSelector:
matchLabels: {kubernetes.io/metadata.name: istio-system}
podSelector:
matchLabels: {app: istiod}
ports:
- {port: 15012, protocol: TCP}