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

keystore directory is granting read/execution permissions to user group/others #2854

Closed
rauldpm opened this issue Feb 23, 2024 · 3 comments
Closed
Assignees
Labels
level/task Subtask issue type/bug Bug issue

Comments

@rauldpm
Copy link
Member

rauldpm commented Feb 23, 2024

Description

Reviewing the 4.8.0 Beta 2 changelog, the following pull request has been found: #2804, this pull request mentions RPM and DEB system in the pull request name, but the changes only modify the RPM package.

While reviewing and comparing the Wazuh manager RPM package, it has been found that it set different permissions than the DEB package in the /var/ossec/keystore/ directory

root@debian11:/home/vagrant# ls -ld /var/ossec/queue/keystore
drwxr-x--- 2 wazuh wazuh 4096 Feb  5 12:09 /var/ossec/queue/keystore
[root@centos7 vagrant]# ls -ld /var/ossec/queue/keystore/
drwxr-xr-x. 2 root root 195 Feb  5 12:09 /var/ossec/queue/keystore/

We should review those permissions and check if they are correct since a read permission is being granted to user group and execution permission is being granted to others, which could lead to a security risk.

@rauldpm rauldpm added level/task Subtask issue type/bug Bug issue labels Feb 23, 2024
@rauldpm rauldpm changed the title keystore directory is granting read/execution permissions to group/others keystore directory is granting read/execution permissions to user group/others Feb 23, 2024
@Dwordcito Dwordcito removed their assignment Feb 26, 2024
@tdrauncieal tdrauncieal self-assigned this Feb 27, 2024
@tdrauncieal
Copy link
Contributor

Hi @rauldpm
I'm asking about the procedure used in the test you mention, since I haven't been able to obtain the same results, here's a summary of what I tested using a centos7 Docker VM:

[root@05a3e797059b /]# ls -ld /var/ossec/queue/keystore/
drwxr-x--- 2 wazuh wazuh 4096 Feb 27 14:51 /var/ossec/queue/keystore/
[root@05a3e797059b /]# /var/ossec/bin/wazuh-keystore -f indexer -k username -v admin
[root@05a3e797059b /]# ls -l /var/ossec/queue/keystore/
total 144
-rw-r--r-- 1 root root  1307 Feb 26 22:16 000012.sst
-rw-r--r-- 1 root root     0 Feb 27 14:51 000015.log
-rw-r--r-- 1 root root  1307 Feb 27 14:51 000023.sst
-rw-r--r-- 1 root root    16 Feb 27 14:51 CURRENT
-rw-r--r-- 1 root root    36 Feb 26 22:16 IDENTITY
-rw-r--r-- 1 root root     0 Feb 26 22:16 LOCK
-rw-r--r-- 1 root root 54733 Feb 27 14:51 LOG
-rw-r--r-- 1 root root 44832 Feb 26 22:16 LOG.old.1709045504859047
-rw-r--r-- 1 root root   420 Feb 27 14:51 MANIFEST-000016
-rw-r--r-- 1 root root 11473 Feb 27 14:51 OPTIONS-000020
-rw-r--r-- 1 root root 11474 Feb 27 14:51 OPTIONS-000022
[root@05a3e797059b /]# ls -ld /var/ossec/queue/keystore/
drwxr-x--- 2 wazuh wazuh 4096 Feb 27 19:07 /var/ossec/queue/keystore/

You can also access the generated package to perform this test.
https://ci.wazuh.info/job/Packages_builder/188437/
https://packages-dev.wazuh.com/debug/yum/wazuh-manager-4.8.0-2854.1.x86_64.rpm

Is there a process that has been run after the installation?
What could be modifying the permissions of the aforementioned directory?

@ncvicchi
Copy link
Member

ncvicchi commented Feb 29, 2024

@rauldpm, we have not been able to reproduce the behavior described in this issue. If no further steps are provided to reproduce it, we will close this issue as "not planned".

@rauldpm
Copy link
Member Author

rauldpm commented Feb 29, 2024

@tdrauncieal No, I just installed the 4.8.0 Beta 2 package in a CentOS 7 Vagrant box (centos/7), is it possible for Wazuh to change the keystore directory permissions temporarily? I can't reproduce it now

@ncvicchi ncvicchi closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
level/task Subtask issue type/bug Bug issue
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants