Closed bharvie closed 5 years ago
Hi @bharvie,
The default configuration has the option (I can see that you did not edit it) config.drop_privileges = true;
. It means that the API is executed trough ossec
user and execution permissions to this user are required for using the API properly. The Python libraries are created in the compilation with 700
permisions due to your umask
. You should set config.drop_privileges
to false
if you don't want to edit permissions for the Python libraries.
Anyway, in order to avoid problems like this, I recommend you install Wazuh (and API) from packages (https://documentation.wazuh.com/3.10/installation-guide/installing-wazuh-manager/linux/ubuntu/wazuh_server_packages_ubuntu.html#wazuh-server-packages-ubuntu).
Best regards,
Demetrio.
Hi there,
I was pulling my hair out last night following an upgrade to 3.10 on two managers - which i eventually solved but thought i should share what happened/how i fixed it to save anyone else from balding. My scenario as follows:
Environment:
Following upgrade:
Error log
Note that i was to do the following without errors:
All other queries failed with Exit code: 1.
As the root user i was able to get API responses without failure manually by utilizing:
Solution After hours of digging around i discovered from another bug report that exit code: 1 was typically a Python issue - i was scratching my head about this because i was getting valid responses when manually executing the wazuh-api.py script -> led me to thinking that it must be related to the user running the wazuh-api service wasn't able to access libraries.... and viola:
The fix:
For reference purposes:
config.js
nginx config
* Note that originally i had compiled/built Wazuh on Ubuntu 16.04 -- not sure if this is relevant to the issue but providing more information than less.