([]);
@@ -95,7 +97,7 @@ const DeviceUserPage = ({
}
);
- const { data: deviceMacAdminsData, refetch: refetchMacadmins } = useQuery(
+ const { data: deviceMacAdminsData } = useQuery(
["macadmins", deviceAuthToken],
() => deviceUserAPI.loadHostDetailsExtension(deviceAuthToken, "macadmins"),
{
@@ -229,6 +231,10 @@ const DeviceUserPage = ({
setShowEnrollMdmModal(!showEnrollMdmModal);
}, [showEnrollMdmModal, setShowEnrollMdmModal]);
+ const toggleResetKeyModal = useCallback(() => {
+ setShowResetKeyModal(!showResetKeyModal);
+ }, [showResetKeyModal, setShowResetKeyModal]);
+
const togglePolicyDetailsModal = useCallback(
(policy: IHostPolicy) => {
setShowPolicyDetailsModal(!showPolicyDetailsModal);
@@ -295,10 +301,29 @@ const DeviceUserPage = ({
);
};
+ const resetKeyButton = (
+
+ Reset key
+
+ );
+
const renderDeviceUserPage = () => {
const failingPoliciesCount = host?.issues?.failing_policies_count || 0;
const isMdmUnenrolled =
host?.mdm.enrollment_status === "Off" || !host?.mdm.enrollment_status;
+
+ const diskEncryptionBannersEnabled =
+ globalConfig?.mdm.enabled_and_configured && host?.mdm.name === "Fleet";
+
+ const showDiskEncryptionLogoutRestart =
+ diskEncryptionBannersEnabled &&
+ host?.mdm.macos_settings.disk_encryption === "action_required" &&
+ host?.mdm.macos_settings.action_required === "log_out";
+ const showDiskEncryptionKeyResetRequired =
+ diskEncryptionBannersEnabled &&
+ host?.mdm.macos_settings.disk_encryption === "action_required" &&
+ host?.mdm.macos_settings.action_required === "rotate_key";
+
return (
{isLoadingHost ? (
@@ -308,6 +333,7 @@ const DeviceUserPage = ({
{host?.platform === "darwin" &&
isMdmUnenrolled &&
globalConfig?.mdm.enabled_and_configured && (
+ // Turn on MDM banner
Mobile device management (MDM) is off. MDM allows your
organization to change settings and install software. This
@@ -315,6 +341,22 @@ const DeviceUserPage = ({
don’t have to.
)}
+ {showDiskEncryptionLogoutRestart && (
+ // MDM - Disk Encryption: Logout or restart banner
+
+ Disk encryption: Log out of your device or restart to turn on
+ disk encryption. This prevents unauthorized access to the
+ information on your device.
+
+ )}
+ {showDiskEncryptionKeyResetRequired && (
+ // MDM - Disk Encryption: Reset key required banner
+
+ Disk encryption: Reset your disk encryption key. This lets your
+ organization help you unlock your device if you forget your
+ password.
+
+ )}
{showInfoModal && }
{showEnrollMdmModal && renderEnrollMdmModal()}
+ {showResetKeyModal && (
+
+ )}
)}
{!!host && showPolicyDetailsModal && (
diff --git a/frontend/pages/hosts/details/DeviceUserPage/ManualEnrollMdmModal/_styles.scss b/frontend/pages/hosts/details/DeviceUserPage/ManualEnrollMdmModal/_styles.scss
index 7a9c5fcdf2..e69de29bb2 100644
--- a/frontend/pages/hosts/details/DeviceUserPage/ManualEnrollMdmModal/_styles.scss
+++ b/frontend/pages/hosts/details/DeviceUserPage/ManualEnrollMdmModal/_styles.scss
@@ -1,5 +0,0 @@
-.enroll-mdm-modal {
- &__download-button {
- margin-top: 12px;
- }
-}
diff --git a/frontend/pages/hosts/details/DeviceUserPage/ResetKeyModal/ResetKeyModal.tsx b/frontend/pages/hosts/details/DeviceUserPage/ResetKeyModal/ResetKeyModal.tsx
new file mode 100644
index 0000000000..54267f859f
--- /dev/null
+++ b/frontend/pages/hosts/details/DeviceUserPage/ResetKeyModal/ResetKeyModal.tsx
@@ -0,0 +1,59 @@
+import React, { useState } from "react";
+
+import Button from "components/buttons/Button";
+import Modal from "components/Modal";
+
+interface IResetKeyModalProps {
+ onCancel: () => void;
+}
+
+const baseClass = "reset-key-modal";
+
+const ResetKeyModal = ({ onCancel }: IResetKeyModalProps): JSX.Element => {
+ const [success, setSuccess] = useState(false);
+ const [isLoading, setIsLoading] = useState(false);
+
+ // TODO: actually make this work: https://www.figma.com/file/hdALBDsrti77QuDNSzLdkx/%F0%9F%9A%A7-Fleet-EE-(dev-ready%2C-scratchpad)?node-id=11728%3A323033&t=GbmGwTkgjENhmJmO-1
+ const startNativeKeyReset = () => {
+ setIsLoading(true);
+ setTimeout(() => {
+ setSuccess(true);
+ }, 1000);
+ };
+
+ return (
+
+
+
+
+ Click Start and enter your username and password.
+ {success ? (
+ Success!
+ ) : (
+
+ Start
+
+ )}
+
+
+ Close this window and select Refetch on your My device page.
+ This tells your organization that you reset your key.
+
+
+
+
+ Done
+
+
+
+
+ );
+};
+
+export default ResetKeyModal;
diff --git a/frontend/pages/hosts/details/DeviceUserPage/ResetKeyModal/_styles.scss b/frontend/pages/hosts/details/DeviceUserPage/ResetKeyModal/_styles.scss
new file mode 100644
index 0000000000..ad4bd9933b
--- /dev/null
+++ b/frontend/pages/hosts/details/DeviceUserPage/ResetKeyModal/_styles.scss
@@ -0,0 +1,20 @@
+.reset-key-modal {
+ &__start-button {
+ margin-top: 12px;
+ }
+
+ &__success {
+ margin-top: 12px;
+ padding: $pad-small;
+ height: 22px;
+ }
+
+ ol {
+ padding-left: 0;
+ }
+
+ li {
+ margin-bottom: $pad-large;
+ list-style: number inside;
+ }
+}
diff --git a/frontend/pages/hosts/details/DeviceUserPage/ResetKeyModal/index.ts b/frontend/pages/hosts/details/DeviceUserPage/ResetKeyModal/index.ts
new file mode 100644
index 0000000000..3cd713ee62
--- /dev/null
+++ b/frontend/pages/hosts/details/DeviceUserPage/ResetKeyModal/index.ts
@@ -0,0 +1 @@
+export { default } from "./ResetKeyModal";
diff --git a/frontend/pages/hosts/details/DeviceUserPage/_styles.scss b/frontend/pages/hosts/details/DeviceUserPage/_styles.scss
index f282832d8b..aaac438c87 100644
--- a/frontend/pages/hosts/details/DeviceUserPage/_styles.scss
+++ b/frontend/pages/hosts/details/DeviceUserPage/_styles.scss
@@ -20,6 +20,10 @@
margin: $pad-large 0;
}
+ &__download-button {
+ margin-top: 12px;
+ }
+
ol {
padding-left: 0;
}
diff --git a/frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx b/frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx
index 3c09e3eb42..acd2156fe0 100644
--- a/frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx
+++ b/frontend/pages/hosts/details/HostDetailsPage/HostDetailsPage.tsx
@@ -600,6 +600,11 @@ const HostDetailsPage = ({
const isMdmUnenrolled =
host?.mdm.enrollment_status === "Off" || !host?.mdm.enrollment_status;
+ const showDiskEncryptionUserActionRequired =
+ config?.mdm.enabled_and_configured &&
+ host?.mdm.name === "Fleet" &&
+ host?.mdm.macos_settings.disk_encryption === "action_required";
+
return (
@@ -613,6 +618,13 @@ const HostDetailsPage = ({
My device page.
)}
+ {showDiskEncryptionUserActionRequired && (
+
+ Disk encryption: Requires action from the end user. Ask the end
+ user to follow Disk encryption instructions on their{" "}
+ My device page.
+
+ )}