From ed8c3a3b98a6ff827fa2a6ef7a1ab0c006b8c5e3 Mon Sep 17 00:00:00 2001 From: jacobshandling <61553566+jacobshandling@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:28:28 -0800 Subject: [PATCH] UI - Only show 'follow instructions on My device' banner for encrypted and non-escrowed Linux hosts (#24277) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## #24248 For hosts with encrypted disks that Fleet does not have a key escrowed for: **Banner shown for Linux:** Screenshot 2024-12-02 at 10 52 08 AM **but not for Windows:** Screenshot 2024-12-02 at 10 49 54 AM - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA --------- Co-authored-by: Jacob Shandling --- changes/24248-host-details-encryption-banner | 2 ++ .../HostDetailsBanners/HostDetailsBanners.tsx | 16 ++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) create mode 100644 changes/24248-host-details-encryption-banner diff --git a/changes/24248-host-details-encryption-banner b/changes/24248-host-details-encryption-banner new file mode 100644 index 0000000000..7de5934177 --- /dev/null +++ b/changes/24248-host-details-encryption-banner @@ -0,0 +1,2 @@ +* Only show the "follow instructions on My device" banner for Linux hosts whose disks are encrypted +but for which Fleet hasn't escrowed a valid key. diff --git a/frontend/pages/hosts/details/HostDetailsPage/components/HostDetailsBanners/HostDetailsBanners.tsx b/frontend/pages/hosts/details/HostDetailsPage/components/HostDetailsBanners/HostDetailsBanners.tsx index 0e4eb8b851..cc1b6a73f6 100644 --- a/frontend/pages/hosts/details/HostDetailsPage/components/HostDetailsBanners/HostDetailsBanners.tsx +++ b/frontend/pages/hosts/details/HostDetailsPage/components/HostDetailsBanners/HostDetailsBanners.tsx @@ -8,13 +8,11 @@ import { IOSSettings } from "interfaces/host"; import { HostPlatform, isDiskEncryptionSupportedLinuxPlatform, - platformSupportsDiskEncryption, } from "interfaces/platform"; import InfoBanner from "components/InfoBanner"; import CustomLink from "components/CustomLink"; import { LEARN_MORE_ABOUT_BASE_LINK } from "utilities/constants"; -import { isDiskEncryptionProfile } from "pages/hosts/details/OSSettingsModal/OSSettingsTable/OSSettingStatusCell/helpers"; const baseClass = "host-details-banners"; @@ -110,16 +108,13 @@ const HostDetailsBanners = ({ ); } - // setting applies if ( hostPlatform && - platformSupportsDiskEncryption(hostPlatform, hostOsVersion) && + isDiskEncryptionSupportedLinuxPlatform(hostPlatform, hostOsVersion ?? "") && diskEncryptionOSSetting?.status ) { - if ( - !diskIsEncrypted && - isDiskEncryptionSupportedLinuxPlatform(hostPlatform, hostOsVersion ?? "") - ) { + // setting applies to a Linux host + if (!diskIsEncrypted) { // linux host not in compliance with setting return (
@@ -143,8 +138,9 @@ const HostDetailsBanners = ({ ); } if (!diskEncryptionKeyAvailable) { - // disk is encrypted, but Fleet doesn't yet have a disk - // encryption key escrowed (possible for Linux hosts) + // linux host's disk is encrypted, but Fleet doesn't yet have a disk + // encryption key escrowed (note that this state is also possible for Windows hosts, which we + // don't show this banner for currently) return (