Skip to content

Commit

Permalink
Update check service UI (#6093)
Browse files Browse the repository at this point in the history
* Create plugin wazuh check updates (#5897)

* Add wazuh_check_updates plugin

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Manage saved object for plugin configurations

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* New componente UpToDateStatus and improvements

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Current update component and improvements

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* CurrentUpdateDetails improvements and others

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Improvements with unit tests

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Complete public unit tests

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Unit test updatesNotification component

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Backend unit tests

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Add current update details to currentUpdateDetails component

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Add translation to show details message

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Add DismissNotificationCheck component

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Modify styles

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Expose new component

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Update DismissNotificationCheck component

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Add getCurrentUser implementation

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Fix plugin start types

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Fix checks ids

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Delete console.log in component

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Fixes in PR

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Modify README

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Delete unused files

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Delete commented code

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Removing unnecessary packages

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Clear available updates value on error

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Change constant name

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Change message on new update

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Change camelCase to kebab-case

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Change plugin name using kebab-case

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Add useEffect to component UpToDateStatus

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Improve return errors in routes

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Show update description in lines

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Add Logger

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Improve constant name

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Improve check texts and links icons

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Fix if statements

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Change folder name in dev.yml using kebab-case

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Update test snapshots

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Add I18nProvider wrapper to components

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Unit test for routes and kebab case fixes

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Add toast when on get updates error

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Omit username property on GET user preferences

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Improve try catch finally

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Add mock html_id_generator to component unit tests

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Fix unit test get-user-preferences

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Fix route unit tests port by adding a random port

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Improved user preferences saved object

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Fix toast message

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Change port in route unit tests

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

---------

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>

* Enhancement/88 integrate plugin and update about page (#5939)

* Integrate plugin wazuh-check-updates

* Replace the Angular template for a React component

* Add wazuh-check-updates plugin to the manifest main plugin

* Add CurrentUpdateDetails component

* Improve About page and unit tests

* Add information to Change Log

* Make the About page accessible to any user

* Notify user when a new update is available (#5959)

* New React component WzUpdatesNotification

* Add unit test

* Get and show available updates for each api (#5984)

* Add APIs table version status

* Add available updates columns

* Add changes to show one mayor, one minor and one patch update per API

* Improve messages

* Improve notification

* Change camelCase for snake_case in API response

* Fix server unit tests

* Fix frontend unit tests

* Fix main plugin about page unit tests

* Apis table components unit tests

* Update CHANGELOG.md

* Update unit test snapshot

* Update CHANGELOG

* Fix get updates status

* Fix release notes url with current

* Improve toast id on Apis table

* ApisUpdateStatus: Show error callout only the first time

* Create new plugin wazuh core (#5985)

* Add wazuh-core plugin

* Add API Wazuh Core services

* Wazuh Core Plugin API service POC

* Remove files not used

* Integrate Wazuh Core plugin with Wazuh Check Updates plugin

* Delete imposter endpoint

* Add field 'update_check' to saved object mapping

* Delete comment

* Delete getUpdates at cron job start

---------

Co-authored-by: Luciano Gorza <lucianogorza@gmail.com>

* Check for updates when user logs in (#6001)

* Delete cron job

* Delete settings managment

* Remove 'Wazuh' word from UI

* Remove unnecesary constants

* Expose and consume security from Wazuh Core

* Fix unit test types

* Delete 'Wazuh' from title

* Set sessionStorage with checkUpdates

* Fix snapshot unit test

* Improve default messages and colors in update status column

* Move constant definition to inside the component

* Add check updates columns to APIs table and other fixes (#6058)

* Add check updates columns to APIs table and other fixes

* Update notification link to the API configuration page

* Fix link to API configuration page

* Update plataform version in package.json for all plugins

* Update test snapshots

---------

Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>

* Update WZ_HOME in README file

* Change href for onClick in bottom bar link

* Handle check updates endpoint error

* Make about page the same as angular template

* Update about page unit tests

* Delete unused componets from Wazuh Check Updates plugin

* Replace availableUpdates hook with getAvailableUpdates function

* Add unit tests for new components

* Fix typo

* Fix unit test html id generator

* Show error message in Updates status column

* Improve README file

* Improve table and columns layout

* Improve README file

* Fix Update status column

* Fix unit test

---------

Signed-off-by: Luciano Gorza <lucianogorza@gmail.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
  • Loading branch information
lucianogorza and asteriscos authored Nov 3, 2023
1 parent 0744482 commit 7b12b0d
Show file tree
Hide file tree
Showing 147 changed files with 23,994 additions and 2,478 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All notable changes to the Wazuh app project will be documented in this file.
### Added

- Support for Wazuh 4.8.0
- Added the ability to check if there are available updates from the UI. [#6093](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6093)
- Added remember server address check [#5791](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5791)
- Added the ssl_agent_ca configuration to the SSL Settings form [#6083](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6083)
- Added global vulnerabilities dashboards [#5896](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5896)
Expand Down
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ In general, the environment consist of:

```bash
# ./bashrc
export WZ_HOME=~/your/path/to/wazuh_kibana_app/plugins/main
export WZ_HOME=~/your/path/to/wazuh_kibana_app/plugins
```
Save and re-login or restart your terminal to apply the changes. Test that the variable has been set with:

Expand Down
41 changes: 41 additions & 0 deletions docker/imposter/manager/version/check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"data": {
"last_check_date": "2023-10-04T14:52:07.319561Z",
"current_version": "v4.8.0",
"update_check": true,
"last_available_major": {
"tag": "v5.0.0",
"description": "Highlights of release 5.0.0",
"title": "Wazuh 5.0.0",
"published_date": "2023-10-03T10:44:00Z",
"semver": {
"minor": 0,
"patch": 0,
"major": 5
}
},
"last_available_minor": {
"tag": "v4.9.1",
"description": "Highlights of release 4.9.1",
"title": "Wazuh 4.9.1",
"published_date": "2023-09-30T10:44:00Z",
"semver": {
"minor": 9,
"patch": 1,
"major": 4
}
},
"last_available_patch": {
"tag": "v4.8.3",
"description": "Highlights of release 4.8.3",
"title": "Wazuh 4.8.3",
"published_date": "2023-09-22T10:44:00Z",
"semver": {
"minor": 8,
"patch": 3,
"major": 4
}
}
},
"error": 0
}
7 changes: 7 additions & 0 deletions docker/imposter/wazuh-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,13 @@ resources:
statusCode: 200
scriptFile: manager/configuration.js

# Get available updates
- method: GET
path: /manager/version/check
response:
statusCode: 200
staticFile: manager/version/check.json

# ===================================================== #
# MITRE
# ===================================================== #
Expand Down
4 changes: 3 additions & 1 deletion docker/osd-dev/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ services:
entrypoint: ['tail', '-f', '/dev/null']
volumes:
- osd_cache:/home/node/.cache
- '${SRC}:/home/node/kbn/plugins/wazuh'
- '${SRC}/main:/home/node/kbn/plugins/wazuh'
- '${SRC}/wazuh-core:/home/node/kbn/plugins/wazuh-core'
- '${SRC}/wazuh-check-updates:/home/node/kbn/plugins/wazuh-check-updates'
- wd_certs:/home/node/kbn/certs/
- ${WAZUH_DASHBOARD_CONF}:/home/node/kbn/config/opensearch_dashboards.yml
- ./config/${OSD_MAJOR}/osd/wazuh.yml:/home/node/kbn/data/wazuh/config/wazuh.yml
Expand Down
Loading

0 comments on commit 7b12b0d

Please sign in to comment.