Skip to content

Commit 55a256f

Browse files
Merge pull request #3356 from kris6673/devices
Change device actions to POST and add stale device cleanup standard
2 parents a5ca728 + e7deb88 commit 55a256f

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

src/data/standards.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,30 @@
674674
"powershellEquivalent": "",
675675
"recommendedBy": []
676676
},
677+
{
678+
"name": "standards.StaleEntraDevices",
679+
"cat": "Entra (AAD) Standards",
680+
"tag": ["highimpact", "CIS"],
681+
"helpText": "Cleans up Entra devices that have not connected/signed in for the specified number of days.",
682+
"docsDescription": "Cleans up Entra devices that have not connected/signed in for the specified number of days. First disables and later deletes the devices. More info can be found in the [Microsoft documentation](https://learn.microsoft.com/en-us/entra/identity/devices/manage-stale-devices)",
683+
"addedComponent": [
684+
{
685+
"type": "number",
686+
"name": "standards.StaleEntraDevices.deviceAgeThreshold",
687+
"label": "Days before stale(Dont set below 30)"
688+
}
689+
],
690+
"disabledFeatures": {
691+
"report": false,
692+
"warn": false,
693+
"remediate": true
694+
},
695+
"label": "Cleanup stale Entra devices",
696+
"impact": "High Impact",
697+
"impactColour": "danger",
698+
"powershellEquivalent": "Remove-MgDevice, Update-MgDevice or Graph API",
699+
"recommendedBy": []
700+
},
677701
{
678702
"name": "standards.UndoOauth",
679703
"cat": "Entra (AAD) Standards",

src/pages/identity/administration/devices/index.js

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,51 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; // had to add
44
const Page = () => {
55
const pageTitle = "Devices";
66
const actions = [
7-
// these are currently GET requests that should be converted to POST requests.
87
{
98
label: "Enable Device",
10-
type: "GET",
9+
type: "POST",
1110
url: "/api/ExecDeviceDelete",
1211
data: {
1312
ID: "id",
14-
Action: "!Enable",
13+
action: "!Enable",
1514
},
1615
confirmText: "Are you sure you want to enable this device?",
1716
multiPost: false,
1817
},
1918
{
2019
label: "Disable Device",
21-
type: "GET",
20+
type: "POST",
2221
url: "/api/ExecDeviceDelete",
2322
data: {
2423
ID: "id",
25-
Action: "!Disable",
24+
action: "!Disable",
2625
},
2726
confirmText: "Are you sure you want to disable this device?",
2827
multiPost: false,
2928
},
3029
{
31-
label: "Retrieve Bitlocker Keys",
30+
label: "Retrieve BitLocker Keys",
3231
type: "GET",
3332
url: "/api/ExecGetRecoveryKey",
3433
data: {
3534
GUID: "id",
3635
},
37-
confirmText: "Are you sure you want to retrieve the Bitlocker keys?",
36+
confirmText: "Are you sure you want to retrieve the BitLocker keys?",
3837
multiPost: false,
3938
},
4039
{
4140
label: "Delete Device",
42-
type: "GET",
41+
type: "POST",
4342
url: "/api/ExecDeviceDelete",
4443
data: {
4544
ID: "id",
46-
Action: "!Delete",
45+
action: "!Delete",
4746
},
4847
confirmText: "Are you sure you want to delete this device?",
4948
multiPost: false,
5049
},
5150
];
5251

53-
const offCanvas = {
54-
extendedInfoFields: ["createdDateTime", "displayName", "id"],
55-
actions: actions,
56-
};
57-
5852
return (
5953
<CippTablePage
6054
title={pageTitle}
@@ -66,7 +60,6 @@ const Page = () => {
6660
}}
6761
apiDataKey="Results"
6862
actions={actions}
69-
offCanvas={offCanvas}
7063
simpleColumns={[
7164
"displayName",
7265
"accountEnabled",
@@ -77,6 +70,7 @@ const Page = () => {
7770
"operatingSystem",
7871
"operatingSystemVersion",
7972
"profileType",
73+
"approximateLastSignInDateTime",
8074
]}
8175
/>
8276
);

0 commit comments

Comments
 (0)