Kubernetes
What it does in Varman
Section titled “What it does in Varman”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.
What you need
Section titled “What you need”kubectlaccess 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.
Permissions requested
Section titled “Permissions requested”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.
Connect
Section titled “Connect”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).
-
In Varman, go to Settings > API keys (the page has an Open API keys button) and create a key with the
integration:updatescope. -
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>clusterNameis the name Varman shows for this cluster. To keep the key in a Secret you manage, create a Secret holdingVARMAN_API_URLandVARMAN_API_KEYand pass--set existingSecret=<name>instead ofapiKey. -
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-manualkubectl -n varman-agent logs job/varman-agent-manual -f -
The connection appears in Varman automatically when the agent first reports in.
Click Advanced: connect by API server and token to show the form. Varman’s servers call your API server directly, so it must be reachable from the internet, through VPC peering or through a proxy.
-
Create a read-only ServiceAccount and bind it to a ClusterRole with the rules above.
-
Create a long-lived token for it. Kubernetes 1.24 and later do not create one automatically: create a Secret of type
kubernetes.io/service-account-tokenfor the ServiceAccount, or usekubectl create tokenand note that the token expires. See Managing service accounts. -
Fill in the form and click Connect account:
- API Server URL: the cluster endpoint, from
kubectl config view -o jsonpath="{.clusters[0].cluster.server}". - Service Account Token: the token from step 2.
- CA Certificate (PEM): the
certificate-authority-datafrom your kubeconfig, base64-decoded. Needed for EKS, AKS, GKE and any API server with a self-signed certificate. - Skip TLS verification: set to
trueonly for lab clusters. Prefer the CA certificate.
- API Server URL: the cluster endpoint, from
What gets synced and how often
Section titled “What gets synced and how often”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.
Disconnect
Section titled “Disconnect”-
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.
Troubleshooting
Section titled “Troubleshooting”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 podsorUnable 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 examplekubectl 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.