wazuh-dashboard-plugins icon indicating copy to clipboard operation
wazuh-dashboard-plugins copied to clipboard

Adapt the reporting to the rendering of dashboards

Open Desvelao opened this issue 10 months ago • 3 comments

Description

This pull request adapts the reporting to the rendering of dashboards.

Changes:

  • Adapt the Generate report button to use the search context
    • Create state and reducers into Redux store
    • Create hook to send the search context from a dashboard to the Generate report button
    • Remove disabledReport property and use the search context instead
    • Replace the mechanim to take the visualizations of the screenshots from the DOM
    • Remove the dependency injection of the unused AngularJS service to generate the reports
    • Adapt the report of agent inventory to use the data source
  • Add abilities to the toast message when a PDF report is generated:
    • Open the report
    • Go to the Reporting application
  • Remove unused AngularJS service to generate the reports
  • Fix an error creating the image from map visualizations
  • Fix an error about malformed row related to summary alerts tables

[!WARNING]
This pull request depends on the implementations of dashboards https://github.com/wazuh/wazuh-dashboard-plugins/issues/6477.

Issues Resolved

#6556 #6457

Evidence

Report toast image

Test

[Provide instructions to test this PR]

Check List

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

Desvelao avatar Mar 27 '24 13:03 Desvelao

Wazuh Core plugin code coverage (Jest) test % values
Statements 28.94% ( 286 / 988 )
Branches 26.22% ( 107 / 408 )
Functions 26.87% ( 86 / 320 )
Lines 28.68% ( 278 / 969 )

github-actions[bot] avatar Mar 27 '24 15:03 github-actions[bot]

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 )

github-actions[bot] avatar Mar 27 '24 15:03 github-actions[bot]

Main plugin code coverage (Jest) test % values
Statements 12.15% ( 4212 / 34661 )
Branches 7.8% ( 1776 / 22750 )
Functions 10.76% ( 888 / 8249 )
Lines 12.34% ( 4101 / 33222 )

github-actions[bot] avatar Mar 27 '24 15:03 github-actions[bot]

Test Chrome Firefox
Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser. :black_circle: :black_circle:
Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one. :green_circle: :green_circle:
Go to the Server management > Endpoints Summary, select an agent, then go to Inventory data and click on the Generate report button. Verify the data included in the report it is the expected one. :red_circle: :red_circle:
Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one. :green_circle: :green_circle:

Details

:black_circle: Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser.

Chrome - :black_circle:

Firefox - :black_circle:

:green_circle: Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - :green_circle:

image

wazuh-agent-configuration-001-1715789864.pdf

Firefox - :green_circle:

image

wazuh-agent-configuration-002-1715790008.pdf

:red_circle: Go to the Server management > Endpoints Summary, select an agent, then go to Inventory data and click on the Generate report button. Verify the data included in the report it is the expected one.

Chrome - :red_circle:

The button the generate the report no longer exists image

Firefox - :red_circle:

The button the generate the report no longer exists image

:green_circle: Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - :green_circle:

image

image

Firefox - :green_circle:

image

image

asteriscos avatar May 15 '24 14:05 asteriscos

I was reviewing the missing button to generate report on Inventory data and this seems was removed when we refactored the AngularJS template related to agents on https://github.com/wazuh/wazuh-dashboard-plugins/commit/aee026821f491a9ffe1de7ee0455304a2261a8b9#diff-f2709f07ddcbc36d539eeca4fa1d4c2ff3baa5dd1cf302633d6ae2270630c632L31-L34.

I will talk with @lucianogorza about the context of removing the component that rendered the button and other things.

Desvelao avatar May 16 '24 09:05 Desvelao

I was reviewing the missing button to generate report on Inventory data and this seems was removed when we refactored the AngularJS template related to agents on aee0268#diff-f2709f07ddcbc36d539eeca4fa1d4c2ff3baa5dd1cf302633d6ae2270630c632L31-L34.

I will talk with @lucianogorza about the context of removing the component that rendered the button and other things.

We will fix this in the next stage of the release.

asteriscos avatar May 16 '24 10:05 asteriscos

Test Chrome Firefox
Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser. :green_circle: :green_circle:
Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one. :green_circle: :green_circle:
Go to the Server management > Endpoints Summary, select an agent, then go to Inventory data and click on the Generate report button. Verify the data included in the report it is the expected one. :green_circle: :green_circle:
Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one. :green_circle: :green_circle:

