From 0deb8c63c52f343ab0527b2bd030b640a1cffa0a Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Sun, 26 Jul 2020 11:21:57 +0300 Subject: [PATCH 1/2] Fix import formatting --- monkey/monkey_island/cc/services/config.py | 1 - .../cc/services/config_schema/config_schema.py | 9 ++++++--- .../definitions/system_info_collector_classes.py | 4 ++-- monkey/monkey_island/cc/services/config_schema/monkey.py | 4 +++- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/monkey/monkey_island/cc/services/config.py b/monkey/monkey_island/cc/services/config.py index 341297435..ac1ee1417 100644 --- a/monkey/monkey_island/cc/services/config.py +++ b/monkey/monkey_island/cc/services/config.py @@ -10,7 +10,6 @@ import monkey_island.cc.services.post_breach_files from monkey_island.cc.database import mongo from monkey_island.cc.encryptor import encryptor from monkey_island.cc.network_utils import local_ip_addresses - from monkey_island.cc.services.config_schema.config_schema import SCHEMA __author__ = "itay.mizeretz" diff --git a/monkey/monkey_island/cc/services/config_schema/config_schema.py b/monkey/monkey_island/cc/services/config_schema/config_schema.py index d1cd7a68c..04e586e71 100644 --- a/monkey/monkey_island/cc/services/config_schema/config_schema.py +++ b/monkey/monkey_island/cc/services/config_schema/config_schema.py @@ -1,8 +1,11 @@ from monkey_island.cc.services.config_schema.basic import BASIC from monkey_island.cc.services.config_schema.basic_network import BASIC_NETWORK -from monkey_island.cc.services.config_schema.definitions.exploiter_classes import EXPLOITER_CLASSES -from monkey_island.cc.services.config_schema.definitions.finger_classes import FINGER_CLASSES -from monkey_island.cc.services.config_schema.definitions.post_breach_actions import POST_BREACH_ACTIONS +from monkey_island.cc.services.config_schema.definitions.exploiter_classes import \ + EXPLOITER_CLASSES +from monkey_island.cc.services.config_schema.definitions.finger_classes import \ + FINGER_CLASSES +from monkey_island.cc.services.config_schema.definitions.post_breach_actions import \ + POST_BREACH_ACTIONS from monkey_island.cc.services.config_schema.definitions.system_info_collector_classes import \ SYSTEM_INFO_COLLECTOR_CLASSES from monkey_island.cc.services.config_schema.internal import INTERNAL diff --git a/monkey/monkey_island/cc/services/config_schema/definitions/system_info_collector_classes.py b/monkey/monkey_island/cc/services/config_schema/definitions/system_info_collector_classes.py index 8b960d1d8..5f113f4a7 100644 --- a/monkey/monkey_island/cc/services/config_schema/definitions/system_info_collector_classes.py +++ b/monkey/monkey_island/cc/services/config_schema/definitions/system_info_collector_classes.py @@ -1,9 +1,9 @@ from common.data.system_info_collectors_names import (AWS_COLLECTOR, + AZURE_CRED_COLLECTOR, ENVIRONMENT_COLLECTOR, HOSTNAME_COLLECTOR, - PROCESS_LIST_COLLECTOR, MIMIKATZ_COLLECTOR, - AZURE_CRED_COLLECTOR) + PROCESS_LIST_COLLECTOR) SYSTEM_INFO_COLLECTOR_CLASSES = { "title": "System Information Collectors", diff --git a/monkey/monkey_island/cc/services/config_schema/monkey.py b/monkey/monkey_island/cc/services/config_schema/monkey.py index 8e0ae9439..dd10cb35b 100644 --- a/monkey/monkey_island/cc/services/config_schema/monkey.py +++ b/monkey/monkey_island/cc/services/config_schema/monkey.py @@ -1,7 +1,9 @@ from common.data.system_info_collectors_names import (AWS_COLLECTOR, + AZURE_CRED_COLLECTOR, ENVIRONMENT_COLLECTOR, HOSTNAME_COLLECTOR, - PROCESS_LIST_COLLECTOR, MIMIKATZ_COLLECTOR, AZURE_CRED_COLLECTOR) + MIMIKATZ_COLLECTOR, + PROCESS_LIST_COLLECTOR) MONKEY = { "title": "Monkey", From e21d67c37ac22f4efd86224e0ca2a738ad809521 Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Sun, 26 Jul 2020 14:40:13 +0300 Subject: [PATCH 2/2] Clean some JS warnings --- .travis.yml | 2 +- monkey/monkey_island/cc/ui/.eslintrc | 2 +- .../monkey_island/cc/ui/src/components/Main.js | 2 +- .../cc/ui/src/components/SideNavComponent.js | 2 +- .../ui/src/components/attack/techniques/T1136.js | 2 +- .../configuration-components/InternalConfig.js | 16 +++++++++++++--- .../configuration-components/PbaInput.js | 6 +++--- .../ValidationFormats.js | 4 ++-- .../components/map/preview-pane/PreviewPane.js | 4 ++-- .../cc/ui/src/components/pages/ConfigurePage.js | 4 ++-- .../cc/ui/src/components/pages/LicensePage.js | 4 ++-- .../cc/ui/src/components/pages/LoginPage.js | 6 +++--- .../cc/ui/src/components/pages/MapPage.js | 2 +- .../cc/ui/src/components/pages/RunMonkeyPage.js | 4 ++-- .../cc/ui/src/components/pages/StartOverPage.js | 4 ++-- .../cc/ui/src/components/pages/TelemetryPage.js | 2 +- .../components/report-components/AttackReport.js | 2 +- .../report-components/SecurityReport.js | 2 +- .../common/MonkeysStillAliveWarning.js | 2 +- .../common/MustRunMonkeyWarning.js | 2 +- .../common/PrintReportButton.js | 2 +- .../report-components/common/RenderArrays.js | 2 +- .../security/BreachedServers.js | 2 +- .../report-components/security/PostBreach.js | 4 ++-- .../report-components/security/ScannedServers.js | 4 ++-- .../report-components/security/StrongUsers.js | 2 +- .../report-components/zerotrust/FindingsTable.js | 8 ++++++-- .../zerotrust/PrinciplesStatusTable.js | 8 ++++++-- .../report-components/zerotrust/ReportLegend.js | 2 +- .../zerotrust/SinglePillarPrinciplesStatus.js | 2 +- .../zerotrust/venn-components/VennDiagram.js | 2 +- .../ui/src/components/run-monkey/AwsRunTable.js | 2 +- .../ui/src/components/ui-components/InfoPane.js | 4 ++-- .../ui-components/MissingBinariesModal.js | 1 - 34 files changed, 68 insertions(+), 51 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5228275d4..62bec4fd2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -83,7 +83,7 @@ script: - cd monkey_island/cc/ui - npm ci # See https://docs.npmjs.com/cli/ci.html - eslint ./src --quiet # Test for errors -- JS_WARNINGS_AMOUNT_UPPER_LIMIT=70 +- JS_WARNINGS_AMOUNT_UPPER_LIMIT=25 - eslint ./src --max-warnings $JS_WARNINGS_AMOUNT_UPPER_LIMIT # Test for max warnings # Build documentation diff --git a/monkey/monkey_island/cc/ui/.eslintrc b/monkey/monkey_island/cc/ui/.eslintrc index 3cdf79db7..2cd52bb98 100644 --- a/monkey/monkey_island/cc/ui/.eslintrc +++ b/monkey/monkey_island/cc/ui/.eslintrc @@ -41,7 +41,7 @@ "global-strict": 0, "no-underscore-dangle": 0, "no-console": 0, - "no-unused-vars": 1, + "no-unused-vars": [1, {"vars": "all", "args": "all", "argsIgnorePattern": "^_", "varsIgnorePattern": "^React$" }], "no-trailing-spaces": [ 1, { diff --git a/monkey/monkey_island/cc/ui/src/components/Main.js b/monkey/monkey_island/cc/ui/src/components/Main.js index 6a3f18a5a..7ef373f05 100644 --- a/monkey/monkey_island/cc/ui/src/components/Main.js +++ b/monkey/monkey_island/cc/ui/src/components/Main.js @@ -97,7 +97,7 @@ class AppComponent extends AuthComponent { }; redirectTo = (userPath, targetPath) => { - let pathQuery = new RegExp(userPath + '[\/]?$', 'g'); + let pathQuery = new RegExp(userPath + '[/]?$', 'g'); if (window.location.pathname.match(pathQuery)) { return } diff --git a/monkey/monkey_island/cc/ui/src/components/SideNavComponent.js b/monkey/monkey_island/cc/ui/src/components/SideNavComponent.js index 373d07fd3..52fb3fb4e 100644 --- a/monkey/monkey_island/cc/ui/src/components/SideNavComponent.js +++ b/monkey/monkey_island/cc/ui/src/components/SideNavComponent.js @@ -49,7 +49,7 @@ class SideNavComponent extends React.Component {
  • { + isActive={(_match, location) => { return (location.pathname === '/report/attack' || location.pathname === '/report/zeroTrust' || location.pathname === '/report/security') diff --git a/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1136.js b/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1136.js index 55cd9966c..2df34c454 100644 --- a/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1136.js +++ b/monkey/monkey_island/cc/ui/src/components/attack/techniques/T1136.js @@ -1,7 +1,7 @@ import React from 'react'; import ReactTable from 'react-table'; import {renderMachineFromSystemData, ScanStatus} from './Helpers'; -import MitigationsComponent from "./MitigationsComponent"; +import MitigationsComponent from './MitigationsComponent'; class T1136 extends React.Component { diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/InternalConfig.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/InternalConfig.js index abb0230a2..784931cbb 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/InternalConfig.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/InternalConfig.js @@ -2,8 +2,18 @@ import Form from 'react-jsonschema-form-bs4'; import React, {useState} from 'react'; import {Nav} from 'react-bootstrap'; -const sectionOrder = ['network', 'monkey', 'island_server', 'logging', 'exploits', 'dropper', 'classes', 'general', - 'kill_file', 'testing']; +const sectionOrder = [ + 'network', + 'monkey', + 'island_server', + 'logging', + 'exploits', + 'dropper', + 'classes', + 'general', + 'kill_file', + 'testing' +]; const initialSection = sectionOrder[0]; export default function InternalConfig(props) { @@ -38,7 +48,7 @@ export default function InternalConfig(props) { className={'config-nav'}> {sectionOrder.map(section => { return ( - + {getNavTitle(schema, section)} ); })} diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/PbaInput.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/PbaInput.js index f341a085e..507173b6f 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/PbaInput.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/PbaInput.js @@ -23,8 +23,8 @@ class PbaInput extends AuthComponent { }; } - componentDidUpdate(prevProps, prevState, snapshot) { - if(prevProps.options.filename !== this.props.options.filename && this.props.options.filename === ""){ + componentDidUpdate(prevProps, _prevState, _snapshot) { + if(prevProps.options.filename !== this.props.options.filename && this.props.options.filename === ''){ this.setState({filename: this.props.options.filename}) } } @@ -68,7 +68,7 @@ class PbaInput extends AuthComponent { if (fileItems.length > 0) { this.state.setPbaFilename(fileItems[0].file.name) } else { - this.state.setPbaFilename("") + this.state.setPbaFilename('') } }} />) diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js index db2bcb29c..f38ddda0d 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js @@ -4,7 +4,7 @@ const hostnameRegex = '^([A-Za-z0-9]*[A-Za-z]+[A-Za-z0-9]*.?)*([A-Za-z0-9]*[A-Za export const formValidationFormats = { 'ip-range': buildIpRangeRegex(), - 'ip': buildIpRegex(), + 'ip': buildIpRegex() }; function buildIpRangeRegex(){ @@ -12,7 +12,7 @@ function buildIpRangeRegex(){ '^'+ipRegex+'$|', // Single IP '^'+ipRegex+'-'+ipRegex+'$|', // IP range IP-IP '^'+ipRegex+'/'+cidrNotationRegex+'$|', // IP range with cidr notation: IP/cidr - hostnameRegex, // IP range with cidr notation: IP/cidr + hostnameRegex // IP range with cidr notation: IP/cidr ].join('')) } diff --git a/monkey/monkey_island/cc/ui/src/components/map/preview-pane/PreviewPane.js b/monkey/monkey_island/cc/ui/src/components/map/preview-pane/PreviewPane.js index 84443ec75..27800cb97 100644 --- a/monkey/monkey_island/cc/ui/src/components/map/preview-pane/PreviewPane.js +++ b/monkey/monkey_island/cc/ui/src/components/map/preview-pane/PreviewPane.js @@ -101,9 +101,9 @@ class PreviewPaneComponent extends AuthComponent { .replace(/\\t/g, '\t') .replace(/\\b/g, '\b') .replace(/\\f/g, '\f') - .replace(/\\"/g, '\"') + .replace(/\\"/g, '"') .replace(/\\'/g, '\'') - .replace(/\\&/g, '\&'); + .replace(/\\&/g, '&'); } downloadLog(asset) { diff --git a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js index e7ef099e5..abf98d6c6 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/ConfigurePage.js @@ -34,7 +34,7 @@ class ConfigurePageComponent extends AuthComponent { lastAction: 'none', sections: [], selectedSection: 'attack', - showAttackAlert: false, + showAttackAlert: false }; } @@ -398,7 +398,7 @@ class ConfigurePageComponent extends AuthComponent { {this.state.sections.map(section => { let classProp = section.key.startsWith('basic') ? 'tab-primary' : ''; return ( - + {section.title} ); })} diff --git a/monkey/monkey_island/cc/ui/src/components/pages/LicensePage.js b/monkey/monkey_island/cc/ui/src/components/pages/LicensePage.js index 3fc29649b..bbc05a12f 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/LicensePage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/LicensePage.js @@ -1,8 +1,8 @@ import React from 'react'; import {Col} from 'react-bootstrap'; import rainge from 'rainge'; -import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; -import {faCopyright} from "@fortawesome/free-regular-svg-icons"; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import {faCopyright} from '@fortawesome/free-regular-svg-icons'; class LicensePageComponent extends React.Component { constructor(props) { diff --git a/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js b/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js index f617036a6..df8aa08d0 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/LoginPage.js @@ -2,9 +2,9 @@ import React from 'react'; import {Button, Col, Container, Form, Row} from 'react-bootstrap'; import AuthService from '../../services/AuthService'; -import Particles from "react-particles-js"; -import {particleParams} from "../../styles/components/particle-component/AuthPageParams"; -import monkeyGeneral from "../../images/militant-monkey.svg"; +import Particles from 'react-particles-js'; +import {particleParams} from '../../styles/components/particle-component/AuthPageParams'; +import monkeyGeneral from '../../images/militant-monkey.svg'; class LoginPageComponent extends React.Component { login = (event) => { diff --git a/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js b/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js index 9ca26ae22..ae14b6a47 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/MapPage.js @@ -9,7 +9,7 @@ import {ReactiveGraph} from 'components/reactive-graph/ReactiveGraph'; import {getOptions, edgeGroupToColor} from 'components/map/MapOptions'; import AuthComponent from '../AuthComponent'; import '../../styles/components/Map.scss'; -import {faInfoCircle} from "@fortawesome/free-solid-svg-icons/faInfoCircle"; +import {faInfoCircle} from '@fortawesome/free-solid-svg-icons/faInfoCircle'; class MapPageComponent extends AuthComponent { constructor(props) { diff --git a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js index 155dca40b..a75a65f24 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage.js @@ -8,8 +8,8 @@ import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import {faClipboard} from '@fortawesome/free-solid-svg-icons/faClipboard'; import {faCheck} from '@fortawesome/free-solid-svg-icons/faCheck'; import {faSync} from '@fortawesome/free-solid-svg-icons/faSync'; -import {faInfoCircle} from "@fortawesome/free-solid-svg-icons/faInfoCircle"; -import {faExclamationTriangle} from "@fortawesome/free-solid-svg-icons/faExclamationTriangle"; +import {faInfoCircle} from '@fortawesome/free-solid-svg-icons/faInfoCircle'; +import {faExclamationTriangle} from '@fortawesome/free-solid-svg-icons/faExclamationTriangle'; import {Link} from 'react-router-dom'; import AuthComponent from '../AuthComponent'; diff --git a/monkey/monkey_island/cc/ui/src/components/pages/StartOverPage.js b/monkey/monkey_island/cc/ui/src/components/pages/StartOverPage.js index 5c665bd0e..c536146bf 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/StartOverPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/StartOverPage.js @@ -5,8 +5,8 @@ import AuthComponent from '../AuthComponent'; import StartOverModal from '../ui-components/StartOverModal'; import '../../styles/pages/StartOverPage.scss'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; -import {faInfoCircle} from "@fortawesome/free-solid-svg-icons/faInfoCircle"; -import {faCheck} from "@fortawesome/free-solid-svg-icons/faCheck"; +import {faInfoCircle} from '@fortawesome/free-solid-svg-icons/faInfoCircle'; +import {faCheck} from '@fortawesome/free-solid-svg-icons/faCheck'; class StartOverPageComponent extends AuthComponent { constructor(props) { diff --git a/monkey/monkey_island/cc/ui/src/components/pages/TelemetryPage.js b/monkey/monkey_island/cc/ui/src/components/pages/TelemetryPage.js index 2d75272a3..9c0355aa2 100644 --- a/monkey/monkey_island/cc/ui/src/components/pages/TelemetryPage.js +++ b/monkey/monkey_island/cc/ui/src/components/pages/TelemetryPage.js @@ -7,7 +7,7 @@ import download from 'downloadjs'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; import '../../styles/pages/TelemetryPage.scss'; -import {faDownload} from "@fortawesome/free-solid-svg-icons/faDownload"; +import {faDownload} from '@fortawesome/free-solid-svg-icons/faDownload'; const renderJson = (val) => ; const renderTime = (val) => val.split('.')[0]; diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/AttackReport.js b/monkey/monkey_island/cc/ui/src/components/report-components/AttackReport.js index 3372d1d33..5ab7e4f6e 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/AttackReport.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/AttackReport.js @@ -48,7 +48,7 @@ class AttackReport extends React.Component { } } - onTechniqueSelect = (technique, value) => { + onTechniqueSelect = (technique, _) => { let selectedTechnique = this.getTechniqueByTitle(technique); if (selectedTechnique === false){ return; 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 e0d433537..067069fab 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 @@ -473,7 +473,7 @@ class ReportPageComponent extends AuthComponent { } generateShellshockPathListBadges(paths) { - return paths.map(path => {path}); + return paths.map(path => {path}); } generateSmbPasswordIssue(issue) { diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/common/MonkeysStillAliveWarning.js b/monkey/monkey_island/cc/ui/src/components/report-components/common/MonkeysStillAliveWarning.js index 55a426ee5..19c2198cc 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/common/MonkeysStillAliveWarning.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/common/MonkeysStillAliveWarning.js @@ -1,7 +1,7 @@ import React, {Component} from 'react'; import * as PropTypes from 'prop-types'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; -import {faExclamationTriangle} from "@fortawesome/free-solid-svg-icons/faExclamationTriangle"; +import {faExclamationTriangle} from '@fortawesome/free-solid-svg-icons/faExclamationTriangle'; export default class MonkeysStillAliveWarning extends Component { render() { diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/common/MustRunMonkeyWarning.js b/monkey/monkey_island/cc/ui/src/components/report-components/common/MustRunMonkeyWarning.js index 1d90bab2f..2df46d5be 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/common/MustRunMonkeyWarning.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/common/MustRunMonkeyWarning.js @@ -1,7 +1,7 @@ import React, {Component} from 'react'; import {NavLink} from 'react-router-dom'; import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; -import {faExclamationTriangle} from "@fortawesome/free-solid-svg-icons/faExclamationTriangle"; +import {faExclamationTriangle} from '@fortawesome/free-solid-svg-icons/faExclamationTriangle'; export default class MustRunMonkeyWarning extends Component { render() { diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/common/PrintReportButton.js b/monkey/monkey_island/cc/ui/src/components/report-components/common/PrintReportButton.js index e0ae0ed3d..b5589997a 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/common/PrintReportButton.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/common/PrintReportButton.js @@ -7,7 +7,7 @@ import { faPrint } from '@fortawesome/free-solid-svg-icons/faPrint'; export default class PrintReportButton extends Component { render() { return
    -
    diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/common/RenderArrays.js b/monkey/monkey_island/cc/ui/src/components/report-components/common/RenderArrays.js index 936a2825b..7bbef33bc 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/common/RenderArrays.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/common/RenderArrays.js @@ -1,4 +1,4 @@ -import React from "react"; +import React from 'react'; export let renderArray = function (val) { return <>{val.map(x =>
    {x}
    )}; diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/security/BreachedServers.js b/monkey/monkey_island/cc/ui/src/components/report-components/security/BreachedServers.js index 1a4b02efe..827549c1a 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/security/BreachedServers.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/security/BreachedServers.js @@ -1,7 +1,7 @@ import React from 'react'; import ReactTable from 'react-table'; import Pluralize from 'pluralize'; -import {renderArray, renderIpAddresses} from "../common/RenderArrays"; +import {renderArray, renderIpAddresses} from '../common/RenderArrays'; const columns = [ diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreach.js b/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreach.js index cc9ea1c20..390ad6189 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreach.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/security/PostBreach.js @@ -1,7 +1,7 @@ import React from 'react'; import ReactTable from 'react-table'; import Pluralize from 'pluralize'; -import {renderIpAddresses} from "../common/RenderArrays"; +import {renderIpAddresses} from '../common/RenderArrays'; let renderMachine = function (data) { return
    {data.label} ( {renderIpAddresses(data)} )
    @@ -56,7 +56,7 @@ class PostBreachComponent extends React.Component { }); let defaultPageSize = pbaMachines.length > pageSize ? pageSize : pbaMachines.length; let showPagination = pbaMachines > pageSize; - const pbaCount = pbaMachines.reduce((accumulated, pbaMachine) => accumulated+pbaMachine["pba_results"].length, 0); + const pbaCount = pbaMachines.reduce((accumulated, pbaMachine) => accumulated+pbaMachine['pba_results'].length, 0); return ( <>

    diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/security/ScannedServers.js b/monkey/monkey_island/cc/ui/src/components/report-components/security/ScannedServers.js index bf0eee7d6..229bbfed2 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/security/ScannedServers.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/security/ScannedServers.js @@ -1,7 +1,7 @@ import React from 'react'; import ReactTable from 'react-table'; import Pluralize from 'pluralize'; -import {renderArray, renderIpAddresses} from "../common/RenderArrays"; +import {renderArray, renderIpAddresses} from '../common/RenderArrays'; const columns = [ @@ -32,7 +32,7 @@ class ScannedServersComponent extends React.Component { let showPagination = this.props.data.length > pageSize; const scannedMachinesCount = this.props.data.length; - const reducerFromScannedServerToServicesAmount = (accumulated, scannedServer) => accumulated + scannedServer["services"].length; + const reducerFromScannedServerToServicesAmount = (accumulated, scannedServer) => accumulated + scannedServer['services'].length; const scannedServicesAmount = this.props.data.reduce(reducerFromScannedServerToServicesAmount, 0); return ( diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/security/StrongUsers.js b/monkey/monkey_island/cc/ui/src/components/report-components/security/StrongUsers.js index 013426657..678cf0305 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/security/StrongUsers.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/security/StrongUsers.js @@ -1,6 +1,6 @@ import React from 'react'; import ReactTable from 'react-table' -import {renderArray} from "../common/RenderArrays"; +import {renderArray} from '../common/RenderArrays'; const columns = [ diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/FindingsTable.js b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/FindingsTable.js index f83921dae..5c99b4866 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/FindingsTable.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/FindingsTable.js @@ -18,11 +18,13 @@ const columns = [ { Header: 'Events', id: 'events', accessor: x => { - return ; + comp.displayName = 'EventsButton_' + x.finding_id; + return comp; }, maxWidth: EVENTS_COLUMN_MAX_WIDTH }, @@ -34,7 +36,9 @@ const columns = [ const pillarLabels = pillars.map((pillar) => ); - return

    {pillarLabels}
    ; + const comp =
    {pillarLabels}
    ; + comp.displayName = 'PillarsLabels'; + return comp; }, maxWidth: PILLARS_COLUMN_MAX_WIDTH, style: {'whiteSpace': 'unset'} diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/PrinciplesStatusTable.js b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/PrinciplesStatusTable.js index 6b1d22f6f..6771747e0 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/PrinciplesStatusTable.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/PrinciplesStatusTable.js @@ -13,7 +13,9 @@ const columns = [ { Header: 'Status', id: 'status', accessor: x => { - return ; + const comp = ; + comp.displayName = 'StatusLabel'; + return comp; }, maxWidth: MAX_WIDTH_STATUS_COLUMN }, @@ -25,7 +27,9 @@ const columns = [ Header: 'Monkey Tests', id: 'tests', style: {'whiteSpace': 'unset'}, // This enables word wrap accessor: x => { - return ; + const comp = ; + comp.displayName = 'TestsStatus'; + return comp; } } ] diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/ReportLegend.js b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/ReportLegend.js index 02e156439..e3c94981a 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/ReportLegend.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/ReportLegend.js @@ -14,7 +14,7 @@ class ZeroTrustReportLegend extends Component { super(props, context); this.state = { - open: false, + open: false }; } diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/SinglePillarPrinciplesStatus.js b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/SinglePillarPrinciplesStatus.js index feff49e2a..12eac609f 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/SinglePillarPrinciplesStatus.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/SinglePillarPrinciplesStatus.js @@ -15,7 +15,7 @@ export default class SinglePillarPrinciplesStatus extends AuthComponent { super(props, context); this.state = { - open: false, + open: false }; } diff --git a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/venn-components/VennDiagram.js b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/venn-components/VennDiagram.js index a7fc698a0..e6a2ddd36 100644 --- a/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/venn-components/VennDiagram.js +++ b/monkey/monkey_island/cc/ui/src/components/report-components/zerotrust/venn-components/VennDiagram.js @@ -149,7 +149,7 @@ class VennDiagram extends React.Component { } else { // Return z indices to default - Object.keys(this.layout).forEach(function (d_, i_) { + Object.keys(this.layout).forEach(function (_d, i_) { document.querySelector('#' + self.prefix).appendChild(document.querySelector('#' + self.prefix + 'Node_' + i_).parentNode); }) } diff --git a/monkey/monkey_island/cc/ui/src/components/run-monkey/AwsRunTable.js b/monkey/monkey_island/cc/ui/src/components/run-monkey/AwsRunTable.js index ac9231d82..cbf209a2d 100644 --- a/monkey/monkey_island/cc/ui/src/components/run-monkey/AwsRunTable.js +++ b/monkey/monkey_island/cc/ui/src/components/run-monkey/AwsRunTable.js @@ -67,7 +67,7 @@ class AwsRunTableComponent extends React.Component { this.setState({selectAll, selection}); }; - getTrProps = (s, r) => { + getTrProps = (_, r) => { let color = 'inherit'; if (r) { let instId = r.original.instance_id; diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/InfoPane.js b/monkey/monkey_island/cc/ui/src/components/ui-components/InfoPane.js index cd3315428..5c963d87e 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/InfoPane.js +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/InfoPane.js @@ -1,7 +1,7 @@ import {Card, Button} from 'react-bootstrap'; import React from 'react'; -import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; -import {faQuestionCircle} from "@fortawesome/free-solid-svg-icons"; +import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'; +import {faQuestionCircle} from '@fortawesome/free-solid-svg-icons'; function InfoPane(props) { diff --git a/monkey/monkey_island/cc/ui/src/components/ui-components/MissingBinariesModal.js b/monkey/monkey_island/cc/ui/src/components/ui-components/MissingBinariesModal.js index c73094fb6..ae7f6ac4e 100644 --- a/monkey/monkey_island/cc/ui/src/components/ui-components/MissingBinariesModal.js +++ b/monkey/monkey_island/cc/ui/src/components/ui-components/MissingBinariesModal.js @@ -1,6 +1,5 @@ import {Modal} from 'react-bootstrap'; import React from 'react'; -import {GridLoader} from 'react-spinners'; class MissingBinariesModal extends React.PureComponent {