How do you reduce the security risk of the agents and exporters themselves?
AdvancedProductionObservability as Code, Security & Vendor Choices
Answer
Agents run on every node with broad access, which makes them an attractive target:
- node-exporter needs
hostPID,hostNetworkand a read-only host root mount; it does not need privileged mode or write access. Drop all capabilities and run as non-root. - Log agents need read access to
/var/logonly, not the container runtime socket. - Pin images by digest, scan them (Trivy), and track CVEs in the collector distribution; use the minimal
otelcol-k8sor a customocbbuild with only the components you use. - Restrict RBAC: kube-state-metrics needs list/watch, not secrets data; avoid granting
get secretscluster-wide. - Use Pod Security Admission exceptions only for the namespace that needs them.
More on Observability as Code, Security & Vendor Choices
What does "observability as code" cover, and why insist on it?BeginnerHow do you manage Grafana with Terraform?IntermediateHow do you validate Alertmanager configuration in CI?BeginnerWhat does a CI pipeline for Prometheus rules look like?IntermediateRaw dashboard JSON, Jsonnet/Grafonnet or the Grafana Foundation SDK: which do you pick?AdvancedWhat are monitoring mixins and how do you consume them?Advanced