gcloud-lab/apps/base/osint-dashboard/templates/security/nats-netpol.yaml
Sirius Devops 8255467313 feat: add OSINT Dashboard Kubernetes infrastructure
- Helm chart scaffold (Chart.yaml, values.yaml, _helpers.tpl)
- Namespace + RBAC manifests
- PostgreSQL (CNPG, 3 replicas, PostGIS + TimescaleDB)
- NATS JetStream (3 replicas, persistent, custom subjects)
- Redis Sentinel (1 primary + 2 replicas, HA)
- MinIO distributed (4 replicas, bucket init job)
- Gateway API HTTPRoute + cert-manager TLS certificates
- Monitoring stack (Prometheus, Grafana, Alertmanager, exporters)
- NetworkPolicies (default deny + per-component policies)
- GitHub Actions CI/CD pipeline (lint, template, security scan)
- Flux CD staging overlay
2026-05-21 13:25:15 +00:00

67 lines
1.8 KiB
YAML

{{- if .Values.networkPolicies.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: nats-netpol
namespace: {{ .Values.namespace }}
labels:
{{- include "osint-dashboard.labels" . | nindent 4 }}
app.kubernetes.io/component: security
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: osint-dashboard
app.kubernetes.io/component: messaging
policyTypes:
- Ingress
- Egress
ingress:
# Allow client connections from dashboard services
- from:
- podSelector:
matchLabels:
app.kubernetes.io/name: osint-dashboard
ports:
- protocol: TCP
port: {{ .Values.nats.ports.client }}
# Allow cluster communication
- from:
- podSelector:
matchLabels:
app.kubernetes.io/name: osint-dashboard
app.kubernetes.io/component: messaging
ports:
- protocol: TCP
port: {{ .Values.nats.ports.cluster }}
# Allow monitoring
- from:
- podSelector:
matchLabels:
app.kubernetes.io/component: monitoring
ports:
- protocol: TCP
port: {{ .Values.nats.ports.monitor }}
egress:
# Allow DNS
- to:
- namespaceSelector: {}
podSelector:
matchLabels:
k8s-app: kube-dns
ports:
- protocol: UDP
port: 53
- protocol: TCP
port: 53
# Allow cluster communication
- to:
- podSelector:
matchLabels:
app.kubernetes.io/name: osint-dashboard
app.kubernetes.io/component: messaging
ports:
- protocol: TCP
port: {{ .Values.nats.ports.cluster }}
- protocol: TCP
port: {{ .Values.nats.ports.client }}
{{- end }}