-
Notifications
You must be signed in to change notification settings - Fork 187
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
Move the plugin registry to stateless #6387
Comments
AnalysisDescriptionThe usage of the file is referenced here: #1465 (comment) The current look of this file: {
"name": "Wazuh dashboard",
"app-version": "4.9.0",
"revision": "00",
"installationDate": "2024-02-26T16:28:27.840Z",
"lastRestart": "2024-02-26T16:28:27.840Z",
"hosts": {
"imposter": {
"cluster_info": {
"manager": "wazuh-manager-master-0",
"node": "master-node",
"cluster": "wazuh",
"status": "enabled",
"allow_run_as": 2
}
}
}
} Stored data
UsageThe App metadata is used:
The The data related to the hosts is updated through the frontend or backend side (based on the current status of
For this case, the data is coming from the
Note that the monitoring job checks the status of the cluster using the API endpoint. When the cluster is enabled, then it retrieves the cluster name data that is set as the ServiceThe management of registry file
Unused methods that could be removed:
ConclusionThe current approach stores some data related to the plugin and cluster information about the API hosts. The app metadata could be removed because:
This leaves the data of the cluster information about the API host entries. Taking into account we want to remove the file The unused methods of the |
Changes
|
DesignWe will apply the following actions to the registry data:
The cluster info about the API hosts will be managed by the The cache stores information about the API host data: interface IAPIHostRegistry {
manager: string | null;
node: string | null;
status: string;
cluster: string;
allow_run_as: API_USER_STATUS_RUN_AS;
} When the plugin starts, the We will move the cache related to the This approach causes the The logic related to updating the cluster info in the registry and removing orphan entries in the registry is done by the frontend side, it is moved to the backend side. |
Changes
|
Description
As part of the issue that pretends to remove the stateful of the Wazuh dashboard plugins, we need to replace the way the data of the plugin's registry is stored so this doesn't use a file in the filesystem of the application.
Currently, this data is stored in the
wazuh-registry.json
file located at `/data/wazuh/config/wazuh-registry.json.The data related to the API hosts will be stored in an in-memory cache managed instead. Any action about the API host configuration should update the registry data of the host.
Tasks
ManageHosts
service that will store information about the registryUpdateRegistry
fileThe text was updated successfully, but these errors were encountered: