Skip to content

Commit 320e2b3

Browse files
authored
Merge pull request KelvinTegelaar#38 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents dc79cb7 + 9c888be commit 320e2b3

File tree

7 files changed

+218
-29
lines changed

7 files changed

+218
-29
lines changed

src/_nav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ const _nav = [
129129
},
130130
{
131131
component: CNavItem,
132-
name: 'Scheduled Alerts',
132+
name: 'Alerts Configuration',
133133
to: '/tenant/administration/alertsqueue',
134134
},
135135
{

src/data/Extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"type": "HaloPSA",
5757
"cat": "Ticketing",
5858
"forceSyncButton": false,
59-
"helpText": "This integration allows you to use to send alerts to your ticketing system.",
59+
"helpText": "This integration allows you to send alerts to your ticketing system.",
6060
"SettingOptions": [
6161
{
6262
"type": "input",

src/store/api/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const appApi = baseApi.injectEndpoints({
5656
onePerTenant,
5757
sendtoIntegration,
5858
logsToInclude,
59+
Severity,
5960
}) => ({
6061
path: '/api/ExecNotificationConfig',
6162
data: {
@@ -70,6 +71,7 @@ export const appApi = baseApi.injectEndpoints({
7071
addChocoApp: addChocoApp,
7172
onePerTenant: onePerTenant,
7273
logsToInclude: logsToInclude,
74+
Severity: Severity,
7375
sendtoIntegration: sendtoIntegration,
7476
},
7577
method: 'post',

src/views/cipp/CIPPSettings.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,10 @@ const NotificationsSettings = () => {
10781078
label: m,
10791079
value: m,
10801080
})),
1081+
Severity: notificationListResult.data?.Severity?.map((s) => ({
1082+
label: s,
1083+
value: s,
1084+
})),
10811085
}}
10821086
onSubmit={onSubmit}
10831087
render={({ handleSubmit, submitting, values }) => {
@@ -1130,6 +1134,18 @@ const NotificationsSettings = () => {
11301134
]}
11311135
/>
11321136
</CCol>
1137+
<CCol>
1138+
<RFFSelectSearch
1139+
multi={true}
1140+
label="Choose which severity of alert you want to be notified for."
1141+
name="Severity"
1142+
values={[
1143+
{ value: 'Alert', name: 'Alert' },
1144+
{ value: 'Error', name: 'Error' },
1145+
{ value: 'Info', name: 'Info' },
1146+
]}
1147+
/>
1148+
</CCol>
11331149
<CCol>
11341150
<RFFCFormSwitch
11351151
name="onePerTenant"

src/views/tenant/administration/AlertWizard.js

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { faCheck, faExclamationTriangle, faTimes } from '@fortawesome/free-solid
66
import { CippWizard } from 'src/components/layout'
77
import { WizardTableField } from 'src/components/tables'
88
import PropTypes from 'prop-types'
9-
import { RFFCFormSwitch } from 'src/components/forms'
9+
import { RFFCFormSelect, RFFCFormSwitch, RFFSelectSearch } from 'src/components/forms'
1010
import { useLazyGenericPostRequestQuery } from 'src/store/api/app'
11-
11+
import countryList from 'src/data/countryList.json'
1212
const Error = ({ name }) => (
1313
<Field
1414
name={name}
@@ -147,6 +147,85 @@ const AlertWizard = () => {
147147
</CForm>
148148
<hr className="my-4" />
149149
</CippWizard.Page>
150+
<CippWizard.Page
151+
title="Select Webhook Alerts"
152+
description="Select which alerts you want to receive."
153+
>
154+
<center>
155+
<h3 className="text-primary">Step 3</h3>
156+
<h5 className="card-title mb-4">Select webhook alerts</h5>
157+
</center>
158+
<hr className="my-4" />
159+
<CForm onSubmit={handleSubmit}>
160+
<p>
161+
These alerts are received directly from the audit log, and will be processed as soon as
162+
Microsoft sends them to CIPP. These alerts generate a ticket, email or webhook message
163+
per alert, with more information about the alert.
164+
</p>
165+
<CRow>
166+
<CCol>
167+
<RFFSelectSearch
168+
name="EventTypes"
169+
label="Select the environments you want to receive alerts for"
170+
multi
171+
values={[
172+
{ name: 'Exchange', value: 'Audit.Exchange' },
173+
{ name: 'Azure AD', value: 'Audit.AzureActiveDirectory' },
174+
]}
175+
/>
176+
</CCol>
177+
<CCol>
178+
<RFFSelectSearch
179+
name="Operations"
180+
label="Select the operations you want to receive alerts for"
181+
multi
182+
values={[
183+
{ value: 'New-InboxRule', name: 'New Inbox Rules' },
184+
{ value: 'Set-Inboxrule', name: 'Set Inbox Rules' },
185+
{ value: 'Add member to role.', name: 'Adding a member to any admin role' },
186+
{
187+
value: 'Remove Member from a role.',
188+
name: 'Removing a member from any admin role',
189+
},
190+
191+
{ value: 'Disable account.', name: 'Disabling any account' },
192+
{ value: 'Enable account.', name: 'Enabling any account' },
193+
{
194+
value: 'Update StsRefreshTokenValidFrom Timestamp.',
195+
name: 'Revoking a users sessions.',
196+
},
197+
{
198+
value: 'Disable Strong Authentication.',
199+
name: 'MFA has been disabled.',
200+
},
201+
{ value: 'Reset user password.', name: 'Reset user password' },
202+
{ value: 'AdminLoggedIn', name: 'Admin has logged in' },
203+
{
204+
value: 'UserLoggedInFromUnknownLocation',
205+
name: 'A user has logged in from non-allowed location',
206+
},
207+
{
208+
value: 'UserLoggedIn',
209+
name: 'A user has logged in from non-allowed location',
210+
},
211+
]}
212+
/>
213+
</CCol>
214+
<CCol>
215+
<RFFSelectSearch
216+
name="AllowedLocations"
217+
label="Select the countries to not alert on logon from"
218+
multi
219+
values={countryList.map(({ Code, Name }) => ({
220+
value: Code,
221+
name: Name,
222+
}))}
223+
/>
224+
</CCol>
225+
</CRow>
226+
</CForm>
227+
<hr className="my-4" />
228+
</CippWizard.Page>
150229
<CippWizard.Page title="Review and Confirm" description="Confirm the settings to apply">
151230
<center>
152231
<h3 className="text-primary">Step 3</h3>

src/views/tenant/administration/ListAlertsQueue.js

Lines changed: 116 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { useSelector } from 'react-redux'
3-
import { CSpinner, CButton, CCallout } from '@coreui/react'
3+
import { CSpinner, CButton, CCallout, CRow } from '@coreui/react'
44
import { faTrash } from '@fortawesome/free-solid-svg-icons'
55
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
66
import { CippPageList } from 'src/components/layout'
@@ -37,6 +37,69 @@ const ListAlertsQueue = () => {
3737
)
3838
}
3939

40+
const ActionsWebhook = (row, index, column) => {
41+
const handleDeleteStandard = (apiurl, message) => {
42+
ModalService.confirm({
43+
title: 'Confirm',
44+
body: <div>{message}</div>,
45+
onConfirm: () => ExecuteGetRequest({ path: apiurl }),
46+
confirmLabel: 'Continue',
47+
cancelLabel: 'Cancel',
48+
})
49+
}
50+
return (
51+
<CButton
52+
size="sm"
53+
variant="ghost"
54+
color="danger"
55+
onClick={() =>
56+
handleDeleteStandard(
57+
`api/RemoveWebhookAlert?CIPPID=${row.RowKey}&TenantFilter=${row.PartitionKey}`,
58+
'Do you want to delete the queued alert?',
59+
)
60+
}
61+
>
62+
<FontAwesomeIcon icon={faTrash} href="" />
63+
</CButton>
64+
)
65+
}
66+
const webhookcolumns = [
67+
{
68+
name: 'Tenant',
69+
selector: (row) => row['PartitionKey'],
70+
sortable: true,
71+
exportSelector: 'PartitionKey',
72+
},
73+
{
74+
name: 'Expiration',
75+
selector: (row) => row['Expiration'],
76+
sortable: true,
77+
exportSelector: 'Expiration',
78+
},
79+
{
80+
name: 'Monitored Resource',
81+
selector: (row) => row['Resource'],
82+
sortable: true,
83+
exportSelector: 'Resource',
84+
},
85+
{
86+
name: 'Monitored Actions',
87+
selector: (row) => row['Operations'],
88+
sortable: true,
89+
exportSelector: 'Operations',
90+
},
91+
{
92+
name: 'Webhook URL',
93+
selector: (row) => row['WebhookNotificationUrl'],
94+
sortable: true,
95+
exportSelector: 'WebhookNotificationUrl',
96+
},
97+
{
98+
name: 'Actions',
99+
cell: ActionsWebhook,
100+
},
101+
]
102+
40103
const columns = [
41104
{
42105
name: 'Tenant',
@@ -174,30 +237,58 @@ const ListAlertsQueue = () => {
174237
{getResults.isError && (
175238
<CCallout color="danger">Could not connect to API: {getResults.error.message}</CCallout>
176239
)}
177-
<CippPageList
178-
capabilities={{ allTenants: true, helpContext: 'https://google.com' }}
179-
title="Scheduled Alerts"
180-
tenantSelector={false}
181-
datatable={{
182-
keyField: 'id',
183-
columns,
184-
reportName: `AlertsQueue-List`,
185-
path: '/api/ListAlertsQueue',
186-
params: { TenantFilter: tenant?.defaultDomainName },
187-
tableProps: {
188-
selectableRows: true,
189-
actionsList: [
190-
{
191-
label: 'Delete alerts',
192-
color: 'info',
193-
modal: true,
194-
modalUrl: `/api/RemoveQueuedAlert?ID=!tenantId`,
195-
modalMessage: 'Are you sure you want to delete these alerts?',
196-
},
197-
],
198-
},
199-
}}
200-
/>
240+
<CRow className="mb-3">
241+
<CippPageList
242+
capabilities={{ allTenants: true, helpContext: 'https://google.com' }}
243+
title="Scheduled Classic Alerts"
244+
tenantSelector={false}
245+
datatable={{
246+
keyField: 'id',
247+
columns,
248+
reportName: `AlertsQueue-List`,
249+
path: '/api/ListAlertsQueue',
250+
params: { TenantFilter: tenant?.defaultDomainName },
251+
tableProps: {
252+
selectableRows: true,
253+
actionsList: [
254+
{
255+
label: 'Delete alerts',
256+
color: 'info',
257+
modal: true,
258+
modalUrl: `/api/RemoveQueuedAlert?ID=!tenantId`,
259+
modalMessage: 'Are you sure you want to delete these alerts?',
260+
},
261+
],
262+
},
263+
}}
264+
/>
265+
</CRow>
266+
<CRow className="mb-3">
267+
<CippPageList
268+
capabilities={{ allTenants: true, helpContext: 'https://google.com' }}
269+
title="Webhook Alerts"
270+
tenantSelector={false}
271+
datatable={{
272+
keyField: 'id',
273+
columns: webhookcolumns,
274+
reportName: `AlertsQueue-List`,
275+
path: '/api/ListWebhookAlert',
276+
params: { TenantFilter: tenant?.defaultDomainName },
277+
tableProps: {
278+
selectableRows: true,
279+
actionsList: [
280+
{
281+
label: 'Delete webhook',
282+
color: 'info',
283+
modal: true,
284+
modalUrl: `/api/RemoveWebhookAlert?CIPPID=!CIPPID&tenantfilter=!tenantid`,
285+
modalMessage: 'Are you sure you want to delete this webhook alert?',
286+
},
287+
],
288+
},
289+
}}
290+
/>
291+
</CRow>
201292
</div>
202293
)
203294
}

src/views/tenant/administration/ListLicences.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const columns = [
4242
name: 'Estimated Term',
4343
selector: (row) => row['EstTerm'],
4444
sortable: true,
45+
cell: (row) => CellTip(row['EstTerm']),
4546
exportSelector: 'EstTerm',
4647
},
4748
{

0 commit comments

Comments
 (0)