Skip to content

Change device actions to POST and add stale device cleanup standard #3356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/data/standards.json
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,30 @@
"powershellEquivalent": "",
"recommendedBy": []
},
{
"name": "standards.StaleEntraDevices",
"cat": "Entra (AAD) Standards",
"tag": ["highimpact", "CIS"],
"helpText": "Cleans up Entra devices that have not connected/signed in for the specified number of days.",
"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)",
"addedComponent": [
{
"type": "number",
"name": "standards.StaleEntraDevices.deviceAgeThreshold",
"label": "Days before stale(Dont set below 30)"
}
],
"disabledFeatures": {
"report": false,
"warn": false,
"remediate": true
},
"label": "Cleanup stale Entra devices",
"impact": "High Impact",
"impactColour": "danger",
"powershellEquivalent": "Remove-MgDevice, Update-MgDevice or Graph API",
"recommendedBy": []
},
{
"name": "standards.UndoOauth",
"cat": "Entra (AAD) Standards",
Expand Down
24 changes: 9 additions & 15 deletions src/pages/identity/administration/devices/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,51 @@ import { Layout as DashboardLayout } from "/src/layouts/index.js"; // had to add
const Page = () => {
const pageTitle = "Devices";
const actions = [
// these are currently GET requests that should be converted to POST requests.
{
label: "Enable Device",
type: "GET",
type: "POST",
url: "/api/ExecDeviceDelete",
data: {
ID: "id",
Action: "!Enable",
action: "!Enable",
},
confirmText: "Are you sure you want to enable this device?",
multiPost: false,
},
{
label: "Disable Device",
type: "GET",
type: "POST",
url: "/api/ExecDeviceDelete",
data: {
ID: "id",
Action: "!Disable",
action: "!Disable",
},
confirmText: "Are you sure you want to disable this device?",
multiPost: false,
},
{
label: "Retrieve Bitlocker Keys",
label: "Retrieve BitLocker Keys",
type: "GET",
url: "/api/ExecGetRecoveryKey",
data: {
GUID: "id",
},
confirmText: "Are you sure you want to retrieve the Bitlocker keys?",
confirmText: "Are you sure you want to retrieve the BitLocker keys?",
multiPost: false,
},
{
label: "Delete Device",
type: "GET",
type: "POST",
url: "/api/ExecDeviceDelete",
data: {
ID: "id",
Action: "!Delete",
action: "!Delete",
},
confirmText: "Are you sure you want to delete this device?",
multiPost: false,
},
];

const offCanvas = {
extendedInfoFields: ["createdDateTime", "displayName", "id"],
actions: actions,
};

return (
<CippTablePage
title={pageTitle}
Expand All @@ -66,7 +60,6 @@ const Page = () => {
}}
apiDataKey="Results"
actions={actions}
offCanvas={offCanvas}
simpleColumns={[
"displayName",
"accountEnabled",
Expand All @@ -77,6 +70,7 @@ const Page = () => {
"operatingSystem",
"operatingSystemVersion",
"profileType",
"approximateLastSignInDateTime",
]}
/>
);
Expand Down
Loading