-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KEP-3257: cluster trust bundles: add a new in-tree signer and its CTB #4791
Conversation
purpose as the `kube-root-ca.crt` configMap - to verify internal kube-apiserver | ||
endpoints. There is currently no in-tree signer designated for these purposes, | ||
and so the signer with name `kubernetes.io/kube-apiserver-server` is introduced | ||
along with this bundle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A good exercise to make sure we fully specify the meaning / behavior of this signer is to add the documentation here for this new signer that we would add to https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/#kubernetes-signers.
Because this is encompassing existing serving certificates issued by other existing signers, we have less control over the exact shape, but we can say some things like it must be valid for in order to work, e.g.:
- Permitted x509 extensions - honors key usage and DNSName/IPAddress subjectAltName extensions. At least one DNS or IP subjectAltName must be present.
- Conformance test requires resolution of
kubernetes.default.svc.$cluster-domain
- I'm not sure the current status of the ability to change the cluster domain fromcluster.local
... maybe get network folks feedback on whether it makes sense to spec that the kube-apiserver certificate should (must?) contain the DNS subjectAltNamekubernetes.default.svc
and/orkubernetes.default.svc.$cluster-domain
- Conformance test requires resolution of
- Required key usages (other key usages may be present) - ["key encipherment", "digital signature", "server auth"] or ["digital signature", "server auth"].
This line in the signerName docs would also need to change if we don't intend to have k-c-m sign these certs
The kube-controller-manager implements control plane signing for each of the built in signers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is encompassing existing serving certificates issued by other existing signers
It's encompassing certificates you can use to verify kube-apiserver serving certificates, but it's not restricted to bundling the serving certs, right?
If I were to maintain a cluster, I wouldn't actually want to put a serving certificate in this bundle. Instead, I want to bundle signers of those serving certs so that I can rotate my KAS serving certs freely, without having to worry about what's going to happen to the KAS trust in all the pods in the cluster.
I don't think we can easily restrict the certs in the bundle, except for we could probably ban the use of the "client auth" EKU. I think we could force the restrictions you described on certs with the server auth EKU.
Note that your proposal would likely make the bundle unusable in OpenShift, if I understood it correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a commit with a section that talks of validation of this bundle, please see if it makes sense to you. I haven't run the DNS/IP SAN part through the sig-networking folk yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's encompassing certificates you can use to verify kube-apiserver serving certificates, but it's not restricted to bundling the serving certs, right?
I think Jordan is saying this new signer takes ownership of the existing API server serving certs. So for example, we cannot say something like "the SAN list but be exactly kubernetes.default.svc and kubernetes.default.svc.$cluster-domain" because existing working clusters could have extra SANs in their serving certs. I understand Jordan's comment to only be about the signer, and not the CTB contents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, this was clarified in a later comment - #4791 (comment)
the
(it's ok to make those changes in another KEP update PR, just noting that they're needed) |
Many thanks for the reviews! I'm still to work on the I'm not sure I understood the part about the new bundle certs' restrictions properly. I think that having some restrictions would be a good thing to help users avoid putting wrong certs into the bundle, let's clarify some more how we'd like to handle those. |
f63cb11
to
be5759b
Compare
Added explanation on version skewed kubelets. Also realized the KCM behavior should probably also be featuregated so I added a FG for it. |
f55966e
to
fb96692
Compare
Certificates in this bundle MUST NOT set the Extended Key Usage extension to "client auth". | ||
|
||
Certificates are valid for the bundle iff they fulfill at least one of the following |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these rules are mixing requirements for the certs in the bundle, and certs issues by signers in the bundle. Some of these rules are for the certificates issued by signers in this bundle, not the CA certs in the bundle themselves, right?
I'm mostly looking for the rules on the kube-apiserver certs (serving certs, with some guidance on expected SANs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm mostly looking for the rules on the kube-apiserver certs (serving certs, with some guidance on expected SANs)
I see, that's the part I wasn't sure about. It's a bit odd situation with the signer because we won't be the ones doing the signing this time. Enforcing the rules gets a bit tricky this way, although a conformance test is a good idea on how to make sure our expectations on the signer are met.
I'll think about this section some more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rewrote the whole section, it should now match the format of the signers from the k/website. I made the requirements on the signed certs' SANs a bit looser to allow for non-internal kube-apiserver hostnames, I wonder if that's something we may want to allow?
fb96692
to
abe0645
Compare
abe0645
to
c6fef53
Compare
54c99db
to
e9fcf72
Compare
e9fcf72
to
51c9e50
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass on the diff. I think there is still stuff in this KEP that needs to be changed such as removing
Signer controllers may follow the convention of making the label selector kubernetes.io/cluster-trust-bundle-version=live correspond to a meaningful set of trust anchors.
purpose as the `kube-root-ca.crt` configMap - to verify internal kube-apiserver | ||
endpoints. There is currently no in-tree signer designated for these purposes, | ||
and so the signer with name `kubernetes.io/kube-apiserver-server` is introduced | ||
along with this bundle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's encompassing certificates you can use to verify kube-apiserver serving certificates, but it's not restricted to bundling the serving certs, right?
I think Jordan is saying this new signer takes ownership of the existing API server serving certs. So for example, we cannot say something like "the SAN list but be exactly kubernetes.default.svc and kubernetes.default.svc.$cluster-domain" because existing working clusters could have extra SANs in their serving certs. I understand Jordan's comment to only be about the signer, and not the CTB contents.
51c9e50
to
6bd564b
Compare
Rewrote the API discovery for KCM, kubelet to be only performed upon startup. |
- remove mentions of deferred behavior - typo fixes
8c45dff
to
fd8ca84
Compare
The latest push only squashes most the commits. |
/lgtm (Jordan said he was fine with my ack) |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: enj, stlaz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
One-line PR description:
Adds a mention of a new default trust bundle and its signer + one more non-goal
Issue link: ClusterTrustBundles (previously Trust Anchor Sets) #3257
Other comments:
/cc ahmedtd enj liggitt