From 474a26aeffd81f362d3fbf26160526d84791a4be Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Fri, 15 Jul 2022 16:29:02 +0200 Subject: [PATCH] UI: Fix StolenCredentials issue to add if we have any stolen credentials --- .../components/report-components/SecurityReport.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js b/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js index 17e0dc645..4248a97fc 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/SecurityReport.js @@ -587,14 +587,10 @@ class ReportPageComponent extends AuthComponent { addIssuesToOverviewIssues(report) { let issues = report.overview.issues; - let overview_issues = []; + let overview_issues = issues; - for(let i=0; i < issues.length; i++) { - if (this.shouldAddStolenCredentialsIssue()) { - overview_issues.push('stolen_creds'); - } else { - overview_issues.push(issues[i]) - } + if (this.shouldAddStolenCredentialsIssue()) { + overview_issues.push('stolen_creds'); } const newOverview = { ...report.overview, issues : overview_issues }; const newReport = { ...report, overview : newOverview }; @@ -602,6 +598,8 @@ class ReportPageComponent extends AuthComponent { } shouldAddStolenCredentialsIssue() { + // TODO: This should check if any stolen credentials are used to + // exploit a machine return ( this.state.stolenCredentials.length > 0 ) } }