wazuh / wazuh-packages

Wazuh - Tools for packages creation
https://wazuh.com
GNU General Public License v2.0
97 stars 89 forks source link

Different set of permission for plugins in Release 4.8.0 #2942

Closed TheMuntu closed 1 month ago

TheMuntu commented 1 month ago
Wazuh version Install type Action performed Platform
Release 4.8.0 Manager Install Oracle Linux 8 x86_64

Issue description

During the Release 4.8.0 - RC 1 - E2E UX tests - Wazuh Dashboard test, we discovered that the wazuhCheckUpdates and wazuhCore plugins have different permissions compared to others in the /usr/share/wazuh-dashboard/plugins/ directory.

image

Please review this issue and make the necessary corrections.

Thank you.

cc: @rauldpm

rauldpm commented 1 month ago

Thanks @TheMuntu

@mhamra, please check the RPM spec file https://github.com/wazuh/wazuh-packages/blob/4.8.0/stack/dashboard/rpm/wazuh-dashboard.spec#L105-L109 as it appears that only the wazuh plugin is changing its permissions, we need to apply those lines to the other two plugins too

Build the package locally, install it into a VM, and make sure that they have the correct permissions, also compare the Debian Wazuh dashboard, both should have the same permissions

mhamra commented 1 month ago

UPDATE

RPM

I've generated the dashboard RPM package using the branch 4.8.0 script stack/dashboard/rpm/build_package.sh.

I've installed the package in a centos:7 container and reproduced the reported issue:

[root@ab66325f3384 /]# ls -l /usr/share/wazuh-dashboard/plugins/
total 40
drwxr-x--- 6 wazuh-dashboard wazuh-dashboard 4096 May  7 17:01 alertingDashboards
drwxr-x--- 8 wazuh-dashboard wazuh-dashboard 4096 May  7 17:01 customImportMapDashboards
drwxr-x--- 6 wazuh-dashboard wazuh-dashboard 4096 May  7 17:01 ganttChartDashboards
drwxr-x--- 8 wazuh-dashboard wazuh-dashboard 4096 May  7 17:01 indexManagementDashboards
drwxr-x--- 9 wazuh-dashboard wazuh-dashboard 4096 May  7 17:01 notificationsDashboards
drwxr-x--- 8 wazuh-dashboard wazuh-dashboard 4096 May  7 17:01 reportsDashboards
drwxr-x--- 7 wazuh-dashboard wazuh-dashboard 4096 May  7 17:01 securityDashboards
drwxr-x--- 7 wazuh-dashboard wazuh-dashboard 4096 May  7 17:01 wazuh
drwxr-xr-x 7 wazuh-dashboard wazuh-dashboard 4096 May  7 17:01 wazuhCheckUpdates
drwxr-xr-x 7 wazuh-dashboard wazuh-dashboard 4096 May  7 17:01 wazuhCore

After modifying the rpm specs, I've reinstalled the package in a new centos:7container. These are the results:

