Keep the token out of Helm values
Passingconfig.token on the command line puts the credential in your shell history and in the Helm release Secret. Create the Secret yourself and reference it instead.
Restrict network egress
The agent needs two external destinations plus in-cluster access to the Kubernetes API. Everything else can be denied.Turn off optional egress
The public IP lookup is the only outbound call the agent makes that is not required, and it is disabled by default. Confirm it stays that way in restricted-egress environments:data and stringData value with a SHA-256 digest before it enters the sync pipeline:
Turning the watch pipeline off entirely (
k8s_watch.enabled: false) stops resource browsing and live views in the platform. Prefer narrowing discovery over disabling the pipeline.Mirror the image
Pull the agent image and chart from a registry you control rather than reaching a vendor registry from every cluster. Mirror them into your own registry, then point the chart at it:The service account
The agent’s ClusterRole grants all verbs on all resources in all API groups. It cannot be narrowed through chart values today - the rules are fixed in the chart, not templated from values. Anyone telling you to set anrbac.rules override is describing a knob that does not exist.
What you can do instead:
- Constrain the agent by namespace policy rather than RBAC. Admission policy engines such as Kyverno or Gatekeeper still apply to everything the agent creates. Its Kubernetes privilege does not exempt it from your admission controls, so policy is the effective place to draw the line.
- Tier your clusters. Run Ankra-managed clusters as a separate tier from your highest-sensitivity workloads, so the privilege boundary matches your data boundary. This is also the practical answer for PCI scope.
- Alert on changes to the binding. Watch the ClusterRole and ClusterRoleBinding for modification, so an unexpected change is a detection rather than a discovery.
- Review it on your normal cadence. Record the binding as a justified exception in your privileged-access register and review it alongside your other cluster-admin grants.
- Move the control plane inside your boundary. The self-hosted deployment keeps the privileged component on infrastructure you operate.
Ship the agent’s metrics
The agent exposes Prometheus metrics on port 8080 at/metrics. If you run the Prometheus Operator, enable the bundled ServiceMonitor:
labels block must match your Prometheus instance’s serviceMonitorSelector, otherwise the ServiceMonitor is created but never scraped.
Without the Prometheus Operator, scrape the Service directly at ankra-agent.ankra.svc:8080/metrics.
Metrics worth alerting on:
Health endpoints for liveness and readiness probes are on the same port at
/livez and /readyz.
Ship the agent’s logs
The agent writes structured JSON to stdout, so any Kubernetes log collector picks it up without extra configuration. Set the verbosity through chart values:DEBUG, INFO, WARNING, ERROR and CRITICAL. Keep production at INFO - DEBUG is verbose enough to matter on a busy cluster.
Secret-bearing strings pass through a redaction handler before a line is emitted, covering authorization headers, credentials embedded in URLs, provider tokens, password assignments and docker config JSON. Do not bypass it by writing agent output through a different path.
To collect the logs with Promtail or Grafana Alloy, select the namespace:
Verify the posture
Prove the settings rather than asserting them. These commands produce output you can attach to an audit response.Related
Agent Compliance Posture
The scope determination these controls support.
Agent Helm Values
The complete value reference.
Monitoring Stack
Deploy Prometheus and Loki to receive these signals.
Compliance Management
Turn cluster state into audit evidence.