Skip to content

Kubernetes

Varman reads your cluster through the standard Kubernetes API and runs four checks. It works with EKS, AKS, GKE and self-managed clusters.

Check Passes when Evidence task
RBAC Least Privilege No ClusterRoleBinding grants cluster-admin to system:anonymous, system:authenticated, system:unauthenticated or any group other than system:masters Role-based Access Controls
Pod Security Standards Enforced Each non-system namespace has the label pod-security.kubernetes.io/enforce set to baseline or restricted Production Firewall & No-Public-Access Controls
No Privileged Containers Running pods in non-system namespaces are not privileged and are set to run as non-root Production Firewall & No-Public-Access Controls
Network Policies Present Each non-system namespace has at least one NetworkPolicy Production Firewall & No-Public-Access Controls

These namespaces count as system namespaces and are skipped: kube-system, kube-public, kube-node-lease, kube-flannel, local-path-storage, gatekeeper-system, calico-system and tigera-operator.

  • kubectl access to the cluster with rights to create a namespace, a ServiceAccount, a ClusterRole and a ClusterRoleBinding.
  • For the agent: Helm and a Varman API key.
  • For a direct connection: an API server endpoint that Varman’s servers can reach over the network.

Both connection methods need the same read-only access. The agent’s Helm chart creates this ClusterRole for you. It has get and list only, with no access to Secrets and no writes:

rules:
- apiGroups: [""]
resources: [pods, namespaces, serviceaccounts, nodes]
verbs: [get, list]
- apiGroups: ["networking.k8s.io"]
resources: [networkpolicies]
verbs: [get, list]
- apiGroups: ["rbac.authorization.k8s.io"]
resources: [roles, rolebindings, clusterroles, clusterrolebindings]
verbs: [get, list]

For a direct connection, bind a ServiceAccount to a ClusterRole like the one above.

In Varman, open Integrations, find Kubernetes and click Set up. The page offers two methods.

The agent runs inside your cluster as a CronJob and sends results outbound to Varman. Varman stores no cluster credentials and needs no inbound access, so this is the only method that works for private clusters (private EKS, AKS or GKE endpoints, on-premises).

  1. In Varman, go to Settings > API keys (the page has an Open API keys button) and create a key with the integration:update scope.

  2. Install the agent with Helm. Copy the command from the Varman page, it already has the right apiUrl:

    Terminal window
    helm install varman-agent oci://ghcr.io/varman-io/charts/varman-agent \
    -n varman-agent --create-namespace \
    --set apiUrl=<your Varman API URL> \
    --set apiKey=<your api key> \
    --set clusterName=<cluster name>

    clusterName is the name Varman shows for this cluster. To keep the key in a Secret you manage, create a Secret holding VARMAN_API_URL and VARMAN_API_KEY and pass --set existingSecret=<name> instead of apiKey.

  3. Optional: run it once now instead of waiting for the next hour.

    Terminal window
    kubectl -n varman-agent create job --from=cronjob/varman-agent varman-agent-manual
    kubectl -n varman-agent logs job/varman-agent-manual -f
  4. The connection appears in Varman automatically when the agent first reports in.

Varman stores only check results.

  • Agent: the CronJob runs on the schedule 0 * * * * (hourly) by default. Change it with --set schedule="<cron>".
  • Direct connection: checks run on the daily schedule described in the overview, or when you click Run now.
  • Agent: uninstall it first, so it stops reporting, then revoke its API key under Settings > API keys.

    Terminal window
    helm uninstall varman-agent -n varman-agent
  • Either method: open Integrations > Kubernetes, click Settings, then Disconnect. For a direct connection, also delete the ServiceAccount token in the cluster.

See Disconnecting for what Varman keeps.

  • Kubernetes API server URL not configured. The direct connection has no API server URL. Disconnect and connect again with the URL filled in.
  • Unable to read ClusterRoleBindings, Unable to read namespaces, Unable to read pods or Unable to read network policies. The token cannot list that resource, or the URL or CA certificate is wrong. Check the ClusterRole rules above and the CA certificate.
  • TLS or certificate errors on a managed cluster. Paste the cluster CA into CA Certificate (PEM). It must be the decoded PEM text, not the base64 string from the kubeconfig.
  • Direct connection times out. The API server is private or firewalled. Use the in-cluster agent instead.
  • A finding such as Namespace "payments" does not enforce Pod Security. Label the namespace, for example kubectl label namespace payments pod-security.kubernetes.io/enforce=baseline, then click Run again (or wait for the next agent run). See Pod Security Admission.
  • Namespace "<name>" has no NetworkPolicy. Add a default-deny NetworkPolicy and allow only the traffic you need. See Network Policies.