Connect a Kubernetes cluster

Create a read-only service account in your cluster and give ProofLayer its address, certificate and token so it can check who has admin rights and how workloads are hardened.

25 minYou need: A platform or DevOps engineer with admin access to the cluster (and `kubectl` on their computer)

Before you start

Kubernetes runs your company’s applications in containers. Connecting it needs a few commands run by someone who manages the cluster. This page is written so you can forward it to that person. A service account is a named identity for software inside the cluster; ProofLayer gets a token (a long text “pass”) for a read-only one.

  • ProofLayer only reads: pods, namespaces and the list of who is bound to which role. It cannot change anything.
  • The engineer needs kubectl set up for the cluster and permission to create a service account and role bindings.
  • ProofLayer must be able to reach the cluster’s address over the internet. If your cluster is private, use the in-account agent option at the end instead.
  • Choose a cluster name you will recognise (for example prod-eks-mumbai). It appears on every piece of evidence.

Step 1: Add the connection in ProofLayer

  1. Open Connections and click New connection

    Choose Kubernetes, give it a name, and enter the Cluster name.

  2. Open the new connection

    Find the Kubernetes access card. You will fill it in at step 4.

Step 2: Create a read-only service account (engineer)

  1. Create the service account

    Run in a terminal
    kubectl create serviceaccount prooflayer -n kube-system
  2. Let it view workloads

    Bind it to the built-in read-only view role.

    Run in a terminal
    kubectl create clusterrolebinding prooflayer-view --clusterrole=view --serviceaccount=kube-system:prooflayer
  3. Let it read the list of role bindings

    The view role does not include this, and ProofLayer needs it to check who has cluster-admin rights.

    Run in a terminal
    kubectl create clusterrole prooflayer-rbac-read --verb=get,list --resource=clusterrolebindings.rbac.authorization.k8s.io
    kubectl create clusterrolebinding prooflayer-rbac-read --clusterrole=prooflayer-rbac-read --serviceaccount=kube-system:prooflayer

Step 3: Collect the three values (engineer)

  1. The API server URL

    Run the command and copy the address after “Kubernetes control plane is running at”. It looks like https://k8s.example.com:6443.

    Run in a terminal
    kubectl cluster-info
  2. The cluster certificate (CA)

    This lets ProofLayer be sure it is talking to your cluster. Find certificate-authority-data in your kubeconfig file, and decode it from base64 into text that starts with -----BEGIN CERTIFICATE-----. You can leave this blank if the cluster uses a certificate from a public authority.

    Run in a terminal (macOS or Linux)
    kubectl config view --raw --minify -o jsonpath='{.clusters[0].cluster.certificate-authority-data}' | base64 -d
  3. The token

    This creates a token that works for a year (8760h). Diary its renewal.

    Run in a terminal
    kubectl create token prooflayer -n kube-system --duration=8760h

    The token begins with eyJ. Treat it like a password.

Step 4: Paste them into ProofLayer

  1. On the Kubernetes access card, fill in the boxes

    API server URL, Cluster CA certificate (PEM) (optional) and Service-account token. The token is stored encrypted and never shown again.

  2. Click Save access

Check that it works

  1. Click Test access

    ProofLayer calls the cluster with the token.

    Success shows Access verified. A problem shows Access test failed with the cluster’s reason.

  2. Run a scan

    Start one from Runs. Results appear under Findings.

Example with made-up data
Production AWS
123456789012
Active
External ID
pl-7f3a9c2e1b4d… (copy)
Role ARN
arn:aws:iam::123456789012:role/ProofLayerReadOnly
Last access test
Passed 12 Nov 2026, 08:55 UTC
A healthy connection after the access test (shown for AWS; Kubernetes looks the same).

What ProofLayer reads

  • Admin rights: who is bound to the powerful cluster-admin role, so you can show the list is short.
  • Workload hardening: whether any container runs in privileged mode, whether images are pinned to a version instead of :latest, and whether workloads run as a non-root user.

If something goes wrong

What you seeLikely causeWhat to do
Could not reach the serverThe API server address is wrong or is not open to ProofLayer from the internetRe-run kubectl cluster-info and compare. If the cluster is private, use the agent option.
Certificate error (unknown authority)The CA certificate is missing or wrongPaste the decoded certificate (starting -----BEGIN CERTIFICATE-----) into the CA box.
401 UnauthorizedThe token is wrong or has expiredCreate a new token with kubectl create token and click Update access.
403 Forbidden for role bindingsThe role-binding read permission from step 2 was not addedRun the two commands in the third step of step 2, then test again.