[root@fcc1166bab16 /]# ls -l /usr/share/wazuh-dashboard/plugins/
total 40
drwxr-x--- 6 wazuh-dashboard wazuh-dashboard 4096 May  7 17:44 alertingDashboards
drwxr-x--- 8 wazuh-dashboard wazuh-dashboard 4096 May  7 17:44 customImportMapDashboards
drwxr-x--- 6 wazuh-dashboard wazuh-dashboard 4096 May  7 17:44 ganttChartDashboards
drwxr-x--- 8 wazuh-dashboard wazuh-dashboard 4096 May  7 17:44 indexManagementDashboards
drwxr-x--- 9 wazuh-dashboard wazuh-dashboard 4096 May  7 17:44 notificationsDashboards
drwxr-x--- 8 wazuh-dashboard wazuh-dashboard 4096 May  7 17:44 reportsDashboards
drwxr-x--- 7 wazuh-dashboard wazuh-dashboard 4096 May  7 17:44 securityDashboards
drwxr-x--- 7 wazuh-dashboard wazuh-dashboard 4096 May  7 17:44 wazuh
drwxr-x--- 7 wazuh-dashboard wazuh-dashboard 4096 May  7 17:44 wazuhCheckUpdates
drwxr-x--- 7 wazuh-dashboard wazuh-dashboard 4096 May  7 17:44 wazuhCore
[root@fcc1166bab16 /]# ls -l /usr/share/wazuh-dashboard/plugins/wazuh
total 204
drwxr-x---   6 wazuh-dashboard wazuh-dashboard   4096 May  7 17:44 common
drwxr-x--- 173 wazuh-dashboard wazuh-dashboard   4096 May  7 17:44 node_modules
-rw-r-----   1 wazuh-dashboard wazuh-dashboard    599 May  7 17:40 opensearch_dashboards.json
-rw-r-----   1 wazuh-dashboard wazuh-dashboard   3242 May  7 17:40 package.json
drwxr-x---   3 wazuh-dashboard wazuh-dashboard   4096 May  7 17:44 public
drwxr-x---   7 wazuh-dashboard wazuh-dashboard   4096 May  7 17:44 server
drwxr-x---   3 wazuh-dashboard wazuh-dashboard   4096 May  7 17:44 target
-rw-r-----   1 wazuh-dashboard wazuh-dashboard 176652 May  7 17:40 yarn.lock
[root@fcc1166bab16 /]# ls -l /usr/share/wazuh-dashboard/plugins/wazuhCore/
total 48
drwxr-x---  4 wazuh-dashboard wazuh-dashboard  4096 May  7 17:44 common
drwxr-x--- 53 wazuh-dashboard wazuh-dashboard  4096 May  7 17:44 node_modules
-rw-r-----  1 wazuh-dashboard wazuh-dashboard   254 May  7 17:40 opensearch_dashboards.json
-rw-r-----  1 wazuh-dashboard wazuh-dashboard  1039 May  7 17:40 package.json
drwxr-x---  4 wazuh-dashboard wazuh-dashboard  4096 May  7 17:44 server
drwxr-x---  3 wazuh-dashboard wazuh-dashboard  4096 May  7 17:44 target
drwxr-x---  2 wazuh-dashboard wazuh-dashboard  4096 May  7 17:44 translations
-rw-r-----  1 wazuh-dashboard wazuh-dashboard   304 May  7 17:40 tsconfig.json
-rw-r-----  1 wazuh-dashboard wazuh-dashboard 15837 May  7 17:40 yarn.lock
[root@fcc1166bab16 /]# ls -l /usr/share/wazuh-dashboard/plugins/wazuhCheckUpdates/
total 48
drwxr-x---  2 wazuh-dashboard wazuh-dashboard  4096 May  7 17:44 common
drwxr-x--- 48 wazuh-dashboard wazuh-dashboard  4096 May  7 17:44 node_modules
-rw-r-----  1 wazuh-dashboard wazuh-dashboard   312 May  7 17:40 opensearch_dashboards.json
-rw-r-----  1 wazuh-dashboard wazuh-dashboard  1037 May  7 17:40 package.json
drwxr-x---  4 wazuh-dashboard wazuh-dashboard  4096 May  7 17:44 server
drwxr-x---  3 wazuh-dashboard wazuh-dashboard  4096 May  7 17:44 target
drwxr-x---  2 wazuh-dashboard wazuh-dashboard  4096 May  7 17:44 translations
-rw-r-----  1 wazuh-dashboard wazuh-dashboard   304 May  7 17:40 tsconfig.json
-rw-r-----  1 wazuh-dashboard wazuh-dashboard 14720 May  7 17:40 yarn.lock

RPM

I've generated and installed the DEB package in an Ubuntu 22.04 container. The issue is not present in this OS. This is the result:

root@b886de28928c:/# ls -l /usr/share/wazuh-dashboard/plugins/
total 40
drwxr-x--- 6 wazuh-dashboard wazuh-dashboard 4096 May  7 20:13 alertingDashboards
drwxr-x--- 8 wazuh-dashboard wazuh-dashboard 4096 May  7 20:13 customImportMapDashboards
drwxr-x--- 6 wazuh-dashboard wazuh-dashboard 4096 May  7 20:13 ganttChartDashboards
drwxr-x--- 8 wazuh-dashboard wazuh-dashboard 4096 May  7 20:13 indexManagementDashboards
drwxr-x--- 9 wazuh-dashboard wazuh-dashboard 4096 May  7 20:13 notificationsDashboards
drwxr-x--- 8 wazuh-dashboard wazuh-dashboard 4096 May  7 20:13 reportsDashboards
drwxr-x--- 7 wazuh-dashboard wazuh-dashboard 4096 May  7 20:13 securityDashboards
drwxr-x--- 7 wazuh-dashboard wazuh-dashboard 4096 May  7 20:13 wazuh
drwxr-x--- 7 wazuh-dashboard wazuh-dashboard 4096 May  7 20:13 wazuhCheckUpdates
drwxr-x--- 7 wazuh-dashboard wazuh-dashboard 4096 May  7 20:13 wazuhCore
rauldpm commented 1 month ago

LGTM