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

[Remove discover] Implement embeddable dashboard on server management cluster module #6561

Conversation

jbiset
Copy link
Member

@jbiset jbiset commented Mar 27, 2024

Description

This pull request implement the embeddable dashboard on Server Management / Cluster and deprecate any use of kibana-integrations components.
Given the coupling that existed with the cluster controller, the migration was also made to not depend on the cluster controller, minimizing the dependence on Angular.
The timestamp field in SampleData was also fixed, since this caused the cluster timeline to have no data.

Warning

#6555 depends on this PR

Issues Resolved

Evidence

  • Each visualization, if applicable, must have interaction so that it sets the date range of the searchbar when clicked and visualizations should refresh when a date range is selected in the search bar.
Evidence1.webm
  • If there are no results, the corresponding message must appear that there are no results and the visualizations should not be rendered.

image

image

image

  • Check that the message "The cluster is disabled" appears when in the cluster is not enabled.
    NOTE: To test this it is necessary to change the cluster configuration in the imposter by setting the enabled option to no in the docker/imposter/cluster/cluster_status.json file and restart the imposter.

image

image

  • Check that the message "The cluster is not running" appears when in Manager mode

image

  • Check filter behavior with respect to hide alerts and allow agents.

image

image

  • Check the link to the list of agents on the Information card for both the name (Agents) and the value.
check-list-agents-link.webm
  • Check that the corresponding information is displayed when you click on "View Overview" and that you can go back from that view.
check-view-overview.webm
  • Check that when interacting with the Overview visualization (going to "View Overview") the corresponding filter is added.
check-view-overview-visualization.webm
  • Check that the list of nodes is shown when you click on both Nodes and the value and that you can go back from that view.
check-list-nodes-link.webm
  • Check that fixed filters cannot be deleted or have the onClick functionality

image

Test

Go to Server Management -> Cluster and check the following:

  • Each visualization, if applicable, must have interaction so that it sets the date range of the searchbar when clicked and visualizations should refresh when a date range is selected in the search bar.
  • If there are no results, the corresponding message must appear that there are no results and the visualizations should not be rendered.
  • Check that the message "The cluster is disabled" appears when in the cluster is not enabled.
    NOTE: To test this it is necessary to change the cluster configuration in the imposter by setting the enabled option to no in the docker/imposter/cluster/cluster_status.json file and restart the imposter.
  • Check that the message "The cluster is not running" appears when in Manager mode
  • Check filter behavior with respect to hide alerts and allow agents.
  • Check the link to the list of agents on the Information card for both the name (Agents) and the value.
  • Check that the corresponding information is displayed when you click on "View Overview" and that you can go back from that view.
  • Check that when interacting with the Overview visualization (going to "View Overview") the corresponding filter is added.
  • Check that the list of nodes is shown when you click on both Nodes and the value and that you can go back from that view.
  • Check that fixed filters cannot be deleted or have the onClick functionality

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@jbiset jbiset self-assigned this Mar 27, 2024
@jbiset jbiset marked this pull request as ready for review April 8, 2024 20:24
@JuanGarriuz JuanGarriuz self-requested a review April 9, 2024 08:38
@JuanGarriuz
Copy link
Member

JuanGarriuz commented Apr 9, 2024

Test

Go to Server Management -> Cluster and check the following:

  • Each visualization, if applicable, must have interaction so that it sets the date range of the searchbar when clicked and visualizations should refresh when a date range is selected in the search bar.

image

  • If there are no results, the corresponding message must appear that there are no results and the visualizations should not be rendered.

image

  • Check that the message "The cluster is disabled" appears when in the cluster is not enabled.
    NOTE: To test this it is necessary to change the cluster configuration in the imposter by setting the enabled option to no in the docker/imposter/cluster/cluster_status.json file and restart the imposter.

image

  • Check that the message "The cluster is not running" appears when in Manager mode

image

  • Check filter behavior with respect to hide alerts and allow agents.

image
image

  • Check the link to the list of agents on the Information card for both the name (Agents) and the value.

image
image

  • Check that the corresponding information is displayed when you click on "View Overview" and that you can go back from that view.

image
image

  • Check that when interacting with the Overview visualization (going to "View Overview") the corresponding filter is added.

image

  • Check that the list of nodes is shown when you click on both Nodes and the value and that you can go back from that view.

image
image

  • Check that fixed filters cannot be deleted or have the onClick functionality

image

JuanGarriuz
JuanGarriuz previously approved these changes Apr 9, 2024
Copy link
Member

