From dc295d4a60e025b3d9934d440bc8a841c1ace99d Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Wed, 23 Sep 2020 10:26:03 +0300 Subject: [PATCH] Improved and fixed bugs related to ScoutSuite UI components --- .../zerotrust/scoutsuite/ResourceDropdown.js | 21 ++++++++++++++----- .../scoutsuite/ScoutSuiteRuleModal.js | 2 +- .../ScoutSuiteSingleRuleDropdown.js | 4 ++-- .../scoutsuite/ResourceDropdown.scss | 1 + 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ResourceDropdown.js b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ResourceDropdown.js index 996f62590..03343d901 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ResourceDropdown.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ResourceDropdown.js @@ -50,18 +50,29 @@ export default function ResourceDropdown(props) { return JSON.stringify(data, null, 4); } - function getResourceDropdownContents() { + function getResourceValueDisplay() { let parser = new ScoutSuiteDataParser(props.scoutsuite_data.data.services); + let resource_value = parser.getValueAt(props.resource_path); + if (resource_value) { + return( +
+

Value:

+
{prettyPrintJson(resource_value)}
+
+ ) + } else { + return '' + } + } + + function getResourceDropdownContents() { return (

Path:

{replacePathDotsWithArrows(props.resource_path)}

-
-

Value:

-
{prettyPrintJson(parser.getValueAt(props.resource_path))}
-
+ {getResourceValueDisplay()}
); } diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ScoutSuiteRuleModal.js b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ScoutSuiteRuleModal.js index 92fd430da..01df2a162 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ScoutSuiteRuleModal.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ScoutSuiteRuleModal.js @@ -40,7 +40,7 @@ export default function ScoutSuiteRuleModal(props) {

There {Pluralize('is', props.scoutsuite_rules.length)} {

{props.scoutsuite_rules.length}
- } ScoutSuite {Pluralize('rule', props.scoutsuite_rules.length)} associated with finding. + } ScoutSuite {Pluralize('rule', props.scoutsuite_rules.length)} associated with this finding.

{renderRuleDropdowns()} diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ScoutSuiteSingleRuleDropdown.js b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ScoutSuiteSingleRuleDropdown.js index 1a931b154..f93bbb7fd 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ScoutSuiteSingleRuleDropdown.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/scoutsuite/ScoutSuiteSingleRuleDropdown.js @@ -8,7 +8,7 @@ import classNames from 'classnames'; import * as PropTypes from 'prop-types'; import RULE_LEVELS from '../../common/consts/ScoutSuiteConsts/RuleLevels'; import STATUSES from '../../common/consts/StatusConsts'; -import {faCheckCircle, faCircle, faExclamationCircle} from '@fortawesome/free-solid-svg-icons'; +import {faCheckCircle, faCircle, faExclamationCircle, faQuestionCircle} from '@fortawesome/free-solid-svg-icons'; import RuleDisplay from './RuleDisplay'; export default function ScoutSuiteSingleRuleDropdown(props) { @@ -41,7 +41,7 @@ export default function ScoutSuiteSingleRuleDropdown(props) { case STATUSES.STATUS_PASSED: return faCheckCircle; case STATUSES.STATUS_VERIFY: - return faExclamationCircle; + return faQuestionCircle; case STATUSES.STATUS_FAILED: return faExclamationCircle; case STATUSES.STATUS_UNEXECUTED: diff --git a/monkey/monkey_island/cc/ui/src/styles/components/scoutsuite/ResourceDropdown.scss b/monkey/monkey_island/cc/ui/src/styles/components/scoutsuite/ResourceDropdown.scss index a5be0a4ae..e09ad922c 100644 --- a/monkey/monkey_island/cc/ui/src/styles/components/scoutsuite/ResourceDropdown.scss +++ b/monkey/monkey_island/cc/ui/src/styles/components/scoutsuite/ResourceDropdown.scss @@ -15,6 +15,7 @@ .resource-display .resource-value-title, .resource-display .resource-path-title { + margin-right:5px; font-weight: 500; margin-bottom: 0; }