-
Notifications
You must be signed in to change notification settings - Fork 185
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
Replace the management of plugins configuration #6337
Replace the management of plugins configuration #6337
Conversation
- Enhance the logging messages - Minor enhancements
- Replace the logging services - Move services to core plugin - CacheAPIUserAllowRunAs - ManageHosts - ServerAPIClient (aka api-interceptor) - ServerAPIHostEntries (aka ) - UpdateConfigurationFile - UpdateRegistry - Adapt the usage of services in the main and check updates plugin from core plugin - Remove plugin logger from main and core plugins - Remove API endpoint - GET /utils/logs/ui - Remove unused code - Adapt the test suites
…to enhancement/6137-adapt-logging-method
…to enhancement/6137-adapt-logging-method
- Remove GET /utils/logs endpoint - Remove related tests - Remove App logs application
- Create Configuration service - Create ConfigurationStore (backend and frontend side) - Register the plugin settings in the configuration services
…ration service - API endpoints: - GET /utils/configuration - PUT /utils/configuration - PUT /utils/configuration/files/{key} - DELETE /utils/configuration/files/{key}
…iguration - Create new API endpoint to import a configuration file - POST /utils/configuration/import - Create method to enhance the configuration of the backend side to manage the importation - Remove duplicated code to check if updating some settings requires to do some actions to apply
…o enhancement/6201-replace-plugins-configuration
… run the health check
…to wazuh-dashboard-plugins-config
…tor related to administrator user
…o enhancement/6201-replace-plugins-configuration
|
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: ✅
Test: ✅ fixed the problems I had found when adding and editing apis
Details 🟢 With no API hosts added, go to Server APIs application and should display an empty table.Chrome - 🟢 Firefox - ⚫ Safari - ⚫ 🟢 With an administrator user, go to Server APIs, click on Add API host and fill the form with a valid API host. The API host should be added and the table should be udpated.Chrome - 🟢 Firefox - ⚫ Safari - ⚫ 🟢 With an administrator user and API hosts added, go to Server APIs, and edit some of them. Try editing some field or multiple fields. The API host entry should be updated and the new values should be displayed in the table.Chrome - 🟢 Firefox - ⚫ Safari - ⚫ 🟢 With an administrator user and API hosts added, go to Server APIs, and remove some of them. The API host entries should be updated.Chrome - 🟢 Firefox - ⚫ Safari - ⚫ 🟢 With API hosts entries added, ensure the host key in the saved object of the configuration is encrypted.Chrome - 🟢 Firefox - ⚫ Safari - ⚫ 🟢 With a stopped API entry, go to Server APIs application and should display a callout about the problem.Chrome - 🟢 Firefox - ⚫ Safari - ⚫ 🟢 Without a stored object of configuration, upload a file through the POST /utils/configuration/import. The configuration should be updated into the saved object.Chrome - 🟢 Firefox - ⚫ Safari - ⚫ 🟢 With a stored object of configuration, upload a file through the POST /utils/configuration/import. The configuration should be updated into the saved object and ensure the previous configuration is not present.Chrome - 🟢 Firefox - ⚫ Safari - ⚫ 🟢 With a non administrator user, go to App Settings, a prompt should display the user has no permissionsChrome - 🟢 Firefox - ⚫ Safari - ⚫ |
Description
This pull request replaces the management of configuration by the plugins.
Changes:
Configuration
(common)ConfigurationStore
(frontend and backend side)App Settings
applicationReportPrinter
service to create the PDF reports, now uses the new Configuration servicestore
in the plugin settingManageHosts
service:useForm
hook to allow dynamic inputsarrayOf
Server APIs
applicationServer APIs
applicationServer APIs
application now displays a message when there are not configured APIsPOST /utils/configuration/clear
: clear the configuration stored in the saved objectPOST /utils/configuration/import
: import the configuration from a configuration filePUT /hosts/apis/{id}
: add or update an existing API host entryDELETE /hosts/apis/{id}
: remove an existing API host entryPUT /utils/configuration
PUT /utils/configuration/files/{key}
DELETE /utils/configuration/files/{key}
- Remove render through AngularJS template
- Remove properties defined in controller
- Add a new callout to render in Server APIs
- Include a button that opens a flyout with a basic troubleshooting
GET /utils/account
: gives information about if the user is an user considered as "administrator" for the plugins.Issues Resolved
#6201
Evidence
Generic view
Add API entry
Edit and remove buttons
Warning about API could be down:
Test
configuration-saved-object
Legend:
⚫: none
🟢: pass
🟡: warning
🔴: fail
⚪: not applicable
UI
Details
⚫ With no API hosts added, go to Server APIs application and should display an empty table.
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ With an administrator user, go to Server APIs, click on Add API host and fill the form with a valid API host. The API host should be added and the table should be udpated.
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ With an administrator user and API hosts added, go to Server APIs, and edit some of them. Try editing some field or multiple fields. The API host entry should be updated and the new values should be displayed in the table.
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ With an administrator user and API hosts added, go to Server APIs, and remove some of them. The API host entries should be updated.
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ With API hosts entries added, ensure the host key in the saved object of the configuration is encrypted.
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ With a stopped API entry, go to Server APIs application and should display a callout about the problem.
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ Without a stored object of configuration, upload a file through the POST /utils/configuration/import. The configuration should be updated into the saved object.
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ With a stored object of configuration, upload a file through the POST /utils/configuration/import. The configuration should be updated into the saved object and ensure the previous configuration is not present.
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ With a non administrator user, go to App Settings, a prompt should display the user has no permissions
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
⚫ With a non administrator user, go to Server APIs, the Add API host, edit and remove button should be disabled displaying a message related to missing permissions.
Chrome - ⚫
Firefox - ⚫
Safari - ⚫
Other
Details
⚫ In configuration, change some settings and update the configuration. Ensure the data is stored in the saved object. Try to upload files too.
⚫ With a stored saved object of configuration, stop the Wazuh dashboard, change the platform setting wazuh_core.instance. Check the current settings are not using the values of the stored saved object configuration.
⚫ With a wazuh.yml configuration file located at data/wazuh/config/wazuh.yml and no stored saved object, should setup the configuration defined in the file into the saved object.
Check List
yarn test:jest