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

Add sample data to dashboards #2115

Closed
3 tasks done
juankaromo opened this issue Mar 3, 2020 · 5 comments
Closed
3 tasks done

Add sample data to dashboards #2115

juankaromo opened this issue Mar 3, 2020 · 5 comments
Assignees
Labels
type/enhancement Enhancement issue
Milestone

Comments

@juankaromo
Copy link
Contributor

juankaromo commented Mar 3, 2020

Hi team,

We need to add to Elasticsearch sample data and alerts to feed the Wazuh App dashboards so that users can see a real example of the views provided in that panel.

To do this, we will add a new section to the new visualize menu to add sample data, similar to the one Kibana has:

image

We can diversify the creation of this example data into sections. For example, create example data for 'THREAT DETECTION AND RESPONSE' or data for 'REGULATORY COMPLIANCE'.

This data will be inserted into a new wazuh-sample-data index so that it does not get mixed up with the actual alerts and can be removed when the user wishes.

Regards.

@victorst79
Copy link
Contributor

Sample data reference:

sample-data-reference

@juankaromo juankaromo modified the milestones: Sprint 108 - Kibana App, Backlogs pending Mar 26, 2020
@juankaromo juankaromo modified the milestones: Backlogs pending, Sprint 110 Apr 2, 2020
@Desvelao Desvelao self-assigned this Apr 3, 2020
@Desvelao
Copy link
Member

Desvelao commented Apr 15, 2020

Add modules data

Notes:
Alerts are generated with a script in the app backend.
For each sample data category an index is created with shards/replicas as configurated in wazuh.yml. This index has as name <index_pattern_without_*>-sample-<category>. For example, wazuh-alerts-3.x--sample-security.
In each dashboard, it will show a callout to warn that there is sample data installed.

Backend changes:
4 app server endpoints added:

  • GET /elastic/samplealerts/{pattern} - check if there is sample data installed.
  • GET /elastic/samplealerts/{pattern}/{category} - check if there is sample data installed for a category.
  • POST /elastic/samplealerts/{pattern}/{category} - add sample data for that category.
  • DELETE /elastic/samplealerts/{pattern}/{category} - remove sample data (index) for that category.

Other changes:

  • Added Redux action and reducer variable currentPattern in appStateReducers needed it to send sample data request with the current index pattern selected, for create/update/check existence of sample data indices.

Preview
add_modules_data_preview

Adding/removing data
add_sample_data_add_remove

Sample data callout in modules
sample_data_callout

More screenshots
openscap_sample_data

vulnerabilities

mitre_sample_data

@Desvelao
Copy link
Member

Desvelao commented Apr 15, 2020

Problems:

  • There is some problem with dashboard stats for the modules when use the new menu to go to a module. If this, is accessed from Overview (where modules cards) or some other app section, it seems that module stats are loaded and show correctly.
  • VirusTotal heatmap visualization shows a rare error
    virustotal_heatmap_visualization_error

TODO

  • Fix creation of new indices for sample data with wazuh-alerts-3.x-* prefix.
  • Manage sample data (add/delete) only avaliable for admin
  • Remove Regulatory Compliance category
  • fix CIS-CAT stats

Think about

  • Does sample data need real agents?

@juankaromo juankaromo added this to In progress in Wazuh 3.13 Apr 16, 2020
@Desvelao
Copy link
Member

Desvelao commented Apr 21, 2020

Files:
script: server/lib/generate-alerts/generate-alerts-script.js
modules sample data: server/lib/generate-alerts/sample-data

We need to generate sample data for:

@Desvelao
Copy link
Member

Desvelao commented Apr 27, 2020

Admin mode

Management of sample data is only avaliable when is admin mode.

Changes:

  • Sample data link appears in Management section of Wazuh menu when admin mode is enabled
    Anotación 2020-04-27 103602

  • Sample data card in Management welcome
    sample-data-management-admin-mode

  • Wazuh visualize callout
    sample-data-callout-admin-mode

  • If try to enter to sample data section in no admin mode, buttons are disabled and the app redirects to app root path.

Update 2020/04/09
Now adminMode for sample data links/components is managed with Redux store. This prevents blinkins in sample data related components when checks admin mode with a request to app backend.
adminMode in Redux is updated:

  • when app start
  • each time access to a component what requires adminMode (does a request to app backend to check if adminMode has been changed in wazuh.yml)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Enhancement issue
Projects
No open projects
Wazuh 3.13
  
Done
Wazuh 4.0
  
Awaiting triage
Development

No branches or pull requests

5 participants