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 logout from Wazuh when SAML is enabled (4.3) #4815

Merged
merged 2 commits into from
Nov 7, 2022

Conversation

Tostti
Copy link
Member

@Tostti Tostti commented Nov 7, 2022

Description

When SAML is enabled, the logout button inside the Wazuh plugin didn't work properly. That was because there is a function to remove the token before redirecting to logout, and the logout URL is different when SAML is enabled.

The solucion provided is to get the logout URL programatically from the logout anchor. That way, the issue is resolved and there is no need to modify anything in case that the logout URL changes in the future.

Issues Resolved

#4595

Evidence

Trying to log out from the Wazuh plugin before the changes:
image

Trying to log out from the Wazuh plugin after the changes (the user is correctly redirected to the idp login page):
image

Test

Scenario: have an environment with xPack
When the user opens the Wazuh plugin and clicks on log out
Then the session should be closed and the user redirected to the login page

Scenario: have an environment with OpenDistro
When the user opens the Wazuh plugin and clicks on log out
Then the session should be closed and the user redirected to the login page

Scenario: have an environment with OpenSearch
When the user opens the Wazuh plugin and clicks on log out
Then the session should be closed and the user redirected to the login page

Scenario: have an environment with SAML
When the user opens the Wazuh plugin and clicks on log out
Then the session should be closed and the user redirected to the login page

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@Tostti Tostti self-assigned this Nov 7, 2022
@Tostti Tostti linked an issue Nov 7, 2022 that may be closed by this pull request
1 task
@Tostti Tostti removed a link to an issue Nov 7, 2022
1 task
@Tostti Tostti linked an issue Nov 7, 2022 that may be closed by this pull request
1 task
@Tostti Tostti marked this pull request as ready for review November 7, 2022 14:35
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2022

Jest Test Coverage % values
Statements 6.89% ( 2513 / 36483 )
Branches 2.72% ( 769 / 28224 )
Functions 4.6% ( 410 / 8920 )
Lines 6.97% ( 2432 / 34906 )

@Tostti Tostti requested a review from a team November 7, 2022 15:24
Copy link
Contributor

@Mayons95 Mayons95 left a comment

Choose a reason for hiding this comment

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

LGTM

@chantal-kelm chantal-kelm self-requested a review November 7, 2022 18:15
@Tostti Tostti merged commit 72ba21a into 4.3-7.10 Nov 7, 2022
@Tostti Tostti deleted the fix/wazuh-plugin-logout-button-path-4.3 branch November 7, 2022 19:29
github-actions bot pushed a commit that referenced this pull request Nov 7, 2022
* change function to get the path programatically

* update changelog

(cherry picked from commit 72ba21a)
github-actions bot pushed a commit that referenced this pull request Nov 7, 2022
* change function to get the path programatically

* update changelog

(cherry picked from commit 72ba21a)
asteriscos pushed a commit that referenced this pull request Nov 8, 2022
…4820)

change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

(cherry picked from commit 72ba21a)

Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
asteriscos pushed a commit that referenced this pull request Nov 8, 2022
#4821)

change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

(cherry picked from commit 72ba21a)

Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
@AlexRuiz7 AlexRuiz7 changed the title change function to get the path programatically Change function to get the path programmatically Nov 9, 2022
@AlexRuiz7 AlexRuiz7 changed the title Change function to get the path programmatically Fix logout from Wazuh when SAML is enabled (4.3) Nov 9, 2022
@chantal-kelm
Copy link
Member

Opensearch with SAML

saml.mp4

AlexRuiz7 added a commit that referenced this pull request Nov 17, 2022
* [Backport 4.3-7.10] Create pull_request_template.md (#4591)

Create pull_request_template.md (#4583)

(cherry picked from commit aac7f22)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>

* Bump 4.3.9 (#4655)

* bump: Version v4.3.9-7.10.2

* bump: Version v4.3.9-7.10.2

* change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

* Add support for Wazuh 4.3.10 - 7.10.2 (#4839)

Bump 4.3.10

* Fixed 4.3.10 changelog (#4845)

Fixed changelog

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
github-actions bot pushed a commit that referenced this pull request Nov 17, 2022
* [Backport 4.3-7.10] Create pull_request_template.md (#4591)

Create pull_request_template.md (#4583)

(cherry picked from commit aac7f22)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>

* Bump 4.3.9 (#4655)

* bump: Version v4.3.9-7.10.2

* bump: Version v4.3.9-7.10.2

* change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

* Add support for Wazuh 4.3.10 - 7.10.2 (#4839)

Bump 4.3.10

* Fixed 4.3.10 changelog (#4845)

Fixed changelog

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
(cherry picked from commit d0c9e91)
AlexRuiz7 added a commit that referenced this pull request Nov 17, 2022
Post-release v4.3.10 (#4879)

* [Backport 4.3-7.10] Create pull_request_template.md (#4591)

Create pull_request_template.md (#4583)

(cherry picked from commit aac7f22)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>

* Bump 4.3.9 (#4655)

* bump: Version v4.3.9-7.10.2

* bump: Version v4.3.9-7.10.2

* change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

* Add support for Wazuh 4.3.10 - 7.10.2 (#4839)

Bump 4.3.10

* Fixed 4.3.10 changelog (#4845)

Fixed changelog

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
(cherry picked from commit d0c9e91)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
AlexRuiz7 added a commit that referenced this pull request Nov 17, 2022
* [Backport 4.3-7.10] Create pull_request_template.md (#4591)

Create pull_request_template.md (#4583)

(cherry picked from commit aac7f22)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>

* Bump 4.3.9 (#4655)

* bump: Version v4.3.9-7.10.2

* bump: Version v4.3.9-7.10.2

* change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

* Add support for Wazuh 4.3.10 - 7.10.2 (#4839)

Bump 4.3.10

* Fixed 4.3.10 changelog (#4845)

Fixed changelog

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
(cherry picked from commit d0c9e91)
AlexRuiz7 added a commit that referenced this pull request Nov 17, 2022
* [Backport 4.3-7.10] Create pull_request_template.md (#4591)

Create pull_request_template.md (#4583)

(cherry picked from commit aac7f22)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>

* Bump 4.3.9 (#4655)

* bump: Version v4.3.9-7.10.2

* bump: Version v4.3.9-7.10.2

* change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

* Add support for Wazuh 4.3.10 - 7.10.2 (#4839)

Bump 4.3.10

* Fixed 4.3.10 changelog (#4845)

Fixed changelog

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
(cherry picked from commit d0c9e91)
AlexRuiz7 added a commit that referenced this pull request Nov 17, 2022
* [Backport 4.3-7.10] Create pull_request_template.md (#4591)

Create pull_request_template.md (#4583)

(cherry picked from commit aac7f22)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>

* Bump 4.3.9 (#4655)

* bump: Version v4.3.9-7.10.2

* bump: Version v4.3.9-7.10.2

* change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

* Add support for Wazuh 4.3.10 - 7.10.2 (#4839)

Bump 4.3.10

* Fixed 4.3.10 changelog (#4845)

Fixed changelog

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
(cherry picked from commit d0c9e91)
chantal-kelm pushed a commit that referenced this pull request Nov 17, 2022
Post-release v4.3.10 (#4879)

* [Backport 4.3-7.10] Create pull_request_template.md (#4591)

Create pull_request_template.md (#4583)

(cherry picked from commit aac7f22)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>

* Bump 4.3.9 (#4655)

* bump: Version v4.3.9-7.10.2

* bump: Version v4.3.9-7.10.2

* change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

* Add support for Wazuh 4.3.10 - 7.10.2 (#4839)

Bump 4.3.10

* Fixed 4.3.10 changelog (#4845)

Fixed changelog

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
(cherry picked from commit d0c9e91)
AlexRuiz7 added a commit that referenced this pull request Nov 17, 2022
Post-release v4.3.10 (#4879)

* [Backport 4.3-7.10] Create pull_request_template.md (#4591)

Create pull_request_template.md (#4583)

(cherry picked from commit aac7f22)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>

* Bump 4.3.9 (#4655)

* bump: Version v4.3.9-7.10.2

* bump: Version v4.3.9-7.10.2

* change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

* Add support for Wazuh 4.3.10 - 7.10.2 (#4839)

Bump 4.3.10

* Fixed 4.3.10 changelog (#4845)

Fixed changelog

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
(cherry picked from commit d0c9e91)
AlexRuiz7 added a commit that referenced this pull request Nov 17, 2022
Post-release v4.3.10 (#4879)

* [Backport 4.3-7.10] Create pull_request_template.md (#4591)

Create pull_request_template.md (#4583)

(cherry picked from commit aac7f22)

Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>

* Bump 4.3.9 (#4655)

* bump: Version v4.3.9-7.10.2

* bump: Version v4.3.9-7.10.2

* change function to get the path programatically (#4815)

* change function to get the path programatically

* update changelog

* Add support for Wazuh 4.3.10 - 7.10.2 (#4839)

Bump 4.3.10

* Fixed 4.3.10 changelog (#4845)

Fixed changelog

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
(cherry picked from commit d0c9e91)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SAML logout error "not found"
3 participants