-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Expose JWKS via a feature-flag #9813
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justinsb 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 |
(Splitting up #9352 into more reviewable chunks) |
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.
overall this LGTM. We'll want to add validation when the feature flag is enabled to ensure:
- k8s 1.19+
- internet-accessible API ELB
- not gossip
but we can do that in a followup PR.
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.
The DiscoveryOptionsBuilder
comments are the only ones of significant concern.
@@ -44,6 +45,9 @@ type Keypair struct { | |||
Type string `json:"type"` | |||
// LegacyFormat is whether the keypair is stored in a legacy format. | |||
LegacyFormat bool `json:"oldFormat"` | |||
|
|||
certificate *fi.TaskDependentResource |
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.
What is this for? It doesn't appear to be read by anything.
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 just felt more intuitive to store it, as we're also storing the fingerprint.
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 tend to be more YAGNI on these sorts of things. Anything that's going to need the cert will probably just pull it (and possibly the private key) out of the keystore. But I suppose it doesn't block.
} | ||
|
||
func (e *Keypair) setResources(cert *pki.Certificate) error { | ||
e.ensureResources() |
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 prefer to do stuff like this more lazily, not calculating the sha1 unless some previous ModelBuilder has called CertificateSHA1Fingerprint()
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.
Fair - as it is so cheap and to avoid the ordering requirement (must have called CertificateSHA1Fingerprint before setResources), is it OK to leave as is?
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 cheap enough to leave as-is.
f2474dc
to
5e2d85b
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.
Just one typo
@@ -44,6 +45,9 @@ type Keypair struct { | |||
Type string `json:"type"` | |||
// LegacyFormat is whether the keypair is stored in a legacy format. | |||
LegacyFormat bool `json:"oldFormat"` | |||
|
|||
certificate *fi.TaskDependentResource |
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 tend to be more YAGNI on these sorts of things. Anything that's going to need the cert will probably just pull it (and possibly the private key) out of the keystore. But I suppose it doesn't block.
When the PublicJWKS feature-flag is set, we expose the apiserver JWKS document publicly (including enabling anonymous access). This is a stepping stone to a more hardened configuration where we copy the JWKS document to S3/GCS/etc. Co-authored-by: John Gardiner Myers <[email protected]>
/lgtm |
/retest |
Fixing e2e tests here: kubernetes/test-infra#19056 |
/retest Review the full test history for this PR. Silence the bot with an |
/retest |
When the PublicJWKS feature-flag is set, we expose the apiserver JWKS
document publicly (including enabling anonymous access). This is a
stepping stone to a more hardened configuration where we copy the JWKS
document to S3/GCS/etc.