diff --git a/monkey/monkey_island/cc/resources/ransomware_report.py b/monkey/monkey_island/cc/resources/ransomware_report.py index cb5923468..a1b4c8ee8 100644 --- a/monkey/monkey_island/cc/resources/ransomware_report.py +++ b/monkey/monkey_island/cc/resources/ransomware_report.py @@ -2,12 +2,14 @@ import flask_restful from flask import jsonify from monkey_island.cc.resources.auth.auth import jwt_required +from monkey_island.cc.services.ransomware.ransomware_report import RansomwareReportService from monkey_island.cc.services.ransomware import ransomware_report class RansomwareReport(flask_restful.Resource): @jwt_required def get(self): - return jsonify( - {"report": None, "propagation_stats": ransomware_report.get_propagation_stats()} + encrypted_files_table = RansomwareReportService.get_encrypted_files_table() + return jsonify({"encrypted_files_table": encrypted_files_table, + "propagation_stats": ransomware_report.get_propagation_stats()} ) diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js index 86b73dbb4..17577fb81 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ReportPage.js @@ -58,15 +58,13 @@ class ReportPageComponent extends AuthComponent { this.getZeroTrustReportFromServer().then((ztReport) => { this.setState({zeroTrustReport: ztReport}) }); - this.setState({ - ransomwareReport: {'report': ''}}) - // this.authFetch('/api/report/ransomware') - // .then(res => res.json()) - // .then(res => { - // this.setState({ - // ransomwareReport: res - // }); - // }); + this.authFetch('/api/report/ransomware') + .then(res => res.json()) + .then(res => { + this.setState({ + ransomwareReport: res + }); + }); if (this.shouldShowRansomwareReport(this.state.ransomwareReport)) { this.state.sections.push({key: 'ransomware', title: 'Ransomware report'}) }