Information
Do not make use of client certificate authentication in GKE, as the credentials cannot be revoked. Instead, use another authentication method like OpenID Connect.
With Client Certificate authentication, a client presents a certificate that the API server verifies with the specified Certificate Authority. In GKE, Client Certificates are signed by the cluster root Certificate Authority. When retrieved, the Client Certificate is only base64 encoded and not encrypted.
GKE manages authentication via gcloud for you using the OpenID Connect token method, setting up the Kubernetes configuration, getting an access token, and keeping it up to date. This means Basic Authentication using static passwords and Client Certificate authentication, which both require additional management overhead of key management and rotation, are not necessary and should not be used where possible.
When Client Certificate creation is disabled GKE will not provide a client certificate on cluster creation, however users will still be able to use the Certificate Signing Request (CSR) API to create new client certificates, if they have access to it.
Solution
Currently, there is no way to remove a client certificate from an existing cluster. Thus a new cluster must be created.
Using Google Cloud Console
- Go to Kubernetes Engine by visiting https://console.cloud.google.com/kubernetes/list
- Click CREATE CLUSTER
- Configure as required and the click on 'Availability, networking, security, and additional features' section
- Ensure that the 'Issue a client certificate' checkbox is not ticked
- Click CREATE.
Using Command Line
Create a new cluster without a Client Certificate:
gcloud container clusters create [CLUSTER_NAME] \\
--no-issue-client-certificate
In addition it's important to restrict access to the CSR API in Kubernetes to prevent users from using it to issue new client certificate credentials.
Impact:
Users will no longer be able to authenticate with the pre-provisioned x509 certificate. You should configure and use alternate authentication mechanisms, such as OpenID Connect tokens.