Skip to content

Commit

Permalink
UI - Only show 'follow instructions on My device' banner for encrypte…
Browse files Browse the repository at this point in the history
…d and non-escrowed Linux hosts (#24277)

## #24248

For hosts with encrypted disks that Fleet does not have a key escrowed
for:

**Banner shown for Linux:**
<img width="1464" alt="Screenshot 2024-12-02 at 10 52 08 AM"
src="https://github.com/user-attachments/assets/91dd3b64-b9da-430b-9eb0-0ae30af751d8">

**but not for Windows:**
<img width="1464" alt="Screenshot 2024-12-02 at 10 49 54 AM"
src="https://github.com/user-attachments/assets/0345db0d-74f5-4608-af7b-58efae14dfea">



- [x] Changes file added for user-visible changes in `changes/`
- [x] Manual QA

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
  • Loading branch information
jacobshandling and Jacob Shandling authored Dec 3, 2024
1 parent 2cdead2 commit ed8c3a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
2 changes: 2 additions & 0 deletions changes/24248-host-details-encryption-banner
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -110,16 +108,13 @@ const HostDetailsBanners = ({
</div>
);
}
// 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 (
<div className={baseClass}>
Expand All @@ -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 (
<div className={baseClass}>
<InfoBanner color="yellow">
Expand Down

0 comments on commit ed8c3a3

Please sign in to comment.