Details

:green_circle: Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser.

Malware detection

Overview wazuh-module-overview-pm-1715872208.pdf

Agent wazuh-module-agents-001-pm-1715872297.pdf

FIM

Overview wazuh-module-overview-fim-1715872364.pdf

Agent wazuh-module-agents-001-fim-1715872322.pdf

Threat hunting

Overview wazuh-module-overview-general-1715872395.pdf

Agent wazuh-module-agents-002-general-1715872463.pdf

Mitre att&ck

Overview wazuh-module-overview-mitre-1715874861.pdf

Agent wazuh-module-agents-002-mitre-1715873688.pdf

Virus total

Overview wazuh-module-overview-virustotal-1715873748.pdf

Agent wazuh-module-agents-002-virustotal-1715873715.pdf

PCI DSS

Overview wazuh-module-overview-pci-1715873775.pdf

Agent wazuh-module-agents-002-pci-1715873813.pdf

GDPR

Overview wazuh-module-overview-gdpr-1715873857.pdf

Agent wazuh-module-agents-002-gdpr-1715873835.pdf

HIPAA

Overview wazuh-module-overview-hipaa-1715873892.pdf

Agent wazuh-module-agents-002-hipaa-1715873924.pdf

NIST 800-53

Overview wazuh-module-overview-nist-1715873988.pdf

Agent wazuh-module-agents-002-nist-1715873955.pdf

TSC

Overview wazuh-module-overview-tsc-1715874034.pdf

Agent wazuh-module-agents-002-tsc-1715874403.pdf

Docker

Overview wazuh-module-overview-docker-1715874460.pdf

Agent wazuh-module-agents-002-docker-1715874432.pdf

AWS

Overview wazuh-module-overview-aws-1715874501.pdf

Agent wazuh-module-agents-002-aws-1715874541.pdf

Google cloud

Overview wazuh-module-overview-gcp-1715874629.pdf

Agent wazuh-module-agents-002-gcp-1715874568.pdf

Github

Overview wazuh-module-overview-github-1715874654.pdf

Agent wazuh-module-agents-001-github-1715874694.pdf

Office 365

Overview wazuh-module-overview-office-1715874729.pdf

:green_circle: Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - :green_circle:

wazuh-agent-configuration-002-1715857506.pdf

Firefox - :green_circle:

wazuh-agent-configuration-001-1715857578.pdf

:green_circle: Go to the Server management > Endpoints Summary, select an agent, then go to Inventory data and click on the Generate report button. Verify the data included in the report it is the expected one.

Chrome :green_circle: wazuh-agent-inventory-001-1715872028.pdf

Firefox :green_circle: wazuh-agent-inventory-002-1715872114.pdf

:green_circle: Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - :green_circle:

image

Firefox - :green_circle:

image

asteriscos avatar May 16 '24 11:05 asteriscos

Test

Legend: :black_circle:: none :green_circle:: pass :yellow_circle:: warning :red_circle:: fail :white_circle:: not applicable

UI

Test Chrome Firefox Safari
Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser. :black_circle: :black_circle: :black_circle:
Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one. :green_circle: :black_circle: :black_circle:
Go to the Server management > Endpoints Summary, select an agent, then go to Invenotyr data and click on the Generate report button. Verify the data included in the report it is the expected one. :green_circle: :black_circle: :black_circle:
Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one. :green_circle: :black_circle: :black_circle:

Details

:black_circle: Go to the Dashboard tab of each Module and generate a report. The visualizations visible on the dashboard should be included into the report. Verify the results on the report is matching the search context of the browser.

Chrome - :black_circle:

Firefox - :black_circle:

Safari - :black_circle:

:green_circle: Go to the Server management > Endpoints Summary, select an agent, then go to Configuration and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - :green_circle:

image

Firefox - :black_circle:

Safari - :black_circle:

:green_circle: Go to the Server management > Endpoints Summary, select an agent, then go to Invenotyr data and click on the Generate report button. Verify the data included in the report it is the expected one.

Chrome - :green_circle:

image

image

Firefox - :black_circle:

Safari - :black_circle:

:green_circle: Go to the Server management > Endpoints Groups, select a group, and click on the Export PDF button. Verify the data included in the report it is the expected one.

Chrome - :green_circle:

image image

Firefox - :black_circle:

Safari - :black_circle:

JuanGarriuz avatar May 16 '24 13:05 JuanGarriuz