Skip to content
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

OIDC: Tolerate extra service-account key set items #14175

Conversation

seh
Copy link
Contributor

@seh seh commented Aug 24, 2022

When reading the kOps "service-account" key set in preparation for publishing the OIDC JWKS file (such as to S3 alongside the discovery document), in some cases the set contains items that either lack an X.509 certificate or contain such a certificate issued for a subject with common name other than "service-account." Ignore these extra key set items and instead only project JWKS keys for those with an X.509
certificate with the expected subject common name.

Refs: #14174

When reading the kOps "service-account" key set in preparation for
publishing the OIDC JWKS file (such as to S3 alongside the discovery
document), in some cases the set contains items that either lack an
X.509 certificate or contain such a certificate issued for a subject
with common name other than "service-account." Ignore these extra key
set items and instead only project JWKS keys for those with an X.509
certificate with the expected subject common name.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 24, 2022
@hakman
Copy link
Member

hakman commented Aug 24, 2022

/cc @olemarkus

@hakman
Copy link
Member

hakman commented Aug 24, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 24, 2022
@hakman
Copy link
Member

hakman commented Aug 24, 2022

/retest

Copy link
Member

@olemarkus olemarkus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test looks sane, but I wonder if you can still end up in issues elsewhere. Especially if certificate rotation works.

I would assume that kops get keypairs still fails as well, so this wouldn't be a full fix of #14174.

@hakman
Copy link
Member

hakman commented Aug 26, 2022

This would at least unblock deployment and it can be iterated later.
Also, one could always distrust older keys.

@olemarkus
Copy link
Member

Yeah. I just wanted to unlink the issue so it doesn't get closed.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: olemarkus

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 26, 2022
@k8s-ci-robot k8s-ci-robot merged commit 4901e9f into kubernetes:master Aug 26, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone Aug 26, 2022
@seh
Copy link
Contributor Author

seh commented Aug 26, 2022

I would assume that kops get keypairs still fails as well, so this wouldn't be a full fix of #14174.

Yes, that's true. I didn't realize that kops get keypairs fails until after I had proposed this fix for the failure in kops update cluster, and I neglected to change the "Fixes" comment.

I expect that there are several more places that read key pairs that will need similar treatment.

@seh seh deleted the tolerate-extra-service-account-keyset-items branch August 26, 2022 12:08
k8s-ci-robot added a commit that referenced this pull request Aug 26, 2022
…-upstream-release-1.24

Automated cherry pick of #14175: OIDC: Tolerate extra service-account key set items
@seh
Copy link
Contributor Author

seh commented Oct 3, 2022

Please see #14370 for making kops get keypairs more tolerant as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants