-
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
[1st iteration] Move API credentials to the config.yml file #1465
Comments
Note: this must be the first iteration, and we can't fully remove the legacy logic so for 3.10.0 the app will accept both mechanisms (soft deprecation so far). |
Update A new field has been added to the component to add APIs. This field will indicate the hostname, and if one is not specified, a random e.g type name will be generated: When the information is sent to the server for indexing in the |
Update The current API configuration view will disappear, so you will not be allowed to add or delete API entries from the app. To add them you will have to modify the file At this point, and since the APIs are now part of the configuration, I have decided to do the following. Proposal
This would be the applied configuration wazuh.hosts:
- default:
url: http://127.0.0.1
port: 55000
username: foo
password: bar
- other:
url: http://127.0.0.1
port: 55000
username: foo
password: bar Migration of index Currently the contents of the index Should configurations such as API Identifier The APIs in the index had a timestamp to identify them. The name assigned to that host entry will now be taken as the identifier. |
Update We have implemented the possibility of adding a host when there is still none added in the configuration, add it when it already exists and deletes it. All this to maintain the current functionality of the APIS table. For this, a regular expression search is carried out to match with the last entry of the YML array and append it to the new host or, if it doesn't exist, to create it. In the case of deletions, the regular expression is also used to delete the configuration file entry. The regular expression consists of the name of the entry and as many lines are added as the host object has. The regular expression with an object of 4 fields would look like this
|
Update Today I have finished doing the complete CRUD to leave the API management from the app identical to how it was done on the Now we have to approach the scenarios where the index was already created, where we will have to make a migration, from the index to the file and then delete the index. |
Update Today I've been doing some testing on the processes of checking host connections and application startup checks. On the other hand, I have been doing a cleaning of the methods that managed the old index Initialize.js wzWrapper elastic-wrapper getConfiguration Module |
Update 26.7.19 The check manager function worked properly until a new API was added from front-end. The problem was that when a new API was added the config.yml file was re-build and the function which composes the APIs entries was setting username instead of user key for the username value, this was provoking that when trying to access to the key user an undefined value was returned.dc72e68 If a new API was added and try to set as default the API was set as default properly but the star icon was not filled because when the API id was compared in the react component we were using When adding a new API the cluster and manager information of the previous APIs was lost, that's why the way to get this information currently is checking the API. The problem was that the When adding a new API the binding between AngularJs and ReactJs fails sometimes, to fix it instead of assigning the new API entry to an array in the controller and after that to the react component props we assign now directly to the props in order to fix it. b7a2dbc After adding the When editing an API entry the id was not used to compose the host, then the existing entry was removed and created a new one, this provokes that the id changes and the check connection fails, now the id is used and the updated is successful. b675bac |
Update 29.07.19 In the Code that fails:
To solve this I split this procedure into several functions and the last function is recursive and checks if there are still APIs to save and if the previous API was saved properly in order to prevent this fail: In the APIs migration process, there was not any method to check if all the entries were properly migrated, now before deleting the documents in the After migrating the APIs entries from the On settings load now is check if there is some API key duplicated in order to prevent file when editing, or removing some API 99563d9 |
Update 30.07.2019 In development mode, the Kibana server entry in a restarting loop because when the APP is initializing writes in the We found the way to ignore in developer mode the files what we want, that's why the
I created a new service called |
Update 31.07.19 I changed the ignored file Now the cluster information is saved and updated as it had done in the I've added several debug and error logs messages in the TODO
|
Update 01.08.19 The cluster information is now added to the When an API is added directly to the TODO
|
Update 02.08.19 Now while navigating through the app the extensions stored in the cookies and the hosts in the When accessing to the When inserting an API with an id of type string |
Update 19.08.19 I've merged the |
Hi team,
We need to improve the way we manage the Wazuh API entries. We should simplify it adding them to the config.yml file.
Proposal
Other related changes
The above change implies some other modifications such as:
.wazuh
index is no longer neededThe text was updated successfully, but these errors were encountered: