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.4) #4664

Merged
merged 2 commits into from
Oct 17, 2022

Conversation

Tostti
Copy link
Member

@Tostti Tostti commented Oct 11, 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 logout from the Wazuh plugin before the changes:
image

Trying to logout 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 Oct 11, 2022
@Tostti Tostti linked an issue Oct 11, 2022 that may be closed by this pull request
2 tasks
@Tostti Tostti changed the title Change logout function to get the path programatically Fix logout from Wazuh when SAML is enabled Oct 11, 2022
@Tostti Tostti marked this pull request as ready for review October 11, 2022 17:50
@Tostti Tostti requested a review from a team as a code owner October 11, 2022 17:50
@github-actions
Copy link
Contributor

Jest Test Coverage % values
Statements 7.18% ( 2608 / 36299 )
Branches 3.02% ( 846 / 27973 )
Functions 5.02% ( 444 / 8852 )
Lines 7.26% ( 2523 / 34747 )

Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

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

LGTM

@Desvelao Desvelao merged commit c320b31 into 4.4-7.10 Oct 17, 2022
@Desvelao Desvelao deleted the fix/wazuh-plugin-logout-button-path branch October 17, 2022 10:03
github-actions bot pushed a commit that referenced this pull request Oct 17, 2022
* change function to get the path programatically

* Update changelog

(cherry picked from commit c320b31)
github-actions bot pushed a commit that referenced this pull request Oct 17, 2022
* change function to get the path programatically

* Update changelog

(cherry picked from commit c320b31)
Desvelao pushed a commit that referenced this pull request Oct 17, 2022
Fix logout from Wazuh when SAML is enabled (#4664)

* change function to get the path programatically

* Update changelog

(cherry picked from commit c320b31)

Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
Desvelao pushed a commit that referenced this pull request Oct 17, 2022
)

Fix logout from Wazuh when SAML is enabled (#4664)

* change function to get the path programatically

* Update changelog

(cherry picked from commit c320b31)

Co-authored-by: Nico Guevara <42900763+Tostti@users.noreply.github.com>
@gdiazlo gdiazlo mentioned this pull request Oct 21, 2022
2 tasks
@gdiazlo gdiazlo linked an issue Oct 31, 2022 that may be closed by this pull request
1 task
@gdiazlo gdiazlo removed a link to an issue Oct 31, 2022
2 tasks
@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 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
@AlexRuiz7 AlexRuiz7 changed the title Fix logout from Wazuh when SAML is enabled Fix logout from Wazuh when SAML is enabled (4.4) Nov 9, 2022
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