Closed juliancnn closed 4 months ago
Hi @juliancnn,
Regarding the issue raised, there are two important points to consider:
reinstall
operation. To reinstall, users must follow the installation guide to uninstall and then perform a clean install, which will provide the correct configuration file.Given this, the issue highlights the need to implement a reinstall
operation, categorizing it as a medium-impact bug or a feature request.
Best regards,
Overview
A critical issue has been identified in the RPM upgrade process for both Wazuh Agent and Manager. This bug occurs when the
ossec.conf
configuration file is deleted before an upgrade or a reinstallation using RPM packages. Instead of regenerating a validossec.conf
file, the system incorrectly inserts an incomplete and sometimes invalid configuration. This issue prevents the Wazuh Agent and Manager from starting, leading to significant operational disruptions.Affected Versions
Issue Description
During an RPM package upgrade or reinstallation where the
ossec.conf
file has been manually removed, the newly generated configuration file lacks several critical default settings. Most notably, the file includes an improperly placed logging block which is either misplaced or incorrectly formatted, resulting in configuration syntax errors that prevent startup.Specific Misconfiguration Example
The auto-generated
ossec.conf
incorrectly includes the following block outside the proper XML structure, causing syntax errors:For the manager installation, while the configuration does not contain the improper logging block and thus remains syntactically valid, it still fails to include necessary
localfile
definitions, leading to incomplete functionality.Steps to Reproduce
Initial Setup:
yum install wazuh-agent
Remove Configuration:
ossec.conf
file:rm /var/ossec/etc/ossec.conf
Trigger the Bug:
yum reinstall wazuh-agent
ossec.conf
file and attempt to start the service.Expected Behavior
After reinstalling or upgrading the Wazuh component, a new, valid
ossec.conf
should be automatically generated with all necessary default configurations intact, allowing the agent or manager to start and function properly.Actual Behavior
The agent or manager fails to start due to syntactical errors in the regenerated
ossec.conf
file. Additionally, necessary default configurations, such aslocalfile
entries, are missing, crippling the functionality.Impact
Proposed Steps for Investigation and Fix
ossec.conf
is generated during the RPM package installation and upgrade processes.ossec.conf
.