Skip to main content
The Ankra Agent ships hardened by default - non-root, read-only root filesystem, all Linux capabilities dropped. This page covers what you can tighten beyond the defaults, and how to prove the resulting posture to an assessor. For the scope determination behind these controls, see Agent Compliance Posture.

Keep the token out of Helm values

Passing config.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.
Rotating that Secret and restarting the agent is also the fastest in-cluster way to cut the agent off during an incident.

Restrict network egress

The agent needs two external destinations plus in-cluster access to the Kubernetes API. Everything else can be denied.
Standard NetworkPolicy matches on CIDRs, not hostnames, so the external rule above cannot name platform.ankra.app directly. If your CNI supports FQDN-based egress policy - Cilium’s toFQDNs for example - use it to pin the two hostnames exactly. Otherwise the rule limits the agent to two ports on external addresses, which is still a meaningful reduction.
Before you apply a restrictive policy, account for the in-cluster endpoints the agent reaches on your behalf. If you have connected a Prometheus or log source endpoint, or you run the ArgoCD engine, the agent needs to reach those services too. The in-cluster rule above allows 443 and 6443 across namespaces; widen it to the specific ports and namespace selectors your integrations use, and verify the cluster still reports healthy afterwards.

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:
You can also narrow what the agent watches. Dynamic API discovery extends the watch set to CRDs and operator resources beyond the curated built-in list. Pinning it off limits both the metadata that egresses and the agent’s read footprint:
Secret redaction is on by default and should stay on. It replaces every Secret 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:
Pinning image.tag breaks the platform’s fleet auto-upgrade, which relies on the image following the chart version. If you mirror, mirror new chart versions on a schedule so the agent does not fall behind on security fixes.

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 an rbac.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.
Inspect exactly what is granted at any time:

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:
The 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:
Accepted values are 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:
If you also want Ankra to search those logs back, connect the store as a log source.

Verify the posture

Prove the settings rather than asserting them. These commands produce output you can attach to an audit response.
An empty result from the host-namespace query means none are set, which is the expected and correct output.

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.