The 2026-11-25..12-04 outage was invisible: deploy/osint-news-summarizer stayed Running with restarts 0 and INFO batch lines while article_summaries froze for nine days, and the scraper kept articles fresh (61.5k rows, newest within minutes). The app has no /metrics endpoint, so add a small read-only Postgres exporter and two Prometheus rules. - osint-analyst-exporter (ns osint): stdlib HTTP server on :9187 serving osint_analyst_last_success_timestamp_seconds (max article_summaries. batch_timestamp), osint_ingest_last_article_timestamp_seconds (max articles.timestamp) and osint_analyst_exporter_up. Runs the pinned summarizer image (python3 + psycopg2), non-root, read-only rootfs, clusterIP Service + ServiceMonitor (release=kube-prometheus-stack). - NetworkPolicy: one port-scoped ingress rule, monitoring -> :9187. Nothing else in monitoring can reach osint. - monitoring/controllers/home/osint-analyst.yaml: OsintAnalystStale (>1h, 30m, warning, with an absent() arm so a dead exporter cannot read as healthy) and OsintIngestAliveButNoBrief (articles <2h old while summaries >2h old, 10m, warning). Both route through the default Telegram receiver.
87 lines
3.2 KiB
YAML
87 lines
3.2 KiB
YAML
# Tenant isolation for `osint` (audit finding F3 / A5-1, card t_fed52919).
|
|
#
|
|
# `default-deny` (stock NetworkPolicy, podSelector {}, both directions) makes
|
|
# every pod in this namespace reachable by nothing and able to reach nothing.
|
|
# `osint-allow` (CiliumNetworkPolicy) re-adds the traffic the workload actually
|
|
# uses, in both directions:
|
|
# ingress: the Cilium Gateway proxy (`reserved:ingress`) for
|
|
# osint.siriusdevops.com -> app:8000 / titiler:8000, plus node/health
|
|
# entities for kubelet probes.
|
|
# egress: cluster DNS, its own pods (app -> osint-db:5432, -> nats:4222,
|
|
# -> titiler:8000), and `world` — the ingester/news-scraper/
|
|
# news-summarizer fetch external news + Nominatim
|
|
# (nominatim.openstreetmap.org) + the Nous inference API, and
|
|
# camera-service reads RTSP cameras on the LAN.
|
|
#
|
|
# `world` in Cilium is everything outside the cluster (internet, LAN, VPN peers)
|
|
# but NOT other namespaces' pods and NOT the node IPs — so cross-namespace
|
|
# reachability and the internal WireGuard gateway ports stay closed.
|
|
#
|
|
# Deliberately absent:
|
|
# * kube-apiserver egress — no workload here calls the API; the audit's
|
|
# `SA token mounted` observation is a separate finding and denying the path
|
|
# does not depend on removing the token.
|
|
# * monitoring ingress — apart from the one port-scoped rule for the analyst
|
|
# freshness exporter below (Prometheus -> osint-analyst-exporter:9187),
|
|
# nothing in `monitoring` reaches this namespace.
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: default-deny
|
|
namespace: osint
|
|
spec:
|
|
podSelector: {}
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|
|
---
|
|
apiVersion: cilium.io/v2
|
|
kind: CiliumNetworkPolicy
|
|
metadata:
|
|
name: osint-allow
|
|
namespace: osint
|
|
spec:
|
|
description: >-
|
|
osint: gateway + kubelet ingress; egress to own namespace, cluster DNS and
|
|
the public internet only.
|
|
endpointSelector: {}
|
|
ingress:
|
|
- fromEntities:
|
|
- ingress
|
|
- host
|
|
- remote-node
|
|
- health
|
|
# Intra-namespace pod -> pod (app -> db, sidecars, the backup CronJob).
|
|
# Cilium enforces policy at BOTH ends, so this allow must exist in ingress as
|
|
# well as egress — measured on `piedmont`: with only the egress rule a pod
|
|
# could not reach its own Service (TimeoutError).
|
|
- fromEndpoints:
|
|
- matchLabels:
|
|
io.kubernetes.pod.namespace: osint
|
|
# Prometheus (namespace `monitoring`) scrapes the analyst freshness exporter
|
|
# on 9187 (apps/base/osint/analyst-exporter.yaml). Port-scoped: no other
|
|
# monitoring -> osint traffic is opened.
|
|
- fromEndpoints:
|
|
- matchLabels:
|
|
io.kubernetes.pod.namespace: monitoring
|
|
toPorts:
|
|
- ports:
|
|
- port: "9187"
|
|
protocol: TCP
|
|
egress:
|
|
- toEndpoints:
|
|
- matchLabels:
|
|
io.kubernetes.pod.namespace: kube-system
|
|
k8s-app: kube-dns
|
|
toPorts:
|
|
- ports:
|
|
- port: "53"
|
|
protocol: UDP
|
|
- port: "53"
|
|
protocol: TCP
|
|
- toEndpoints:
|
|
- matchLabels:
|
|
io.kubernetes.pod.namespace: osint
|
|
# Internet / LAN / VPN peers: news sources, Nominatim, inference API, RTSP.
|
|
- toEntities:
|
|
- world
|