Changed "general" report to "security" all over

This commit is contained in:
Shay Nehmad 2019-08-19 12:03:42 +03:00
parent d693b216a7
commit d50095b570
4 changed files with 8 additions and 8 deletions

View File

@ -123,7 +123,7 @@ def init_api_resources(api):
api.add_resource(Edge, '/api/netmap/edge', '/api/netmap/edge/') api.add_resource(Edge, '/api/netmap/edge', '/api/netmap/edge/')
api.add_resource(Node, '/api/netmap/node', '/api/netmap/node/') api.add_resource(Node, '/api/netmap/node', '/api/netmap/node/')
# report_type: zero_trust or general # report_type: zero_trust or security
api.add_resource( api.add_resource(
Report, Report,
'/api/report/<string:report_type>', '/api/report/<string:report_type>',

View File

@ -9,8 +9,8 @@ from monkey_island.cc.services.reporting.report import ReportService
from monkey_island.cc.services.reporting.zero_trust_service import ZeroTrustService from monkey_island.cc.services.reporting.zero_trust_service import ZeroTrustService
ZERO_TRUST_REPORT_TYPE = "zero_trust" ZERO_TRUST_REPORT_TYPE = "zero_trust"
GENERAL_REPORT_TYPE = "general" SECURITY_REPORT_TYPE = "security"
REPORT_TYPES = [GENERAL_REPORT_TYPE, ZERO_TRUST_REPORT_TYPE] REPORT_TYPES = [SECURITY_REPORT_TYPE, ZERO_TRUST_REPORT_TYPE]
REPORT_DATA_PILLARS = "pillars" REPORT_DATA_PILLARS = "pillars"
REPORT_DATA_FINDINGS = "findings" REPORT_DATA_FINDINGS = "findings"
@ -22,8 +22,8 @@ __author__ = ["itay.mizeretz", "shay.nehmad"]
class Report(flask_restful.Resource): class Report(flask_restful.Resource):
@jwt_required() @jwt_required()
def get(self, report_type=GENERAL_REPORT_TYPE, report_data=None): def get(self, report_type=SECURITY_REPORT_TYPE, report_data=None):
if report_type == GENERAL_REPORT_TYPE: if report_type == SECURITY_REPORT_TYPE:
return ReportService.get_report() return ReportService.get_report()
elif report_type == ZERO_TRUST_REPORT_TYPE: elif report_type == ZERO_TRUST_REPORT_TYPE:
if report_data == REPORT_DATA_PILLARS: if report_data == REPORT_DATA_PILLARS:

View File

@ -148,7 +148,7 @@ class AppComponent extends AuthComponent {
</NavLink> </NavLink>
</li> </li>
<li> <li>
<NavLink to="/report/general"> <NavLink to="/report/security">
<span className="number">4.</span> <span className="number">4.</span>
Security Report Security Report
{this.state.completedSteps.report_done ? {this.state.completedSteps.report_done ?
@ -199,7 +199,7 @@ class AppComponent extends AuthComponent {
{this.renderRoute('/infection/map', <MapPage onStatusChange={this.updateStatus}/>)} {this.renderRoute('/infection/map', <MapPage onStatusChange={this.updateStatus}/>)}
{this.renderRoute('/infection/telemetry', <TelemetryPage onStatusChange={this.updateStatus}/>)} {this.renderRoute('/infection/telemetry', <TelemetryPage onStatusChange={this.updateStatus}/>)}
{this.renderRoute('/start-over', <StartOverPage onStatusChange={this.updateStatus}/>)} {this.renderRoute('/start-over', <StartOverPage onStatusChange={this.updateStatus}/>)}
{this.renderRoute('/report/general', <ReportPage onStatusChange={this.updateStatus}/>)} {this.renderRoute('/report/security', <ReportPage onStatusChange={this.updateStatus}/>)}
{this.renderRoute('/report/zero_trust', <ZeroTrustReportPage onStatusChange={this.updateStatus}/>)} {this.renderRoute('/report/zero_trust', <ZeroTrustReportPage onStatusChange={this.updateStatus}/>)}
{this.renderRoute('/license', <LicensePage onStatusChange={this.updateStatus}/>)} {this.renderRoute('/license', <LicensePage onStatusChange={this.updateStatus}/>)}
</Col> </Col>

View File

@ -119,7 +119,7 @@ class ReportPageComponent extends AuthComponent {
getReportFromServer(res) { getReportFromServer(res) {
if (res['completed_steps']['run_monkey']) { if (res['completed_steps']['run_monkey']) {
this.authFetch('/api/report/general') this.authFetch('/api/report/security')
.then(res => res.json()) .then(res => res.json())
.then(res => { .then(res => {
this.setState({ this.setState({