Kubernetes Config Credential

Detects embedded credentials inside a Kubernetes kubeconfig file - base64 client certificate / key data blocks and inline bearer tokens. A leaked kubeconfig grants cluster access at the scope of the embedded identity.

Type
regex
Engine
universal
Confidence
medium
Confidence justification
Medium confidence: the kubeconfig credential keys are distinctive, but base64 blocks and token fields appear in other contexts, so corroborative kubeconfig/kubernetes evidence is recommended.
Jurisdictions
global
Regulations
Criminal Code Act 1995 (Cth), Computer Fraud and Abuse Act, Computer Misuse Act 1990
Frameworks
CIS Controls, ISO 27001, NIST CSF, SOC 2
Data categories
credentials, security
Scope
narrow
Risk rating
9
Platform compatibility
Purview: Compatible, GCP DLP: Unsupported, Macie: Unsupported, Zscaler: Compatible, Palo Alto: Unsupported, Netskope: Unsupported

Pattern

(?i)(?<![A-Za-z0-9-])(?:client-certificate-data|client-key-data)\s*:\s*[A-Za-z0-9+/]{40,}={0,2}

Corroborative evidence keywords

kubeconfig, kubernetes, apiVersion, clusters, current-context, kubectl, certificate-authority-data

Proximity: 300 characters

Should match

Should not match

Known false positives

References