-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add Proxy Auth to Multi Auth Options #2076
Add Proxy Auth to Multi Auth Options #2076
Conversation
Signed-off-by: Stephen Crawford <[email protected]>
Can you run |
Signed-off-by: Stephen Crawford <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2076 +/- ##
==========================================
- Coverage 71.43% 71.39% -0.05%
==========================================
Files 97 97
Lines 2647 2650 +3
Branches 408 410 +2
==========================================
+ Hits 1891 1892 +1
- Misses 641 642 +1
- Partials 115 116 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Stephen Crawford <[email protected]>
@stephen-crawford Would it be possible to share a docker setup (or manual setup) with instructions on how to test the change? |
HI @cwperks, sure no problem. It is not easy to get an actual proxy working with OpenSearch and dashboards with docker. However here are the details for running manually:
opensearch.requestHeadersAllowlist: ["securitytenant","Authorization","x-forwarded-for","x-proxy-user","x-proxy-roles"]
But if you instead try to access the normal dashboards address i.e. 5601 you will be redirected to the login page. |
Signed-off-by: Stephen Crawford <[email protected]>
c45b931
into
opensearch-project:main
* Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> * Add Proxy Auth to Multi Auth Options Signed-off-by: Stephen Crawford <[email protected]> --------- Signed-off-by: Stephen Crawford <[email protected]> (cherry picked from commit c45b931) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options * Add Proxy Auth to Multi Auth Options --------- (cherry picked from commit c45b931) Signed-off-by: Stephen Crawford <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
[Describe what this change achieves]
This changes adds support for Proxy Auth as a Multi Auth option. It also adds tests for Proxy Auth which generally lacked testing.
With this change, you can enable proxy auth alongside one or more other auth types. For example, you can enable proxy and basic auth in your opensearch_dashboards.yml.
When proxy auth is enabled alongside other auth types, requests which do not include the expected proxy auth headers will redirect to the default OpenSearch Login page. There, the existing auth mechanisms can be accessed.
Category
[Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation]
Enhancement
Why these changes are required?
In order to support multi auth where one of the options is proxy auth.
What is the old behavior before changes and new behavior after changes?
Previously, when a user tried to enable Proxy auth alongside another auth type as part of a multi auth configuration, they would be notified that proxy auth was not a valid auth type. This was caused by the multi auth code lacking handling for Proxy auth. Similarly even if you could enable proxy auth as part of multi auth, the login page for OpenSearch would not properly render when sending a request which did not include the valid auth headers.
Issues Resolved
[List any issues this PR will resolve (Is this a backport? If so, please add backport PR # and/or commits #)]
#1724
Testing
[Please provide details of testing done: unit testing, integration testing and manual testing]
This change was manually tested and also includes jest integration and unit tests.
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.