@JuanGarriuz JuanGarriuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

…ashboard-on-server-management-cluster-module
@Desvelao
Copy link
Member

The render of hidden was changed to "boolean" from no/yes.

  • PR branch:
    image
  • 4.7.3:
    image

@Desvelao
Copy link
Member

Desvelao commented Apr 16, 2024

Is the render of the search bar in the tables of the cluster nodes intentional?
image

…ashboard-on-server-management-cluster-module
Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 45.37% ( 397 / 875 )
Branches 41.31% ( 157 / 380 )
Functions 43.83% ( 135 / 308 )
Lines 45.61% ( 395 / 866 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 10.83% ( 3750 / 34595 )
Branches 7.27% ( 1653 / 22716 )
Functions 10.51% ( 870 / 8271 )
Lines 10.99% ( 3644 / 33154 )

@jbiset
Copy link
Member Author

jbiset commented Apr 17, 2024

The render of hidden was changed to "boolean" from no/yes.

  • PR branch:
    image
  • 4.7.3:
    image

Resolved in 8a40b5a

@jbiset
Copy link
Member Author

jbiset commented Apr 17, 2024

Is the render of the search bar in the tables of the cluster nodes intentional? image

The searchbar should not appear on the nodes list screen. Resolved in 8a40b5a

Desvelao
Desvelao previously approved these changes Apr 22, 2024
Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@Desvelao Desvelao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@asteriscos asteriscos merged commit 0203478 into 4.9.0 Apr 22, 2024
1 check passed
@asteriscos asteriscos deleted the 6532-remove-discover-implement-embeddable-dashboard-on-server-management-cluster-module branch April 22, 2024 15:28
Machi3mfl pushed a commit that referenced this pull request Apr 25, 2024
… cluster module (#6561)

* Migrated Server Management Cluster to embeddables without cluster controller

* Fixed width of Cluster Configuration section

* Rendering conditions are adjusted and clean code

* Deleted controller and visualization monitoring files

* Integrated data-source implementation

* Fixed configuration_cards itemsList, the code is improved and unnecessary code is removed

* Added HOC withGuardAsync

* Changed the source of clusterEnabled information to that provided by the API

* Changed ClusterOverview component class to functional and fixed error on checkClusterIsEnabledAndRunning

* Added more dependencies in useEffect on Cluster Dashboard

* Added error handling to cluster-disabled component

* Fixed alert.timestamp field on SampleData
Tostti pushed a commit that referenced this pull request Apr 25, 2024
* Moved mitre intelligence to a subfolder

* fix imports

* moved mitre framework

* fix framework imports

* Changed dashboard

* updated snapshots

* Fixed typo

* Added pinned agent mode

* Changed mitre dashboard

* Fix framework tab

* Add mitre data source

* Change framework tab class components to functional components

* Added date picker in search bar

* Add aggregattions to search

* Add columns definition in data grid

* Fix cluster disabled error on filter

* Add receive filter manager like prop

* Create generic components to reuse in discover

* Add mitre attack data source

* Create flyout discover

* Refactor mitre with data source

* Add default fetch filters

* Linter in wz-discover

* Create component to reuse in discover

* Add expanded techniques row inner component

* Apply initial fetch filters on flyout

* Linter on mitre module

* Fix cluster filter

* Fix UI styles

* Add redirect links and apply filters links

* Update CHANGELOG

* Remove unused code and imports

* Fix table headers and cell links

* Move mitre lib to react-services

* Fix files with prettier

* Signed commit

* [Remove discover] Implement embeddable dashboard on server management cluster module (#6561)

* Migrated Server Management Cluster to embeddables without cluster controller

* Fixed width of Cluster Configuration section

* Rendering conditions are adjusted and clean code

* Deleted controller and visualization monitoring files

* Integrated data-source implementation

* Fixed configuration_cards itemsList, the code is improved and unnecessary code is removed

* Added HOC withGuardAsync

* Changed the source of clusterEnabled information to that provided by the API

* Changed ClusterOverview component class to functional and fixed error on checkClusterIsEnabledAndRunning

* Added more dependencies in useEffect on Cluster Dashboard

* Added error handling to cluster-disabled component

* Fixed alert.timestamp field on SampleData

* Remove discover - Implement embeddable dashboard on statistics module (#6542)

* Migrated visualizations to embeddables

* Changed searchbar and node selector

* Cleaned dashboard obsolete code

* Added selectedNodeFilter

* Integrated new data source on statistics

* Fixed statistics index without data.

* Added apiName filter

* Fixed nodeName filter when a node is selected in cluster mode

* Added No results message, fixed allow agents filters on request and cleaned obsolete code

* Changed condition of apiName filter, validation of statistics-data-source-repository and abstracted behavior between DashboardListenerEngineStatistics and DashboardAnalysisEngineStatistics

* Deleted unused  use-build-statistics-visualizations hook

* Fixed information message depending on active tab

* Added withUserAuthorizationPrompt to add protection with the user permissions check

* remove(statistics): unused message definitions

* Deleted unused index.ts file on cluster integration-files visualizations

---------

Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>

* Fix changelog entries (#6612)

* changelog: fix entries

* Change enrollment.dns changelog entry

---------

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

* Remove AngularJS component click-action.js (#6613)

* remove click-action.js

* update changelog

* Update changelog

---------

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

* Refactor settings angularJS controller (#6580)

* Create settings component

* Parcial refactor into react component

* Remove angularJS controller

* Remove unnecessary properties

* Add changelog

* fix: category parameter to preselect the app category settings on App Settings from Statistics

* Remove optional chaining operator

---------

Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>

* Fix mitre columns error in techniques on hover

* Hide remove filters on search bar

* Use not global time filter and query in search bar

* Fix filters in visualizations

* Implement journald log collection feature (#6572)

* Added tab

* Add journald tab

* Added changes to imposter

* journald values filters table

* Update changelog and redesign filters table

* Fixed styles

* Fixed hardcode bug

* Added filters groups

* Change to an accordion render

* Added helps-link

* Added changelog

* Fix changelog and message popover improve

* Update configuration-setting imports

* Fix macOS log title

* resolve comments

* Fixed info euitext render and header no render in journald tab

* Add verification to mac and journald agents and add condition to journald

---------

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

* Remove global filter manager from common-data

* Fix date range parser on requests

* Fix error when remove query saved

* Add timestamp formatted in events data grid

* [Remove discover] Implement embeddable dashboard on Virustotal module (#6525)

* Migrated visualizations, added loadings and messages

* Fixed warning for expected a single ReactElement

* Added new virustotal data source. Changed NoResults and LoadingSpinner to commons components

* Fixed Events tab

* Integrated pinned agent functionality based on data source

* Added timeRange to dashboard useEffect dependencies and changed the way to get pinned agent

* Deleted unused component

* Changed AlertsVirustotalDataSource import in modules-defaults

* Fixed error message

* DashboardByRenderer timeRange params replaced by searchBarProps deconstruction

* Added wz-discover hide-filter-control classes to hide the button that allows you to affect all the filters in the search bar

* Removed unnecessary virus total in Filters tab in common data to remove duplicate filters

* Removed unused getImplicitPinnedAgent in modules-helper

* Added dateRange param to fetchData in dashboard useEffect

* Improved AlertsVirustotalDataSource import in modules-defaults and deleted wz-discover on SearchBar wrapper

* [Remove discover] Implement embeddable dashboard on Threat Hunting module (#6486)

* Migrated visualizations to embeddables

* Added withPinnedAgent HOC

* Added dashboard update mechanism depending on whether or not an agent has been pinned

* Pinned agent visualization definitions are migrated and aesthetic adjustments are made

* The interaction was added to the KPIs, the links to the lower table were added, as well as the change of columns when an agent is set

* Integrated new data source on Threat Hunting module

* DiscoverNoResults and LoadingSpinner components are replaced with common components

* Clean code and fixed dashboards conditions

* Improved condition for rendering the dashboard and SampleData message

* Removed unnecessary general/threat hunting in tabFilters in common data to remove duplicate filters

* Removed unused getImplicitPinnedAgent in modules-helper

* Added dateRange param to fetchData in dashboard useEffect, added wz-discover hide-filter-control classes to hide the button that allows you to affect all the filters in the search bar and use searchbarProps deconstruction

* Deleted unnecessary wz-discover class on SearchBar wrapper

* Changed Threat Hunting columns file name

* Deleted unused imports in modules-helper

---------

Co-authored-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>

* Renamed virus total data source

* Change order fixed filters virus total

* Clean dashboard code

---------

Co-authored-by: Maximiliano <maximiliano.ibarra@wazuh.com>
Co-authored-by: Maximiliano Ibarra <6089438+Machi3mfl@users.noreply.github.com>
Co-authored-by: Julio César Biset <43619595+jbiset@users.noreply.github.com>
Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com>
Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Co-authored-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Remove discover] Implement embeddable dashboard on Server Management / Cluster module
4 participants