Interview Prep/Monitoring & Observability/Observability as Code, Security & Vendor Choices

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, hostNetwork and 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/log only, not the container runtime socket.
  • Pin images by digest, scan them (Trivy), and track CVEs in the collector distribution; use the minimal otelcol-k8s or a custom ocb build with only the components you use.
  • Restrict RBAC: kube-state-metrics needs list/watch, not secrets data; avoid granting get secrets cluster-wide.
  • Use Pod Security Admission exceptions only for the namespace that needs them.
All Monitoring & Observability questions

More on Observability as Code, Security & Vendor Choices