Skip to content
MediumSecrets & credentialsBLWK-CRED-008

A kubeconfig embeds static cluster credentials (‹path›) ​

What this means ​

‹path› contains ‹static credentials› embedded credential(s): bearer tokens, client keys or passwords. Unlike a cloud login, these usually do not expire, so a copied kubeconfig keeps working against the cluster.

How to fix it ​

  1. Switch each cluster entry to an exec plugin that fetches short-lived tokens (aws eks update-kubeconfig, gcloud container clusters get-credentials, az aks get-credentials or kubelogin).
  2. Revoke the embedded token or certificate on the cluster.
  3. Keep any kubeconfig that must hold static credentials readable by you alone (chmod 600).

Check it yourself ​

Run a scan and look for BLWK-CRED-008 in the results:

sh
bulwark scan

Installed the standalone CLI package instead of the app? The command is bulwarkctl.

How Bulwark decides

Bulwark reads credential_stores and reports this check when:

text
kind == "kube_config" and static_credentials > 0

If a value can't be read, Bulwark reports the check as undetermined rather than passing it. View the rule source.

References ​

Released under the Apache License 2.0.