forked from p15670423/monkey
island: Create RansomwareReportService and add `get_exploitation_stats()` to it
This commit is contained in:
parent
0db85ae407
commit
79d042b471
|
@ -2,9 +2,10 @@ import flask_restful
|
|||
from flask import jsonify
|
||||
|
||||
from monkey_island.cc.resources.auth.auth import jwt_required
|
||||
from monkey_island.cc.services.ransomware_report import RansomwareReportService
|
||||
|
||||
|
||||
class RansomwareReport(flask_restful.Resource):
|
||||
@jwt_required
|
||||
def get(self):
|
||||
return jsonify({"report": None})
|
||||
return jsonify({"report": None, "stats": RansomwareReportService.get_exploitation_stats()})
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
from monkey_island.cc.services.reporting.report import ReportService
|
||||
|
||||
|
||||
class RansomwareReportService:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def get_exploitation_stats():
|
||||
scanned = ReportService.get_scanned()
|
||||
exploited = ReportService.get_exploited()
|
||||
|
||||
return {"scanned": scanned, "exploited": exploited}
|
Loading…
Reference in New Issue