When modifying the /var/ossec/etc/ossec.conf file of each Wazuh Server to disable the generation of LOG alerts and archives files (by configuring the options <alerts_log>no</alerts_log> and <logall>no</logall>) and enabling the generation of JSON alerts and archives files (by configuring <logall_json>yes</logall_json> and <jsonout_output>yes</jsonout_output>), the settings for <logall_json> changes from yes to no after restarting the containers; although no other configuration file that could possibly override this setting has been found.
File content before containers restart:
<ossec_config>
<global>
<jsonout_output>yes</jsonout_output>
<alerts_log>no</alerts_log>
<logall>no</logall>
<logall_json>yes</logall_json>
(...)
</global>
File content after container restart:
<ossec_config>
<global>
<jsonout_output>yes</jsonout_output>
<alerts_log>no</alerts_log>
<logall>no</logall>
<logall_json>no</logall_json>
(...)
</global>
However, if we enable to generation of LOG alerts and archives files (by configuring <logall>yes</logall>), enabling the generation of JSON alerts and archives is well taken into account after restarting the containers.
File content before and after container restart:
<ossec_config>
<global>
<jsonout_output>yes</jsonout_output>
<alerts_log>no</alerts_log>
<logall>yes</logall>
<logall_json>yes</logall_json>
(...)
</global>
Somehow, it looks like it doesn't accept the config line <logall_json>yes</logall_json> along with <logall>no</logall>. Do you have an idea why?
Thanks you very much in advance,
Hi,
First, I would like to clarify that the <logall_json> and <logall> options are independent. There is no dependency between them.
If you configure only <logall_json>yes</logall_json>, it will work independently. The same applies to <logall>. You can refer to the Wazuh global configuration documentation for more details.
Regarding the Docker setup, if you directly modify /var/ossec/etc/ossec.conf inside the Wazuh manager container, the changes will not remain after a restart. The file is generated from the configuration mounted from the host, so your changes will be overwritten whenever the container restarts.
You need to update the configuration files on the host instead.
For the manager node, update:
wazuh-docker/multi-node/config/wazuh_cluster/wazuh_manager.confFor the worker node, update:
wazuh-docker/multi-node/config/wazuh_cluster/wazuh_worker.confAfter updating both files, restart only the Wazuh server containers:
cd /root/wazuh-docker/multi-nodeThen verify the configuration inside the manager container:
docker exec wazuh.master grep -E \Also verify it on the worker container:
docker exec wazuh.worker grep -E \Please do not permanently edit /var/ossec/etc/ossec.conf inside the container. Always make the changes in wazuh_manager.conf and wazuh_worker.conf on the host.
