openshift/enhancements

Rotate/Renew long term CA and API client certs created by installer

praveenkumar opened this issue · 4 comments

When we use the installer to create the cluster, it creates a kubeconfig file for system:admin user which uses client certificates to authenticate to the API server and have a vaild CA (for 2 years). This client certificate is valid for 10 years and there is no way (at least we don’t know) to have it rotated with a new one after the cluster is created. Also the CA is the same for the existing cluster.

UseCase -1
If a company installs OpenShift and an employee that was cluster admin leaves, and now the company wants to revoke that employee's access to OpenShift. They cannot do that today if the employee had access to a client cert with admin access.

UseCase - 2
If we want to use a specific version of CRC on a cloud infra, then any user which downloaded that specific version of CRC has the kubeconfig file with API client certs and CA, able to login to the cluster as soon as they know the endpoints.

$ oc config view --kubeconfig ~/.crc/cache/crc_libvirt_4.5.5/kubeconfig
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: DATA+OMITTED
    server: https://api.crc.testing:6443
  name: crc
contexts:
- context:
    cluster: crc
    user: admin
  name: admin
current-context: admin
kind: Config
preferences: {}
users:
- name: admin
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED

$ oc config view --raw --kubeconfig ~/.crc/cache/crc_libvirt_4.5.5/kubeconfig -o jsonpath={.clusters[0].cluster.certificate-authority-data} | base64 -d - | openssl x509 -noout -dates -in -
notBefore=Aug  6 13:24:37 2020 GMT
notAfter=Aug  6 13:24:38 2022 GMT

$ oc config view --raw --kubeconfig ~/.crc/cache/crc_libvirt_4.5.5/kubeconfig -o jsonpath={.users[0].user.client-certificate-data} | base64 -d - | openssl x509 -noout -dates -in -
notBefore=Aug  6 12:44:49 2020 GMT
notAfter=Aug  4 12:44:50 2030 GMT

cc @bbrowning @gbraad

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.