wazuh / wazuh-dashboard

Wazuh dashboard, the Wazuh UI platform
https://wazuh.com
Apache License 2.0
22 stars 49 forks source link

Spike - OpenSearch reporting and notifications assessment #194

Open asteriscos opened 2 weeks ago

asteriscos commented 2 weeks ago

Description

We want to identify which of the following functional requirements can be achieved using the OpenSearch Reporting and Notifications plugins. This will allow us to determine the features that will have to be developed in the wazuh-dashboard-plugins repository and how to use the existing features of the mentioned plugins.

Functional Requirements

Implementation Restrictions

Plan

yenienserrano commented 3 days ago

I was reading the documentation of both plugins and looking for information if they have something to integrate both plugins. From what I could see, they were going to work on an integration that was going to be in 2.0.0 but apparently it didn't arrive and they don't give much information about when this integration is going to be in 2.0.0.

https://github.com/opensearch-project/reporting/issues/72

On the other hand I saw that you haveopensearch-reporting-cli which can be used for sending reports to mail but we would need our dashboards to be added as saved object of dashboards, because you need the id of the visualization.

https://opensearch.org/docs/latest/reporting/rep-cli-create/

And create a development image with the plugins and upload it to quay, to see the capabilities that both plugins provide.

yenienserrano commented 2 days ago

A new branch is created with a new plugin to test and see what can be used of the notification and reporting plugins.

https://github.com/wazuh/wazuh-dashboard-plugins/tree/enhancement/194-spike-reporting-and-notification-plugins

yenienserrano commented 1 day ago

From what I've found out, it seems that they don't have methods to generate reports or send notifications from other plugins.

image

While testing the applications I saw that the Dashboard application has a button to generate reports using the report plugin. But when I looked into how they were adding the button to generate the reports I couldn't find it in the visualization plugin. As far as I can see it is being added by the reporting plugin depending on which application it is in according to the breadcrumb and the buttons added to the top left.

https://github.com/opensearch-project/dashboards-reporting/blob/2.15.0.0/public/components/context_menu/context_menu.js#L264-L316

jbiset commented 1 day ago

Update 2024-06-27

Research about Notifications plugin

To understand the Notifications plugin, it was configured on the platform by configuring a Channel with an SMTP sender through the Resend service, following the OSD guide. Something to keep in mind is that you have to use commands that are not in the UI to load the sender's SMTP service credentials. Analyzing the functionalities provided by the Notifications plugin, it is likely that the Create Monitor functionality in Alerting (image below) can be used for everything in the schedule; However, it does not solve the problem as to how to generate the report. It will continue to be analyzed at the code level to evaluate if what was mentioned above can be taken advantage of.

create_monitor_screen

jbiset commented 12 hours ago

Update 2024-06-28

yenienserrano commented 11 hours ago

Update 2024-06-28