-
Notifications
You must be signed in to change notification settings - Fork 162
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
Added client certificate options to support mutual TLS for OpenID endpoint #1650
Conversation
Signed-off-by: Calvin Harrison <[email protected]>
Thank you for the PR @Simple-Analysis ! Have you been able to verify this change? Would it be possible to validate this change with a functional test similar to tests present on this PR in the opensearch-dashboards-functional-test repo? |
There are 2 issues impacting the CI checks:
|
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.
Thank you for this contribution @Simple-Analysis ! The changes look good. Could you add some tests around the usage?
Sure! When I have a chance, I will write some tests for this. Can you point me in a good direction for similar oauth/oidc tests? I was most likely going to adapt the opensearch security plugin's tests (if they have them) because the same requests are made but with mutual tls already integrated. What are your thoughts? I will also run some functional tests as @cwperks mentioned. I just had some time to start work on this, so hopefully I wasn't too premature with the PR? |
Signed-off-by: Calvin Harrison <[email protected]>
Signed-off-by: Calvin Harrison <[email protected]>
For this change, I would be happy with unit tests but please also confirm if this works for your setup as well. One way to test this is change the visibility of the In the test suite for openid_auth.test.ts you can add a test that verifies that the wreck client is properly assigned its configured values like this:
In this case, I had to add test files and created the folders |
…utility function for nice output. Signed-off-by: Calvin Harrison <[email protected]> Signed-off-by: Calvin Harrison <[email protected]>
Signed-off-by: Calvin Harrison <[email protected]>
ce50226
to
f355845
Compare
I had some time to get the OpenSearch project's development environment running and verified that the change works. I tested against my keycloak instance as well as a web server that mirrors the mTLS enforcement of the gateway. I will update the documentation as well to reflect this change. |
… logging for rclient. Signed-off-by: Calvin Harrison <[email protected]>
Signed-off-by: Simple-Analysis <[email protected]>
@cwperks I was thinking about this change and if it made sense to limit the ssl options to just the openid configuration. Granted, this solves my observed problem, but I was wondering if refactoring would be necessary in the future should these options need to be reused in a different operation and/or auth type. That said, would you want to introduce a new schema object for |
@Simple-Analysis I think this may only be applicable to OpenID. In both SAML and LDAP, the frontend never makes any calls to the external Identity Provider only the backend (OpenSearch) would. In those cases, there are settings to configure SSL between OpenSearch and the external Identity Provider. If I understand correctly, for OIDC the security-dashboards-plugin calls on the OpenID Connect URL and to setup a secure connection with the wreckClient in security-dashboards-plugin to the OpenID Connect URL, a user would need to set FYI settings in |
@cwperks Okay, perfect! I will hold off on that change then. Thanks for confirming. I did notice that it was undocumented. I was hoping to create a documentation PR for all of these SSL options. I can add documentation for the existing options as well. Is it standard procedure to wait until the change is merged to update the docs or can they happen in parallel? |
On another note, I ran the unit tests manually and they seemed solid but it seems like they don't run in these pipelines? I saw the |
Yes, they can happen in parallel. If you open a PR on the documentation-website please also link back to this PR. The documentation PR won't merge until this PR is, but it would be helpful to go through that review process so that it is ready once this PR is ready to merge. The tests in |
@cwperks Great! I will create that documentation PR. We are just waiting on code review for this PR right? |
@peternied @DarshitChanpura @RyanL1997 @derek-ho Can this PR get another review? |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1650 +/- ##
=======================================
Coverage 67.06% 67.06%
=======================================
Files 94 94
Lines 2402 2402
Branches 318 318
=======================================
Hits 1611 1611
Misses 713 713
Partials 78 78 ☔ View full report in Codecov by Sentry. |
Thank you for your contribution @Simple-Analysis! |
…point (#1650) * Added client certificate options to support mutual TLS --------- Signed-off-by: Calvin Harrison <[email protected]> Signed-off-by: Simple-Analysis <[email protected]> Co-authored-by: Peter Nied <[email protected]> (cherry picked from commit ec661f8)
…point (#1650) (#1683) * Added client certificate options to support mutual TLS --------- Signed-off-by: Calvin Harrison <[email protected]> Signed-off-by: Simple-Analysis <[email protected]> Co-authored-by: Peter Nied <[email protected]> (cherry picked from commit ec661f8) Co-authored-by: Simple-Analysis <[email protected]>
Description
Added client certificate options to support mutual TLS for OpenID endpoint. Requests to an IdP's well-known configuration endpoint that require client certificate authentication can now succeed. The HTTPS agent will use client certificate options if configured.
Category
Enhancement, Bug fix
Why these changes are required?
The HTTPS agent is not currently configured to support mutual TLS.
What is the old behavior before changes and new behavior after changes?
Old behavior: Requests made to the OpenID endpoints fail with 401 errors when client certificate authentication is mandatory for the IdP endpoints.
New behavior: Users can configure options to enable mutual TLS.
Issues Resolved
#1647
Testing
[Please provide details of testing done: unit testing, integration testing and manual testing]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.