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

Dynamic sign in options #3869

Merged
merged 29 commits into from
Mar 19, 2024

Conversation

davidosorno
Copy link
Contributor

@davidosorno davidosorno commented Dec 19, 2023

Description

New Feature
Allow admins to define the sign-in options that will be displayed on OpenSearch Dashboard login page. There are couple of sign-in options defined in Security documentation, and theses options must be available in security config.yml file to be able to change them dynamically in Security Dashboard.
Furthermore, if anonymous_auth_enabled is true it will be available in Security Dashboard sign-in options to allow admins enable or disable it.

Old Behavior
Admins have to update opensearch_dashboards.yml adding or removing sign-in options, and then restart Dashboards to be able to log in using other sign-in option.

New Behavior
Admins can change sign-in options dynamically without having to restart the Dashboards, and the changes are applied immediately. Users just need to logout in order to see the sign-in options available.

Issues Resolved

Testing

Unit Testing, Integration Testing, and Manual Testing.

Check List

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

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.

Copy link
Member

@cwperks cwperks left a comment

Choose a reason for hiding this comment

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

Thank you @davidosorno and @EduardoCorazon. This PR looks good to me. Left a couple of suggestions.

willyborankin
willyborankin previously approved these changes Dec 20, 2023
Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

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

Nice job plumbing this through, I think we need a couple more test cases around different positive scenarios.

Before we merge lets make the validation clearer:

  • Is the response is when Enum::valueOf doesn't have a match actionable? I hope their is a clear error message
  • What should happen in the authc configuration only saml is supported? I would think the other sign in types be invalid, how do you think this should be handled?

@cwperks cwperks added the backport 2.x backport to 2.x branch label Feb 7, 2024
cwperks
cwperks previously approved these changes Feb 7, 2024
DarshitChanpura
DarshitChanpura previously approved these changes Feb 7, 2024
Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @davidosorno for addressing all comments!

@DarshitChanpura
Copy link
Member

DarshitChanpura commented Feb 7, 2024

@peternied This PR is currently merge-blocked by your requested change. Would you please re-review this?

@peternied
Copy link
Member

This PR uses the security's backend for data storage with no reasoning about the correctness of the values set. Until this is addressed I don't think this change should be merged. If we don't want to perform this reasoning I would advocate that this scenario is supported by using .kibana index to dynamically config this setting post boot.

@DarshitChanpura What do you think?

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

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

My understanding is that this is a security config related update like multi-tenancy toggle which we are trying to make dynamically change-able, and all security config related updates have been part of security backend. I agree with adding couple more test cases to ensure that correct data is being displayed, and I think that using security backend along with tests that cover all bases should suffice to add this change. @davidosorno Would you mind addressing the outstanding comment about adding tests for all scenarios?

@DarshitChanpura DarshitChanpura dismissed their stale review February 8, 2024 14:59

waiting for more comments to be addressed

willyborankin
willyborankin previously approved these changes Feb 15, 2024
@stephen-crawford
Copy link
Contributor

stephen-crawford commented Mar 5, 2024

@cwperks what do you want to do with this? I know @davidosorno is not going to be able to finish this so should we close it or do you have plans to take this over?

Edit: Thanks @davidosorno, sorry I misunderstood from our previous chat.

@davidosorno
Copy link
Contributor Author

Hi @scrawfor99, I can fix anything to this PR if needed, I'm just waiting @peternied unblock it and the PR gets more reviews.

@peternied
Copy link
Member

@davidosorno The data storage is being used to save a value for use on the front end - it isn't usable by the backend or other clients. With the value being specific to the front end, it seems stored it in the .kibana index would be an easier alternative with less coupling, no?

@cwperks
Copy link
Member

cwperks commented Mar 6, 2024

The data storage is being used to save a value for use on the front end - it isn't usable by the backend or other clients. With the value being specific to the front end, it seems stored it in the .kibana index would be an easier alternative with less coupling, no?

@peternied The convention for dynamic dashboards settings has been to store them in the security index. Putting the sign-in options in the same place is consistent with the other dynamic dashboards settings for the security dashboards plugin.

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

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

+1 to Craig's comments. This should be stored in security index since it is about the ability to update sign-in options and from what i understand .kibana index stores information about dashboard objects and not about security related configuration. Maybe I'm misunderstanding the question here?

@davidosorno davidosorno dismissed stale reviews from willyborankin and cwperks via 46c296f March 12, 2024 15:21
@davidosorno davidosorno force-pushed the DynamicSignInOptions branch from 2ad9719 to 0f1792b Compare March 13, 2024 23:16
@cwperks cwperks merged commit 25e2e51 into opensearch-project:main Mar 19, 2024
82 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 19, 2024
### Description
**New Feature**
Allow admins to define the sign-in options that will be displayed on
OpenSearch Dashboard login page. There are couple of sign-in options
defined in [Security
documentation](https://opensearch.org/docs/latest/security/configuration/multi-auth/),
and theses options must be available in security _config.yml_ file to be
able to change them dynamically in Security Dashboard.
Furthermore, if `anonymous_auth_enabled` is true it will be available in
Security Dashboard sign-in options to allow admins enable or disable it.

*Old Behavior*
Admins have to update _opensearch_dashboards.yml_ adding or removing
sign-in options, and then restart Dashboards to be able to log in using
other sign-in option.

*New Behavior*
Admins can change sign-in options dynamically without having to restart
the Dashboards, and the changes are applied immediately. Users just need
to logout in order to see the sign-in options available.

### Issues Resolved
- Related
opensearch-project/security-dashboards-plugin#1573

### Testing
Unit Testing, Integration Testing, and Manual Testing.

### Check List
- [x] New functionality includes testing
- [ ] New functionality has been documented
- [x] Commits are signed per the DCO using --signoff

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](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: David Osorno <[email protected]>
(cherry picked from commit 25e2e51)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@davidosorno
Copy link
Contributor Author

Finally, it was merged.

I want to Thank @cwperks, @peternied, and @DarshitChanpura for your guidance, and helping me to develop this feature. It was really nice working with you all.

peternied pushed a commit that referenced this pull request Mar 26, 2024
Backport 25e2e51 from #3869.

---------

Signed-off-by: David Osorno <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Craig Perkins <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Craig Perkins <[email protected]>
dlin2028 pushed a commit to dlin2028/security that referenced this pull request May 1, 2024
### Description
**New Feature**
Allow admins to define the sign-in options that will be displayed on
OpenSearch Dashboard login page. There are couple of sign-in options
defined in [Security
documentation](https://opensearch.org/docs/latest/security/configuration/multi-auth/),
and theses options must be available in security _config.yml_ file to be
able to change them dynamically in Security Dashboard.
Furthermore, if `anonymous_auth_enabled` is true it will be available in
Security Dashboard sign-in options to allow admins enable or disable it.

*Old Behavior*
Admins have to update _opensearch_dashboards.yml_ adding or removing
sign-in options, and then restart Dashboards to be able to log in using
other sign-in option.

*New Behavior*
Admins can change sign-in options dynamically without having to restart
the Dashboards, and the changes are applied immediately. Users just need
to logout in order to see the sign-in options available.

### Issues Resolved
- Related
opensearch-project/security-dashboards-plugin#1573

### Testing
Unit Testing, Integration Testing, and Manual Testing.

### Check List
- [x] New functionality includes testing
- [ ] New functionality has been documented
- [x] Commits are signed per the DCO using --signoff

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](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: David Osorno <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants