From 59b7bbea9b7acb60fb37ad37c001678dfd206bad Mon Sep 17 00:00:00 2001 From: Esco Date: Wed, 17 Jul 2024 23:05:34 +0200 Subject: [PATCH 1/3] Added Dismiss Risky User --- .../identity/administration/RiskyUsers.jsx | 193 ++++++++++++++---- 1 file changed, 148 insertions(+), 45 deletions(-) diff --git a/src/views/identity/administration/RiskyUsers.jsx b/src/views/identity/administration/RiskyUsers.jsx index 03f58eaf241f..977ae479c991 100644 --- a/src/views/identity/administration/RiskyUsers.jsx +++ b/src/views/identity/administration/RiskyUsers.jsx @@ -1,54 +1,139 @@ +import React, { useState } from 'react' import { useSelector } from 'react-redux' import { CippPageList } from 'src/components/layout' - -const columns = [ - { - name: 'Risk Last Updated Date', - selector: (row) => row['riskLastUpdatedDateTime'], - sortable: true, - exportSelector: 'riskLastUpdatedDateTime', - }, - { - name: 'User Principal Name', - selector: (row) => row['userPrincipalName'], - sortable: true, - exportSelector: 'userPrincipalName', - }, - { - name: 'Risk Level', - selector: (row) => row['riskLevel'], - sortable: true, - exportSelector: 'riskLevel', - }, - { - name: 'Risk State', - selector: (row) => row['riskState'], - sortable: true, - exportSelector: 'riskState', - }, - { - name: 'Risk Detail', - selector: (row) => row['riskDetail'], - sortable: true, - exportSelector: 'riskDetail', - }, - { - name: 'isProcessing', - selector: (row) => row['isProcessing'], - sortable: true, - exportSelector: 'isProcessing', - }, - { - name: 'isDeleted', - selector: (row) => row['isDeleted'], - sortable: true, - exportSelector: 'isDeleted', - }, -] +import { CButton } from '@coreui/react' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faEllipsisV, faMinusCircle, faPaperPlane } from '@fortawesome/free-solid-svg-icons' +import { CippActionsOffcanvas } from 'src/components/utilities' const RiskyUsers = () => { const tenant = useSelector((state) => state.app.currentTenant) + const Offcanvas = (row, rowIndex, formatExtraData) => { + const [ocVisible, setOCVisible] = useState(false) + return ( + <> + setOCVisible(true)}> + + + , + }, + /* TODO Add action for Compromised + { + label: 'Confirm Compromised', + color: 'info', + modal: true, + modalUrl: `/api/ExecBECRemediate?TenantFilter=${tenant.defaultDomainName}&userid=${row.id}`, + modalMessage: 'Are you sure you want to confirm this user as compromised?', + icon: , + },*/ + ]} + placement="end" + visible={ocVisible} + id={row.id} + hideFunction={() => setOCVisible(false)} + /> + + ) + } + + const columns = [ + { + name: 'Risk Last Updated Date', + selector: (row) => row['riskLastUpdatedDateTime'], + sortable: true, + exportSelector: 'riskLastUpdatedDateTime', + }, + { + name: 'User Principal Name', + selector: (row) => row['userPrincipalName'], + sortable: true, + exportSelector: 'userPrincipalName', + }, + { + name: 'Risk Level', + selector: (row) => row['riskLevel'], + sortable: true, + exportSelector: 'riskLevel', + }, + { + name: 'Risk State', + selector: (row) => row['riskState'], + sortable: true, + exportSelector: 'riskState', + }, + { + name: 'Risk Detail', + selector: (row) => row['riskDetail'], + sortable: true, + exportSelector: 'riskDetail', + }, + { + name: 'isProcessing', + selector: (row) => row['isProcessing'], + sortable: true, + exportSelector: 'isProcessing', + }, + { + name: 'isDeleted', + selector: (row) => row['isDeleted'], + sortable: true, + exportSelector: 'isDeleted', + }, + { + name: 'Actions', + cell: Offcanvas, + maxWidth: '100px', + }, + ] + return ( <> { $count: true, $orderby: 'riskLastUpdatedDateTime desc', }, + tableProps: { + selectableRows: true, + actionsList: [ + { + label: 'Dismiss Risk', + color: 'info', + model: true, + modalUrl: `/api/ExecDismissRiskyUser?TenantFilter=${tenant.defaultDomainName}&userid=!id&userDisplayName=!userDisplayName`, + }, + /* TODO Add action for Compromised + { + label: 'Confirm Compromised', + color: 'danger', + model: true, + modalUrl: `/api/ExecBECRemediate?TenantFilter=${tenant.defaultDomainName}&userid=!id`, + },*/ + ], + }, }} /> From e86cc1f0bfd2ec61f6966400c06667c2626a3ecf Mon Sep 17 00:00:00 2001 From: Esco Date: Thu, 18 Jul 2024 16:09:11 +0200 Subject: [PATCH 2/3] Added Research Compromised Account to Risky Users --- src/views/identity/administration/RiskyUsers.jsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/views/identity/administration/RiskyUsers.jsx b/src/views/identity/administration/RiskyUsers.jsx index 977ae479c991..727ee8dd896d 100644 --- a/src/views/identity/administration/RiskyUsers.jsx +++ b/src/views/identity/administration/RiskyUsers.jsx @@ -3,16 +3,23 @@ import { useSelector } from 'react-redux' import { CippPageList } from 'src/components/layout' import { CButton } from '@coreui/react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faEllipsisV, faMinusCircle, faPaperPlane } from '@fortawesome/free-solid-svg-icons' +import { faEllipsisV, faMinusCircle, faPaperPlane, faEye } from '@fortawesome/free-solid-svg-icons' import { CippActionsOffcanvas } from 'src/components/utilities' +import { Link, useSearchParams } from 'react-router-dom' const RiskyUsers = () => { const tenant = useSelector((state) => state.app.currentTenant) const Offcanvas = (row, rowIndex, formatExtraData) => { const [ocVisible, setOCVisible] = useState(false) + const viewLink = `/identity/administration/ViewBec?userId=${row.id}&tenantDomain=${tenant.defaultDomainName}&ID=${row.userPrincipalName}` return ( <> + + + + + setOCVisible(true)}> @@ -57,6 +64,11 @@ const RiskyUsers = () => { }, ]} actions={[ + { + label: 'Research Compromised Account', + link: `/identity/administration/ViewBec?userId=${row.id}&tenantDomain=${tenant.defaultDomainName}&ID=${row.userPrincipalName}`, + color: 'info', + }, { label: 'Dismiss User Risk', color: 'info', From e94a976312f4ea0af501e8749a88edeb2453f185 Mon Sep 17 00:00:00 2001 From: Esco Date: Thu, 18 Jul 2024 18:20:34 +0200 Subject: [PATCH 3/3] Added Research Compromised Account to Risk Detections --- src/views/identity/reports/RiskDetections.jsx | 243 +++++++++++++----- 1 file changed, 173 insertions(+), 70 deletions(-) diff --git a/src/views/identity/reports/RiskDetections.jsx b/src/views/identity/reports/RiskDetections.jsx index 02b84a9b1086..b139fa058161 100644 --- a/src/views/identity/reports/RiskDetections.jsx +++ b/src/views/identity/reports/RiskDetections.jsx @@ -1,80 +1,183 @@ +import React, { useState } from 'react' import { useSelector } from 'react-redux' import { CippPageList } from 'src/components/layout' import { CellTip } from 'src/components/tables' - -const columns = [ - { - name: 'Detected Date', - selector: (row) => row['detectedDateTime'], - sortable: true, - exportSelector: 'detectedDateTime', - }, - { - name: 'User Principal Name', - selector: (row) => row['userPrincipalName'], - sortable: true, - exportSelector: 'userPrincipalName', - }, - { - name: 'Location', - selector: (row) => `${row.location?.city} - ${row.location?.countryOrRegion}`, - sortable: true, - exportSelector: 'Location', - cell: (row) => CellTip(`${row.location?.city} - ${row.location?.countryOrRegion}`), - }, - { - name: 'IP Address', - selector: (row) => row['ipAddress'], - sortable: true, - exportSelector: 'ipAddress', - }, - { - name: 'Risk State', - selector: (row) => row['riskState'], - sortable: true, - exportSelector: 'riskState', - }, - { - name: 'Risk Detail', - selector: (row) => row['riskDetail'], - sortable: true, - exportSelector: 'riskDetail', - }, - { - name: 'Risk Level', - selector: (row) => row['riskLevel'], - sortable: true, - exportSelector: 'riskLevel', - }, - { - name: 'Risk Type', - selector: (row) => row['riskType'], - sortable: true, - exportSelector: 'riskType', - }, - { - name: 'Risk Event Type', - selector: (row) => row['riskEventType'], - sortable: true, - exportSelector: 'riskEventType', - }, - { - name: 'Detection Type', - selector: (row) => row['detectionTimingType'], - sortable: true, - exportSelector: 'detectionTimingType', - }, - { - name: 'Activity', - selector: (row) => row['activity'], - sortable: true, - exportSelector: 'activity', - }, -] +import { CButton } from '@coreui/react' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faEllipsisV, faMinusCircle, faPaperPlane, faEye } from '@fortawesome/free-solid-svg-icons' +import { CippActionsOffcanvas } from 'src/components/utilities' +import { Link, useSearchParams } from 'react-router-dom' const RiskDetections = () => { const tenant = useSelector((state) => state.app.currentTenant) + const Offcanvas = (row, rowIndex, formatExtraData) => { + const [ocVisible, setOCVisible] = useState(false) + const viewLink = `/identity/administration/ViewBec?userId=${row.userId}&tenantDomain=${tenant.defaultDomainName}&ID=${row.userPrincipalName}` + return ( + <> + + + + + + setOCVisible(true)}> + + + setOCVisible(false)} + /> + + ) + } + + const columns = [ + { + name: 'Detected Date', + selector: (row) => row['detectedDateTime'], + sortable: true, + exportSelector: 'detectedDateTime', + minWidth: '150px', + }, + { + name: 'User Principal Name', + selector: (row) => row['userPrincipalName'], + sortable: true, + exportSelector: 'userPrincipalName', + minWidth: '200px', + }, + { + name: 'Location', + selector: (row) => `${row.location?.city} - ${row.location?.countryOrRegion}`, + sortable: true, + exportSelector: 'Location', + cell: (row) => CellTip(`${row.location?.city} - ${row.location?.countryOrRegion}`), + minWidth: '40px', + }, + { + name: 'IP Address', + selector: (row) => row['ipAddress'], + sortable: true, + exportSelector: 'ipAddress', + minWidth: '40px', + }, + { + name: 'Risk State', + selector: (row) => row['riskState'], + sortable: true, + exportSelector: 'riskState', + minWidth: '40px', + }, + { + name: 'Risk Detail', + selector: (row) => row['riskDetail'], + sortable: true, + exportSelector: 'riskDetail', + minWidth: '200px', + }, + { + name: 'Risk Level', + selector: (row) => row['riskLevel'], + sortable: true, + exportSelector: 'riskLevel', + minWidth: '30px', + }, + { + name: 'Risk Type', + selector: (row) => row['riskType'], + sortable: true, + exportSelector: 'riskType', + minWidth: '150px', + }, + { + name: 'Risk Event Type', + selector: (row) => row['riskEventType'], + sortable: true, + exportSelector: 'riskEventType', + minWidth: '150px', + }, + { + name: 'Detection Type', + selector: (row) => row['detectionTimingType'], + sortable: true, + exportSelector: 'detectionTimingType', + minWidth: '50px', + }, + { + name: 'Activity', + selector: (row) => row['activity'], + sortable: true, + exportSelector: 'activity', + minWidth: '40px', + }, + { + name: 'Actions', + cell: Offcanvas, + maxWidth: '100px', + }, + ] + return ( <>