Dashboard hardening: session cookie missing Secure/SameSite and no HSTS header - #1522
Dashboard hardening: session cookie missing Secure/SameSite and no HSTS header#1522rodrigofez wants to merge 2 commits into
Conversation
The shipped configuration served the dashboard over TLS but set no SameSite attribute on the session cookie. Lax blocks the cross-site POST that the attribute is meant to stop, while keeping inbound links and SAML working; Strict would drop the cookie on a link from an email, a report or a ticket. The value also applies to the Wazuh server API cookies, which mirror it. Issue: #1520 Signed-off-by: Rodrigo Lopez <rodrigo.lopez@wazuh.com>
Issue: #1520 Signed-off-by: Rodrigo Lopez <rodrigo.lopez@wazuh.com>
|
Closed without merge. A SAML login test showed that a Test on the
The other corrections for the issue stay in wazuh/wazuh-dashboard-plugins#9041 and wazuh/wazuh-security-dashboards-plugin#718. |
Description
The default configuration serves the dashboard with TLS, but it did not set a
SameSitevalue for the session cookie. A browser thus sends the cookie with a request from a different web site.A security test of a 5.0 system found this problem.
Related issue: #1520
Proposed Changes
Add one line to
config/opensearch_dashboards.prod.yml:The value
Laxstops a cross-site POST request. Normal links continue to operate.The value
Strictis not used.Strictremoves the cookie when a user opens a link from an e-mail, a report or a ticket.Strictalso stops the SAML login.This value applies to the platform session cookie and to the Wazuh server API cookies. The Wazuh plugin reads the same setting.
The
Secureflag needs no line here. A related pull request calculates it from the server protocol.The pull request also changes five lines that are not related. The Prettier check of the repository refuses the file with the current quotation marks. The change is from
"to'only. The values do not change.Results and Evidence
Test on a development system with HTTPS and this value:
The login is complete and the session continues.
Artifacts Affected
The default configuration file
/etc/wazuh-dashboard/opensearch_dashboards.yml.Configuration Changes
One new line in the default configuration file. The package does not replace an existing file, thus an operator with an installed system must add the line manually. The upgrade instructions in the
wazuh-dashboard-pluginsrepository give this step.Documentation Updates
CHANGELOG.md— a new line in the "Fixed" section.The reference documents are in the
wazuh-dashboard-pluginsrepository. See the related pull request.Tests Introduced
None. This pull request changes only a configuration file.
Review Checklist