- Fix PostgreSQL topologySpreadConstraints label selector (cnpg.io/cluster) - Fix Ingress HTTPRoutes: route API and WS traffic to correct backends - Fix API NetworkPolicy port mismatch (4000 -> 8000) - Fix MinIO bucket index syntax (_0 -> 0) in ConfigMap - Add postgresql.port and postgresql.database to values.yaml - Add container-level securityContext to API deployment - Restrict monitoring NetworkPolicy ingress to monitoring namespace - Enable readOnlyRootFilesystem for MinIO container - Add activeDeadlineSeconds (3600s) to all 4 CronJobs
63 lines
1.7 KiB
YAML
63 lines
1.7 KiB
YAML
{{- if .Values.networkPolicies.enabled }}
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: monitoring-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: monitoring
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|
|
ingress:
|
|
# Allow Grafana web access from monitoring namespace
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: monitoring
|
|
ports:
|
|
- protocol: TCP
|
|
port: {{ .Values.monitoring.grafana.port }}
|
|
- protocol: TCP
|
|
port: {{ .Values.monitoring.prometheus.port }}
|
|
- protocol: TCP
|
|
port: {{ .Values.monitoring.alertmanager.port }}
|
|
egress:
|
|
# Allow DNS
|
|
- to:
|
|
- namespaceSelector: {}
|
|
podSelector:
|
|
matchLabels:
|
|
k8s-app: kube-dns
|
|
ports:
|
|
- protocol: UDP
|
|
port: 53
|
|
- protocol: TCP
|
|
port: 53
|
|
# Allow scraping all OSINT pods
|
|
- to:
|
|
- podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: osint-dashboard
|
|
ports:
|
|
- protocol: TCP
|
|
port: 9090
|
|
- protocol: TCP
|
|
port: 9093
|
|
- protocol: TCP
|
|
port: 3000
|
|
- protocol: TCP
|
|
port: 9187 # postgres-exporter
|
|
- protocol: TCP
|
|
port: 9121 # redis-exporter
|
|
- protocol: TCP
|
|
port: 8222 # nats-monitor
|
|
- protocol: TCP
|
|
port: 9000 # minio
|
|
{{- end }}
|