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

fix(iam): oidc provider retrieves leaf certificate instead of root certificate #22509

Merged
merged 13 commits into from
Nov 4, 2022

Conversation

vinayak-kukreja
Copy link
Contributor

@vinayak-kukreja vinayak-kukreja commented Oct 14, 2022

Currently, the IAM OIDC Provider is retrieving leaf certificates for a given url. The validity for these certificates is not that long. This can cause an outage for the customer since they might not be aware of when the certificate is going to expire. We have seen an outage in EKS due to this issue.

This change will help retrieving root certificates instead of leaf certificates. The validity of root certificate is much more than the leaf certificates. I am also adding validations for the certificate and also informing the customer if there retrieved certificate is going to expire within six months when they do a new deployment.

Fixes #8607

Signed-off-by: Vinayak Kukreja [email protected]

All Submissions:

Adding new Unconventional Dependencies:

  • This PR adds new unconventional dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use yarn integ to deploy the infrastructure and generate the snapshot (i.e. yarn integ without --dry-run)?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

Signed-off-by: Vinayak Kukreja <[email protected]>
Signed-off-by: Vinayak Kukreja <[email protected]>
@gitpod-io
Copy link

gitpod-io bot commented Oct 14, 2022

@github-actions github-actions bot added the p2 label Oct 14, 2022
@aws-cdk-automation aws-cdk-automation requested a review from a team October 14, 2022 21:17
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

Signed-off-by: Vinayak Kukreja <[email protected]>
Signed-off-by: Vinayak Kukreja <[email protected]>
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 14, 2022
@vinayak-kukreja vinayak-kukreja changed the title fix(iam, eks): oidc provider gets root certificate fix(iam): oidc provider retrieves root certificate instead of leaf certificate Oct 14, 2022
Signed-off-by: Vinayak Kukreja <[email protected]>
Copy link
Contributor

@comcalvi comcalvi left a comment

Choose a reason for hiding this comment

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

looks pretty good, just some minor comments. Once the integ test is finished I can push it to this PR to make the linter happy

@aws-cdk-automation aws-cdk-automation dismissed their stale review October 21, 2022 21:41

✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.

@vinayak-kukreja vinayak-kukreja added the pr/do-not-merge This PR should not be merged at this time. label Oct 27, 2022
@vinayak-kukreja vinayak-kukreja marked this pull request as ready for review October 27, 2022 16:29
Copy link
Contributor

@comcalvi comcalvi left a comment

Choose a reason for hiding this comment

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

I don't understand why any non-EKS integration tests are affected by this change. The EKS tests that use the OIDCP should see a change to the thumbprint list, but should be it...why are these other changes here?

@vinayak-kukreja vinayak-kukreja force-pushed the vkukreja/oidc-provider-fix branch 2 times, most recently from 6d67d83 to 2951eeb Compare November 3, 2022 21:07
@iliapolo iliapolo changed the title fix(iam): oidc provider retrieves root certificate instead of leaf certificate fix(iam): oidc provider retrieves leaf certificate instead of root certificate Nov 3, 2022
@github-actions github-actions bot added the bug This issue is a bug. label Nov 3, 2022
@github-actions github-actions bot added the effort/medium Medium work item – several days of effort label Nov 3, 2022
Signed-off-by: Vinayak Kukreja <[email protected]>
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

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

The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.

Signed-off-by: Vinayak Kukreja <[email protected]>
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 4, 2022 02:27

✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.

Copy link
Contributor

@comcalvi comcalvi left a comment

Choose a reason for hiding this comment

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

lgtm

@iliapolo iliapolo removed the pr/do-not-merge This PR should not be merged at this time. label Nov 4, 2022
@mergify
Copy link
Contributor

mergify bot commented Nov 4, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 67d19a6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit ec32b5b into main Nov 4, 2022
@mergify mergify bot deleted the vkukreja/oidc-provider-fix branch November 4, 2022 13:47
@mergify
Copy link
Contributor

mergify bot commented Nov 4, 2022

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Naumel pushed a commit that referenced this pull request Nov 4, 2022
…rtificate (#22509)

Currently, the IAM OIDC Provider is retrieving leaf certificates for a given url. The validity for these certificates is not that long. This can cause an outage for the customer since they might not be aware of when the certificate is going to expire. We have seen an [outage](#8607) in EKS due to this issue. 

This change will help retrieving root certificates instead of leaf certificates. The validity of root certificate is much more than the leaf certificates. I am also adding validations for the certificate and also informing the customer if there retrieved certificate is going to expire within six months when they do a new deployment.

Fixes #8607

Signed-off-by: Vinayak Kukreja <[email protected]>

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
iliapolo added a commit that referenced this pull request Nov 7, 2022
mergify bot pushed a commit that referenced this pull request Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

‼️ (iam): OpenIdConnectProvider defaults to first thumbprint instead of root CA thumbprint
5 participants