Skip to content

Commit

Permalink
Merge pull request #2724 from Ren-Roros-Digital/listmalwarefilters
Browse files Browse the repository at this point in the history
Added Report for Defender Policys
  • Loading branch information
KelvinTegelaar authored Jul 26, 2024
2 parents 779047d + 9213b34 commit d2e075a
Show file tree
Hide file tree
Showing 8 changed files with 959 additions and 79 deletions.
19 changes: 17 additions & 2 deletions src/_nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -790,8 +790,23 @@ const _nav = [
},
{
component: CNavItem,
name: 'Phishing Policies',
to: '/email/reports/phishing-policies',
name: 'Anti-Phishing Filters',
to: '/email/reports/antiphishing-filters',
},
{
component: CNavItem,
name: 'Malware Filters',
to: '/email/reports/malware-filters',
},
{
component: CNavItem,
name: 'Safe Links Filters',
to: '/email/reports/safelinks-filters',
},
{
component: CNavItem,
name: 'Safe Attachments Filters',
to: '/email/reports/safeattachments-filters',
},
{
component: CNavItem,
Expand Down
5 changes: 4 additions & 1 deletion src/importsMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ import React from 'react'
"/email/reports/mailbox-cas-settings": React.lazy(() => import('./views/email-exchange/reports/MailboxClientAccessSettingsList')),
"/email/reports/message-trace": React.lazy(() => import('./views/email-exchange/reports/MessageTrace')),
"/cipp/user-settings": React.lazy(() => import('./views/cipp/UserSettings')),
"/email/reports/phishing-policies": React.lazy(() => import('./views/email-exchange/reports/PhishingPoliciesList')),
"/email/reports/antiphishing-filters": React.lazy(() => import('./views/email-exchange/reports/AntiPhishingFilters')),
"/email/reports/malware-filters": React.lazy(() => import('./views/email-exchange/reports/MalwareFilters')),
"/email/reports/safelinks-filters": React.lazy(() => import('./views/email-exchange/reports/SafeLinksFilters')),
"/email/reports/safeattachments-filters": React.lazy(() => import('./views/email-exchange/reports/SafeAttachmentsFilters')),
"/security/incidents/list-alerts": React.lazy(() => import('./views/security/incidents/ListAlerts')),
"/security/incidents/list-incidents": React.lazy(() => import('./views/security/incidents/ListIncidents')),
"/security/reports/list-device-compliance": React.lazy(() => import('./views/security/reports/ListDeviceComplianceReport')),
Expand Down
24 changes: 21 additions & 3 deletions src/routes.json
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,27 @@
"allowedRoles": ["admin", "editor", "readonly"]
},
{
"name": "Phishing Policies",
"path": "/email/reports/phishing-policies",
"component": "views/email-exchange/reports/PhishingPoliciesList",
"path": "/email/reports/antiphishing-filters",
"name": "Anti Phishing Filters",
"component": "views/email-exchange/reports/AntiPhishingFilters",
"allowedRoles": ["admin", "editor", "readonly"]
},
{
"path": "/email/reports/malware-filters",
"name": "Malware Filters",
"component": "views/email-exchange/reports/MalwareFilters",
"allowedRoles": ["admin", "editor", "readonly"]
},
{
"path": "/email/reports/safelinks-filters",
"name": "Safe Links Filters",
"component": "views/email-exchange/reports/SafeLinksFilters",
"allowedRoles": ["admin", "editor", "readonly"]
},
{
"path": "/email/reports/safeattachments-filters",
"name": "Safe Attachment Filters",
"component": "views/email-exchange/reports/SafeAttachmentsFilters",
"allowedRoles": ["admin", "editor", "readonly"]
},
{
Expand Down
293 changes: 293 additions & 0 deletions src/views/email-exchange/reports/AntiPhishingFilters.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,293 @@
import { CButton } from '@coreui/react'
import { faBan, faBook, faCheck, faEllipsisV, faTrash } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import React, { useState } from 'react'
import { CippActionsOffcanvas } from 'src/components/utilities'
import { useSelector } from 'react-redux'
import { CippPageList } from 'src/components/layout'
import { cellDateFormatter, cellBooleanFormatter, CellTip } from 'src/components/tables'
import { cellTableFormatter } from 'src/components/tables/CellTable'

const ListAntiPhishingFilters = () => {
const tenant = useSelector((state) => state.app.currentTenant)

const Offcanvas = (row, rowIndex, formatExtraData) => {
const [ocVisible, setOCVisible] = useState(false)

return (
<>
<CButton size="sm" color="link" onClick={() => setOCVisible(true)}>
<FontAwesomeIcon icon={faEllipsisV} />
</CButton>
<CippActionsOffcanvas
title="Extended Information"
extendedInfo={[
{
label: 'Rule Name',
value: `${row.RuleName}`,
},
{
label: 'Policy Name',
value: `${row.Name}`,
},
{
label: 'Enabled',
value: `${row.State}`,
},
{
label: 'Creation Date',
value: `${row.WhenCreated}`,
},
{
label: 'Last Modified Date',
value: `${row.WhenChanged}`,
},
]}
actions={[
{
label: 'Enable Rule',
color: 'info',
icon: <FontAwesomeIcon icon={faCheck} className="me-2" />,
modal: true,
modalUrl: `/api/EditAntiPhishingFilter?State=Enable&TenantFilter=${tenant.defaultDomainName}&RuleName=${row.RuleName}`,
modalMessage: 'Are you sure you want to enable this rule?',
},
{
label: 'Disable Rule',
color: 'info',
icon: <FontAwesomeIcon icon={faBan} className="me-2" />,
modal: true,
modalUrl: `/api/EditAntiPhishingFilter?State=Disable&TenantFilter=${tenant.defaultDomainName}&RuleName=${row.RuleName}`,
modalMessage: 'Are you sure you want to disable this rule?',
},
/*{
label: 'Delete Rule',
color: 'danger',
modal: true,
icon: <FontAwesomeIcon icon={faTrash} className="me-2" />,
modalUrl: `/api/RemoveAntiPhishingFilter?TenantFilter=${tenant.defaultDomainName}&RuleName=${row.RuleName}`,
modalMessage: 'Are you sure you want to delete this rule?',
},*/
]}
placement="end"
visible={ocVisible}
id={row.id}
hideFunction={() => setOCVisible(false)}
/>
</>
)
}

const columns = [
{
name: 'Rule Name',
selector: (row) => row['RuleName'],
sortable: true,
exportSelector: 'RuleName',
},
{
name: 'Policy Name',
selector: (row) => row['Name'],
sortable: true,
exportSelector: 'Name',
},
{
name: 'Enabled',
selector: (row) => row['State'],
exportSelector: 'State',
cell: cellBooleanFormatter(),
maxWidth: '40px',
},
{
name: 'Priority',
selector: (row) => row['Priority'],
sortable: true,
exportSelector: 'Priority',
maxWidth: '40px',
},
{
name: 'Recipient Domains',
selector: (row) => row['RecipientDomainIs'],
sortable: true,
exportSelector: 'RecipientDomainIs',
cell: cellTableFormatter('RecipientDomainIs'),
},
{
name: 'Excluded Domains',
selector: (row) => row['ExcludedDomains'],
sortable: true,
exportSelector: 'ExcludedDomains',
cell: cellTableFormatter('ExcludedDomains'),
},
{
name: 'Excluded Senders',
selector: (row) => row['ExcludedSenders'],
sortable: true,
exportSelector: 'ExcludedSenders',
cell: cellTableFormatter('ExcludedSenders'),
},
{
name: 'PhishThresholdLevel',
selector: (row) => row['PhishThresholdLevel'],
sortable: true,
exportSelector: 'PhishThresholdLevel',
},
{
name: 'Mailbox Intelligence',
selector: (row) => row['EnableMailboxIntelligence'],
exportSelector: 'EnableMailboxIntelligence',
cell: cellBooleanFormatter(),
maxWidth: '40px',
},
{
name: 'Mailbox Intelligence Protection',
selector: (row) => row['EnableMailboxIntelligenceProtection'],
exportSelector: 'EnableMailboxIntelligenceProtection',
cell: cellBooleanFormatter(),
maxWidth: '40px',
},
{
name: 'Spoof Intelligence',
selector: (row) => row['EnableSpoofIntelligence'],
exportSelector: 'EnableSpoofIntelligence',
cell: cellBooleanFormatter(),
maxWidth: '40px',
},
{
name: 'First Contact Safety Tips',
selector: (row) => row['EnableFirstContactSafetyTips'],
exportSelector: 'EnableFirstContactSafetyTips',
cell: cellBooleanFormatter(),
maxWidth: '40px',
},
{
name: 'Similar Users Safety Tips',
selector: (row) => row['EnableSimilarUsersSafetyTips'],
exportSelector: 'EnableSimilarUsersSafetyTips',
cell: cellBooleanFormatter(),
maxWidth: '40px',
},
{
name: 'Similar Domain Safety Tips',
selector: (row) => row['EnableSimilarDomainsSafetyTips'],
exportSelector: 'EnableSimilarDomainsSafetyTips',
cell: cellBooleanFormatter(),
maxWidth: '40px',
},
{
name: 'Unusual Characters Safety Tips',
selector: (row) => row['EnableUnusualCharactersSafetyTips'],
exportSelector: 'EnableUnusualCharactersSafetyTips',
cell: cellBooleanFormatter(),
maxWidth: '40px',
},
{
name: 'Unauthenticated Sender',
selector: (row) => row['EnableUnauthenticatedSender'],
exportSelector: 'EnableUnauthenticatedSender',
cell: cellBooleanFormatter(),
maxWidth: '40px',
},
{
name: 'ViaTag',
selector: (row) => row['EnableViaTag'],
exportSelector: 'EnableViaTag',
cell: cellBooleanFormatter(),
maxWidth: '40px',
},
{
name: 'Organization Domains Protection',
selector: (row) => row['EnableOrganizationDomainsProtection'],
exportSelector: 'EnableOrganizationDomainsProtection',
cell: cellBooleanFormatter(),
},
{
name: 'Authentication Fail Action',
selector: (row) => row['AuthenticationFailAction'],
exportSelector: 'AuthenticationFailAction',
maxWidt: '100px',
},
{
name: 'Spoof Quarantine Tag',
selector: (row) => row['SpoofQuarantineTag'],
exportSelector: 'SpoofQuarantineTag',
maxWidth: '100px',
},
{
name: 'MailboxIntelligence Protection Action',
selector: (row) => row['MailboxIntelligenceProtectionAction'],
exportSelector: 'MailboxIntelligenceProtectionAction',
maxWidth: '100px',
},
{
name: 'Mailbox Intelligence Quarantine Tag',
selector: (row) => row['MailboxIntelligenceQuarantineTag'],
exportSelector: 'MailboxIntelligenceQuarantineTag',
maxWidth: '100px',
},
{
name: 'Targeted UserProtection Action',
selector: (row) => row['TargetedUserProtectionAction'],
exportSelector: 'TargetedUserProtectionAction',
maxWidth: '100px',
},
{
name: 'Targeted UserQuarantine Tag',
selector: (row) => row['TargetedUserQuarantineTag'],
exportSelector: 'TargetedUserQuarantineTag',
maxWidth: '100px',
},
{
name: 'Targeted Domain Protection Action',
selector: (row) => row['TargetedDomainProtectionAction'],
exportSelector: 'TargetedDomainProtectionAction',
maxWidth: '100px',
},
{
name: 'Targeted Domain Quarantine Tag',
selector: (row) => row['TargetedDomainQuarantineTag'],
exportSelector: 'TargetedDomainQuarantineTag',
maxWidth: '100px',
},
{
name: 'Creation Date',
selector: (row) => row['WhenCreated'],
sortable: true,
exportSelector: 'WhenCreated',
cell: cellDateFormatter(),
maxWidth: '150px',
},
{
name: 'Last Modified Date',
selector: (row) => row['WhenChanged'],
sortable: true,
exportSelector: 'WhenChanged',
cell: cellDateFormatter(),
maxWidth: '150px',
},
{
name: 'Actions',
cell: Offcanvas,
maxWidth: '80px',
},
]

return (
<>
<CippPageList
title="List of Anti-Phishing Filters"
capabilities={{ allTenants: false, helpContext: 'https://google.com' }}
datatable={{
columns: columns,
path: '/api/ListAntiPhishingFilters',
reportName: `${tenant?.defaultDomainName}-AntiPhishingFilters`,
params: {
TenantFilter: tenant.defaultDomainName,
},
}}
/>
</>
)
}

export default ListAntiPhishingFilters
Loading

0 comments on commit d2e075a

Please sign in to comment.