Skip to content

Commit ebe99ca

Browse files
Merge pull request #2031 from KelvinTegelaar/dev
Dev to release
2 parents f6bf6be + a804f5f commit ebe99ca

File tree

22 files changed

+667
-101
lines changed

22 files changed

+667
-101
lines changed

public/version_latest.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.9.1
1+
5.0.0

src/_nav.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ const _nav = [
239239
name: 'Deploy CA Policies',
240240
to: '/tenant/conditional/deploy',
241241
},
242+
{
243+
component: CNavItem,
244+
name: 'CA Vacation Mode',
245+
to: '/tenant/conditional/deploy-vacation',
246+
},
242247
{
243248
component: CNavItem,
244249
name: 'CA Templates',

src/components/forms/RFFComponents.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,17 @@ export const RFFCFormInput = ({
137137
disabled = false,
138138
spellCheck = true,
139139
autoFocus = false,
140+
onChange,
140141
}) => {
141142
return (
142143
<Field name={name} validate={validate}>
143144
{({ input, meta }) => {
145+
const handleChange = onChange
146+
? (e) => {
147+
input.onChange(e)
148+
onChange(e)
149+
}
150+
: input.onChange
144151
return (
145152
<div className={className}>
146153
{label && <CFormLabel htmlFor={name}>{label}</CFormLabel>}
@@ -155,6 +162,7 @@ export const RFFCFormInput = ({
155162
placeholder={placeholder}
156163
spellCheck={spellCheck}
157164
autoFocus={autoFocus}
165+
onChange={handleChange}
158166
/>
159167
<RFFCFormFeedback meta={meta} />
160168
</div>

src/components/layout/AppHeader.jsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,8 @@ import {
1616
} from '@coreui/react'
1717
import { AppHeaderSearch } from 'src/components/header'
1818
import { TenantSelector } from '../utilities'
19-
import cyberdrainlogolight from 'src/assets/images/CIPP.png'
20-
import cyberdrainlogodark from 'src/assets/images/CIPP_Dark.png'
21-
2219
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
23-
import {
24-
faBars,
25-
faCaretSquareLeft,
26-
faCaretSquareRight,
27-
faHamburger,
28-
faStroopwafel,
29-
} from '@fortawesome/free-solid-svg-icons'
20+
import { faBars } from '@fortawesome/free-solid-svg-icons'
3021
import { setCurrentTheme, setUserSettings, toggleSidebarShow } from 'src/store/features/app'
3122
import { useMediaPredicate } from 'react-media-hook'
3223
import { useGenericGetRequestQuery, useLoadAlertsDashQuery } from 'src/store/api/app'

src/components/layout/AppSidebar.jsx

Lines changed: 7 additions & 6 deletions
Large diffs are not rendered by default.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React from 'react'
2+
import { CBadge, CTooltip } from '@coreui/react'
3+
import CellBoolean from 'src/components/tables/CellBoolean.jsx'
4+
import cellTable from './CellTable'
5+
6+
export function CellTip(cell, overflow = false) {
7+
return (
8+
<CTooltip content={String(cell)}>
9+
<div className="celltip-content-nowrap">{String(cell)}</div>
10+
</CTooltip>
11+
)
12+
}
13+
export const cellMathFormatter =
14+
({ col } = {}) =>
15+
(row) => {
16+
const evaluateCalculation = (calculation, row) => {
17+
try {
18+
const formattedCalculation = calculation.replace(/\b\w+(\.\w+|\[\d+\])*\b/g, (key) => {
19+
if (!isNaN(key)) {
20+
return parseFloat(key)
21+
}
22+
23+
const path = key.split(/\.|\[(\d+)\]/).filter(Boolean) // Splits keys and array indices
24+
let currentObject = row
25+
for (const prop of path) {
26+
if (currentObject && prop in currentObject) {
27+
currentObject = currentObject[prop]
28+
} else if (!isNaN(prop)) {
29+
// Checks if the prop is an array index
30+
currentObject = currentObject[parseInt(prop, 10)]
31+
} else {
32+
throw new Error(`Property '${prop}' not found in row`)
33+
}
34+
}
35+
36+
return parseFloat(currentObject)
37+
})
38+
39+
return Number(eval(formattedCalculation))
40+
} catch (e) {
41+
console.error(e)
42+
return null
43+
}
44+
}
45+
46+
const result = evaluateCalculation(col.value, row)
47+
48+
if (result === null) {
49+
return 'N/A'
50+
}
51+
52+
if (col.showAs === 'percentage') {
53+
return `${result.toFixed(2)}%`
54+
} else {
55+
return result.toFixed(2)
56+
}
57+
}
58+
59+
export default cellMathFormatter

src/components/utilities/CippActionsOffcanvas.jsx

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,34 @@ export default function CippActionsOffcanvas(props) {
3838
}
3939
const handleModal = useCallback(
4040
(modalMessage, modalUrl, modalType = 'GET', modalBody, modalInput, modalDropdown) => {
41+
const handlePostConfirm = () => {
42+
const selectedValue = inputRef.current.value
43+
console.log(inputRef)
44+
let additionalFields = {}
45+
46+
if (inputRef.current.nodeName === 'SELECT') {
47+
const selectedItem = dropDownInfo.data.find(
48+
(item) => item[modalDropdown.valueField] === selectedValue,
49+
)
50+
if (selectedItem && modalDropdown.addedField) {
51+
Object.keys(modalDropdown.addedField).forEach((key) => {
52+
additionalFields[key] = selectedItem[modalDropdown.addedField[key]]
53+
})
54+
}
55+
}
56+
const postRequestBody = {
57+
...modalBody,
58+
...additionalFields,
59+
input: selectedValue,
60+
}
61+
// Send the POST request
62+
genericPostRequest({
63+
path: modalUrl,
64+
values: postRequestBody,
65+
})
66+
}
67+
68+
// Modal setup for GET, codeblock, and other types
4169
if (modalType === 'GET') {
4270
ModalService.confirm({
4371
body: (
@@ -82,12 +110,7 @@ export default function CippActionsOffcanvas(props) {
82110
</div>
83111
),
84112
title: 'Confirm',
85-
onConfirm: () => [
86-
genericPostRequest({
87-
path: modalUrl,
88-
values: { ...modalBody, ...{ input: inputRef.current.value } },
89-
}),
90-
],
113+
onConfirm: handlePostConfirm,
91114
})
92115
}
93116
},
@@ -99,7 +122,6 @@ export default function CippActionsOffcanvas(props) {
99122
modalContent,
100123
],
101124
)
102-
103125
useEffect(() => {
104126
if (dropDownInfo.isFetching) {
105127
handleModal(

src/data/BPAField.schema.v1.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@
8787
{
8888
"const": "number",
8989
"title": "Displays as a numerical value"
90+
},
91+
{
92+
"const": "math",
93+
"title": "Displays as a calculated value"
9094
}
9195
]
9296
}

src/data/standards.json

Lines changed: 78 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,30 @@
3737
{
3838
"name": "standards.AuditLog",
3939
"cat": "Global Standards",
40-
"helpText": "Enables the Unified Audit Log for tracking and auditing activities; also runs Enable-OrganizationCustomization if necessary.",
40+
"helpText": "Enables the Unified Audit Log for tracking and auditing activities. Also runs Enable-OrganizationCustomization if necessary.",
4141
"addedComponent": [],
4242
"label": "Enable the Unified Audit Log",
4343
"impact": "Low Impact",
4444
"impactColour": "info"
4545
},
46+
{
47+
"name": "standards.PhishProtection",
48+
"cat": "Global Standards",
49+
"helpText": "Adds branding to the logon page that only appears if the url is not login.microsoftonline.com. This potentially prevents AITM attacks via EvilNginx. This will also automatically generate alerts if a clone of your login page has been found. (P1 or higher required)",
50+
"addedComponent": [],
51+
"label": "Enable Phishing Protection system via branding CSS",
52+
"impact": "Low Impact",
53+
"impactColour": "info"
54+
},
55+
{
56+
"name": "standards.EnableCustomerLockbox",
57+
"cat": "Global Standards",
58+
"helpText": "Enables Customer Lockbox that offers an approval process for Microsoft support to access organization data",
59+
"addedComponent": [],
60+
"label": "Enable Customer Lockbox",
61+
"impact": "Low Impact",
62+
"impactColour": "info"
63+
},
4664
{
4765
"name": "standards.AnonReportDisable",
4866
"cat": "Global Standards",
@@ -55,7 +73,7 @@
5573
{
5674
"name": "standards.DisableGuestDirectory",
5775
"cat": "Global Standards",
58-
"helpText": "Disables Guest access to enumerate directory objects. This prevents guest users from see other users or guests in the directory.",
76+
"helpText": "Disables Guest access to enumerate directory objects. This prevents guest users from seeing other users or guests in the directory.",
5977
"addedComponent": [],
6078
"label": "Restrict guest user access to directory objects",
6179
"impact": "Low Impact",
@@ -64,7 +82,7 @@
6482
{
6583
"name": "standards.DisableBasicAuthSMTP",
6684
"cat": "Global Standards",
67-
"helpText": "Disables SMTP AUTH for the organization. This is the default for new tenants. Sets the entire tenant to no longer allow SMTP AUTH, and as such has no exclusions.",
85+
"helpText": "Disables SMTP AUTH for the organization and all users. This is the default for new tenants. ",
6886
"addedComponent": [],
6987
"label": "Disable SMTP Basic Authentication",
7088
"impact": "Medium Impact",
@@ -84,7 +102,7 @@
84102
"cat": "Entra (AAD) Standards",
85103
"helpText": "Enables the tenant to use LAPS. You must still create a policy for LAPS to be active on all devices. Use the template standards to deploy this by default.",
86104
"addedComponent": [],
87-
"label": "Enable LAPs on the tenant",
105+
"label": "Enable LAPS on the tenant",
88106
"impact": "Low Impact",
89107
"impactColour": "info"
90108
},
@@ -102,7 +120,7 @@
102120
"name": "standards.allowOTPTokens",
103121
"helpText": "Allows you to use MS authenticator OTP token generator",
104122
"addedComponent": [],
105-
"label": "Enable OTP via Authenticator.",
123+
"label": "Enable OTP via Authenticator",
106124
"impact": "Low Impact",
107125
"impactColour": "info"
108126
},
@@ -221,7 +239,7 @@
221239
"name": "standards.NudgeMFA.enable",
222240
"helpText": "Enables registration campaign for the tenant",
223241
"addedComponent": [],
224-
"label": "Request to setup Authenticator if not setup yet.",
242+
"label": "Request to setup Authenticator if not setup yet",
225243
"impact": "Low Impact",
226244
"impactColour": "info"
227245
},
@@ -230,7 +248,7 @@
230248
"name": "standards.NudgeMFA.disable",
231249
"helpText": "Disables registration campaign for the tenant",
232250
"addedComponent": [],
233-
"label": "Disables the request to setup Authenticator if setup.",
251+
"label": "Disables the request to setup Authenticator if setup",
234252
"impact": "Low Impact",
235253
"impactColour": "info"
236254
},
@@ -290,16 +308,16 @@
290308
"label": "Allowed application IDs, comma separated"
291309
}
292310
],
293-
"label": "Require admin consent for applications (Prevent OAuth phishing.)",
294-
"impact": "Medium impact",
311+
"label": "Require admin consent for applications (Prevent OAuth phishing)",
312+
"impact": "Medium Impact",
295313
"impactColour": "warning"
296314
},
297315
{
298316
"cat": "Entra (AAD) Standards",
299317
"name": "standards.OauthConsentLowSec",
300318
"helpText": "Sets the default oauth consent level so users can consent to applications that have low risks.",
301-
"label": "Allow users to consent to applications with low security risk (Prevent OAuth phishing. Lower impact, less secure.)",
302-
"impact": "Medium impact",
319+
"label": "Allow users to consent to applications with low security risk (Prevent OAuth phishing. Lower impact, less secure)",
320+
"impact": "Medium Impact",
303321
"impactColour": "warning"
304322
},
305323
{
@@ -364,7 +382,7 @@
364382
{
365383
"name": "standards.OutBoundSpamAlert",
366384
"cat": "Exchange Standards",
367-
"helpText": "Set the Outbound Spam Alert e-mail address.",
385+
"helpText": "Set the Outbound Spam Alert e-mail address",
368386
"addedComponent": [
369387
{
370388
"type": "input",
@@ -406,7 +424,23 @@
406424
]
407425
}
408426
],
409-
"label": "Enable or disable 'external' warning in Outlook.",
427+
"label": "Enable or disable 'external' warning in Outlook",
428+
"impact": "Low Impact",
429+
"impactColour": "info"
430+
},
431+
{
432+
"name": "standards.EnableMailTips",
433+
"cat": "Exchange Standards",
434+
"helpText": "Enables all MailTips in Outlook. MailTips are the notifications Outlook and Outlook on the web shows when an email you create, meets some requirements",
435+
"addedComponent": [
436+
{
437+
"type": "number",
438+
"name": "standards.EnableMailTips.MailTipsLargeAudienceThreshold",
439+
"label": "Number of recipients to trigger the large audience MailTip (Default is 25)",
440+
"placeholder": "Enter a profile name"
441+
}
442+
],
443+
"label": "Enable all MailTips",
410444
"impact": "Low Impact",
411445
"impactColour": "info"
412446
},
@@ -437,20 +471,29 @@
437471
"impact": "Low Impact",
438472
"impactColour": "info"
439473
},
474+
{
475+
"name": "standards.EnableMailboxAuditing",
476+
"cat": "Exchange Standards",
477+
"helpText": "Enables Mailbox auditing for all mailboxes and on tenant level. By default Microsoft does not enable mailbox auditing for Resource Mailboxes, Public Folder Mailboxes and DiscoverySearch Mailboxes. Unified Audit Log needs to be enabled for this standard to function.",
478+
"addedComponent": [],
479+
"label": "Enable Mailbox auditing",
480+
"impact": "Low Impact",
481+
"impactColour": "info"
482+
},
440483
{
441484
"name": "standards.SendReceiveLimitTenant",
442485
"cat": "Exchange Standards",
443-
"helpText": "Sets the Send and Receive limits for new users. Valid values are 1KB to 150MB. Invalid values will be set to EXO standard of 35MB,36MB",
486+
"helpText": "Sets the Send and Receive limits for new users. Valid values are 1MB to 150MB",
444487
"addedComponent": [
445488
{
446489
"type": "number",
447490
"name": "standards.SendReceiveLimitTenant.SendLimit",
448-
"label": "Send limit in MB"
491+
"label": "Send limit in MB (Default is 35)"
449492
},
450493
{
451494
"type": "number",
452495
"name": "standards.SendReceiveLimitTenant.ReceiveLimit",
453-
"label": "Receive Limit in MB"
496+
"label": "Receive Limit in MB (Default is 36)"
454497
}
455498
],
456499
"label": "Set send/receive size limits",
@@ -507,6 +550,24 @@
507550
"impact": "Low Impact",
508551
"impactColour": "info"
509552
},
553+
{
554+
"name": "standards.DisableExternalCalendarSharing",
555+
"cat": "Exchange Standards",
556+
"helpText": "Disables the ability for users to share their calendar with external users. Only for the default policy, so exclusions can be made if needed.",
557+
"addedComponent": [],
558+
"label": "Disable external calendar sharing",
559+
"impact": "Low Impact",
560+
"impactColour": "info"
561+
},
562+
{
563+
"name": "standards.DisableAdditionalStorageProviders",
564+
"cat": "Exchange Standards",
565+
"helpText": "Disables the ability for users to open files in Outlook on the Web, from other providers such as Box, Dropbox, Facebook, Google Drive, OneDrive Personal, etc.",
566+
"addedComponent": [],
567+
"label": "Disable additional storage providers in OWA",
568+
"impact": "Low Impact",
569+
"impactColour": "info"
570+
},
510571
{
511572
"name": "standards.SafeSendersDisable",
512573
"cat": "Exchange Standards",
@@ -616,7 +677,7 @@
616677
{
617678
"name": "standards.DisableAddShortcutsToOneDrive",
618679
"cat": "SharePoint Standards",
619-
"helpText": "When the feature is disabled the option Add shortcut to My files will be removed; any folders that have already been added will remain on the user's computer.",
680+
"helpText": "When the feature is disabled the option Add shortcut to OneDrive will be removed. Any folders that have already been added will remain on the user's computer.",
620681
"disabledFeatures": {
621682
"report": true,
622683
"warn": true,

0 commit comments

Comments
 (0)