Closed rauldpm closed 1 year ago
To reproduce the behavior of the described issue, I installed the wazuh-manager
package in CentOS 7 and CentOS 8 to find the error, but none of this test displayed the error specified above.
CentOS 7:
CentOS 8
I have found that this issue could be related to the vagrant Guest Addition configuration, reported in: https://github.com/Varying-Vagrant-Vagrants/VVV/issues/1781
This configuration changes the permissions of the /var/log/tallylog
and, when creating a user, the installation process displays the error. By default, the permissions for this file are:
[root@centos7 vagrant]# ls -l /var/log/tallylog
-rw-------. 1 root root 64000 Mar 10 15:27 /var/log/tallylog
And its content is the reported one:
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^
tallylog" [noeol] 1L, 64000C
I found this file only in a CentOS 7 system, in CentOS 8 this log file is not created or used.
In this system, the /var/log/tallylog
log file, by default, has read and write permissions for the owner (600), and with these permissions, the installation concludes without errors as I commented in the previous report:
:heavy_check_mark: With this, we can ensure that by default the installation is correct if the permissions of the log file are not modified.
:warning: But, after some testing, I have found that if the permissions of the log file contain write permissions for "others" or "public" (XX6), the installation displayed the reported error.
Tests changing the log file To ensure this behavior, I made a battery test of the installation of the package changing the permission of the log file:
This error is displayed by installing any of the version of the package. For example, installing the 4.4.0 version of the wazuh-manager
package, the error keeps displaying:
As a conclusion of this research, the generated error may be shown in systems that use the pam_tally
tool, and modify the permissions of the /var/log/tallylog
log file with XX6 permissions. Despite the error displayed, the creation of the user and group wazuh
is correctly done.
This seems to be a bug or rare behavior of the pam_tally
tool, and it does not concern the correct functionality of Wazuh.
Installing the Wazuh server package in CentOS 7 I have seen an error in the installation output, this has been reproduced in
4.3.2
and4.3.3
versions.Full output
``` [root@ip-172-31-23-186 centos]# yum -y install wazuh-manager Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: download.cf.centos.org * extras: download.cf.centos.org * updates: download.cf.centos.org Resolving Dependencies There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help). --> Running transaction check ---> Package wazuh-manager.x86_64 0:4.3.2-1 will be installed --> Finished Dependency Resolution Dependencies Resolved =================================================================================================================================================================================================================== Package Arch Version Repository Size =================================================================================================================================================================================================================== Installing: wazuh-manager x86_64 4.3.2-1 wazuh 114 M Transaction Summary =================================================================================================================================================================================================================== Install 1 Package Total size: 114 M Installed size: 435 M Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction pam_tally2: Error opening /var/log/tallylog for update: Permission denied pam_tally2: Authentication error useradd: failed to reset the tallylog entry of user "wazuh" Installing : wazuh-manager-4.3.2-1.x86_64 1/1 Verifying : wazuh-manager-4.3.2-1.x86_64 1/1 Installed: wazuh-manager.x86_64 0:4.3.2-1 Complete! [root@ip-172-31-23-186 centos]# ```It doesn't seem to affect the performance or usability of the package. The
wazuh
user and group are created.The
/var/log/tallylog
file shows the following content repeatedly:^@^@^@^@^@^@^@^@^@^@^@^@^
Resolution
Tests
The testing to find the error while installing the
wazuh-manager
package is in https://github.com/wazuh/wazuh-packages/issues/1601#issuecomment-1463624384.Research and conclusion
The research and conclusion of this issue is in https://github.com/wazuh/wazuh-packages/issues/1601#issuecomment-1465887527.