teleport/api
Andrew Lytvynov e987caa292
client: set TLS certificate usage for k8s/app/db certs (#6824)
* client: set TLS certificate usage for k8s/app/db certs

--- TLS usage field

The certificate usage field prevents a certificate from being used for
other purposes. For example, a k8s-specific certificate will not be
accepted by a database service endpoint.

Server-side enforcement logic was already in place for a long time, but
we stopped setting the correct Usage in UserCertRequest during keystore
refactoring in 5.0 (with introduction of k8s certs).

--- TLS certificate overwrite

As part of this, client.ReissueUserCerts will no longer write
usage-restricted certificates into the top-level TLS certificate used
for Teleport API authentication.

For example, when generating a k8s-specific certificate, we used to
overwrite both:
- `~/.tsh/keys/$proxy/$user-x509.pem`
- `~/.tsh/keys/$proxy/$user-kube/$cluster/$kubeCluster-x509.pem`
This PR stops overwriting `~/.tsh/keys/$proxy/$user-x509.pem`.
This is not a breaking change.

--- Selected k8s cluster

Prior to this PR, `tsh status` printed the selected k8s cluster based on
the top-level TLS certificate. Since we no longer overwrite that
certificate, it will not contain a k8s cluster name.

Instead, we extract it from the kubeconfig, which is actually more
accurate since a user could switch to a different context out-of-band.

* Document UserCertRequest CertUsage enum values
2021-05-13 10:26:12 -07:00
..
client client: set TLS certificate usage for k8s/app/db certs (#6824) 2021-05-13 10:26:12 -07:00
constants Capture postgres extended protocol messages in audit log (#6303) 2021-04-14 13:39:59 -07:00
defaults ignore dangling tunnel conns 2021-03-26 14:11:02 -07:00
identityfile Refactor api package and docs to use pkg.go.dev effectively. (#6388) 2021-04-20 16:44:17 -07:00
profile Adding postgres_public_addr and mysql_public_addr (#6426) 2021-04-21 19:52:52 -07:00
types Introduce ClusterNetworkingConfig extracting fields from ClusterConfig (#6638) 2021-05-07 13:54:08 +02:00
utils Refactor api package and docs to use pkg.go.dev effectively. (#6388) 2021-04-20 16:44:17 -07:00
go.mod Use cmp.Equal instead of manual Equals methods (#5828) 2021-05-06 11:47:31 -07:00
go.sum Use cmp.Equal instead of manual Equals methods (#5828) 2021-05-06 11:47:31 -07:00