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

Module settings are not persistent between updates #4179

Closed
Tracked by #4391
jesuslinares opened this issue May 31, 2022 · 2 comments · Fixed by #4359, #4384 or #4385
Closed
Tracked by #4391

Module settings are not persistent between updates #4179

jesuslinares opened this issue May 31, 2022 · 2 comments · Fixed by #4359, #4384 or #4385
Assignees
Labels
component/modules Issues related to the App modules, and its handling type/bug Bug issue

Comments

@jesuslinares
Copy link
Contributor

The Wazuh WUI allows configuring your modules:
image

This configuration is saved in a file:
New installation:

cat /usr/share/kibana/data/wazuh/config/wazuh-registry.json
{"name":"Wazuh App","app-version":"4.2.7","revision":"4209-1","installationDate":"2022-05-31T12:10:50.999Z","lastRestart":"2022-05-31T12:10:50.999Z","hosts":{}} 

After login:

cat /usr/share/kibana/data/wazuh/config/wazuh-registry.json
{"name":"Wazuh App","app-version":"4.2.7","revision":"4209-1","installationDate":"2022-05-31T11:13:00.479Z","lastRestart":"2022-05-31T11:13:00.479Z","hosts":{"1":{"cluster_info":{"status":"enabled","manager":"wazuh-manager-master-0","node":"wazuh-manager-master-0","cluster":"w7t5o2zptnbu"},"extensions":{"audit":true,"pci":true,"gdpr":true,"hipaa":true,"nist":true,"tsc":true,"oscap":false,"ciscat":false,"aws":false,"gcp":false,"virustotal":false,"osquery":false,"docker":false}}}}

If I configure my modules (so, the settings are saved in the wazuh-registry.json file) and update Kibana, the configuration is lost.

@jesuslinares jesuslinares added the type/bug Bug issue label May 31, 2022
@jesuslinares jesuslinares moved this to Triage in Release 4.3.7 Jul 7, 2022
@AlexRuiz7 AlexRuiz7 added the component/modules Issues related to the App modules, and its handling label Jul 7, 2022
@davidjiglesias davidjiglesias moved this from Triage to Todo in Release 4.3.7 Jul 22, 2022
@Desvelao Desvelao self-assigned this Jul 22, 2022
@AlexRuiz7 AlexRuiz7 moved this from Todo to In Progress in Release 4.3.7 Jul 25, 2022
@Desvelao
Copy link
Member

Desvelao commented Jul 25, 2022

Research

I got to replicate the problem and this could be related to upgrading (changing) the Wazuh plugin.

When the Wazuh plugin starts, there is a task to check the wazuh-registry.json file exists. If this exists, it checks the values for the Wazuh plugin version and the revision matches with the current Wazuh plugin installed. If not, then the wazuh-registry.json file is rebuilt, without taking into account the module visibility configuration for the existent hosts.

Quick fix

When rebuilding the wazuh-registry.json file due to changing the Wazuh plugin, the hosts key should use the value in the current wazuh-registry.json file instead of an empty object definition. This approach fixes the problem, but it creates another when these extensions change, for example, a new Wazuh plugin version added a new extension. This extension won't have any value in the wazuh-registry.json file and the UI could fail or don't behave as expected.

Best solution

Migrate the host extensions to match with the supported or expected extensions in the installed Wazuh plugin.

@Desvelao Desvelao linked a pull request Jul 26, 2022 that will close this issue
@Desvelao
Copy link
Member

Solved in #4359.

@Desvelao Desvelao moved this from In Progress to In review in Release 4.3.7 Jul 26, 2022
@Desvelao Desvelao closed this as completed Aug 5, 2022
Repository owner moved this from In review to Done in Release 4.3.7 Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/modules Issues related to the App modules, and its handling type/bug Bug issue
Projects
No open projects
Status: Done
3 participants