Kubernetes Client Certificate Signing Request Created or Approved by Non-System Identity
Detects creation or approval of a Kubernetes CertificateSigningRequest (CSR) by a non-system identity, indicating an attacker attempting to obtain a long-lived client certificate for persistent cluster access with elevated privileges.
This detection rule identifies the creation or approval of Kubernetes CertificateSigningRequests (CSRs) by identities outside the expected system accounts. Attackers who have compromised a Kubernetes cluster can exploit this by submitting a CSR with a privileged Common Name (CN), such as system:kube-controller-manager or system:masters, and subsequently approving it. This grants them a long-lived client certificate. Unlike short-lived service account tokens, these certificates remain valid until expiration or cluster CA rotation, ensuring persistent access. In non-EKS environments, the signed certificate allows authentication as a privileged entity from any location, bypassing the need for cluster network access, establishing a durable backdoor. This rule is designed to detect the abuse of CSRs for persistence and privilege escalation in Kubernetes environments.
Attack Chain
- Attacker gains initial access to the Kubernetes cluster through compromised credentials or a vulnerability.
- Attacker identifies a privileged Common Name (CN), such as
system:mastersorsystem:kube-controller-manager. - Attacker crafts a CertificateSigningRequest (CSR) with the chosen privileged CN. The CSR is encoded in base64.
- Attacker submits the CSR to the Kubernetes API server using
kubectl create csr. - Attacker attempts to approve the CSR using
kubectl certificate approve <csr-name>. - If RBAC permissions are misconfigured, the attacker successfully approves their own CSR.
- The Kubernetes API server signs the CSR, creating a client certificate.
- Attacker uses the client certificate to authenticate as the privileged identity and access cluster resources.
Impact
A successful attack allows an attacker to gain persistent, privileged access to the Kubernetes cluster. This can lead to complete control over the cluster, allowing them to deploy malicious applications, steal sensitive data, or disrupt services. The long-lived nature of the client certificate makes it a highly effective backdoor, as it persists through pod restarts, token revocations, and even RBAC changes. The impact is especially severe in non-EKS environments, where the attacker can authenticate from anywhere without needing cluster network access.
Recommendation
- Deploy the Sigma rule
Kubernetes Client Certificate Signing Request Created or Approvedto detect unauthorized CSR creation or approval events. - Review and harden RBAC configurations to prevent non-system identities from creating, updating, patching, or approving CertificateSigningRequests.
- Enforce signer restrictions and approved issuers where supported to limit the signers used for CSRs.
- Monitor Kubernetes audit logs for
create,update, orpatchevents related tocertificatesigningrequestswhere the user is not a system account, as defined in the rule’suser.nameexclusion list. - Investigate any alerts generated by the Sigma rule by extracting the Certificate Common Name from the base64-encoded request in
kubernetes.audit.requestObject.spec.request, as described in the rule’s notes. - If malicious activity is confirmed, deny further approval, delete or deny the CSR, revoke or rotate cluster signing trust if the CA or signer was abused, and invalidate issued credentials.
Detection coverage 3
Kubernetes Client Certificate Signing Request Created or Approved
highDetects creation or approval of a Kubernetes CertificateSigningRequest (CSR) by a non-system identity, which could indicate an attacker is attempting to obtain a long-lived client certificate for persistent access to the cluster with elevated privileges.
Kubernetes CSR Request for System Masters Group
mediumDetects a CertificateSigningRequest (CSR) containing the system:masters group in the encoded request.
Kubernetes CSR Request for Kube Controller Manager Identity
mediumDetects a CertificateSigningRequest (CSR) containing the system:kube-controller-manager identity in the encoded request.
Detection queries are available on the platform. Get full rules →