2024-04-15 13:17:08 +00:00
|
|
|
import {
|
|
|
|
|
FLEET_FILEVAULT_PROFILE_DISPLAY_NAME,
|
|
|
|
|
ProfileOperationType,
|
|
|
|
|
} from "interfaces/mdm";
|
2023-11-29 14:32:42 +00:00
|
|
|
|
|
|
|
|
import { IconNames } from "components/icons";
|
|
|
|
|
import {
|
|
|
|
|
TooltipInnerContentFunc,
|
|
|
|
|
TooltipInnerContentOption,
|
|
|
|
|
} from "./components/Tooltip/TooltipContent";
|
|
|
|
|
|
|
|
|
|
import { OsSettingsTableStatusValue } from "../OSSettingsTableConfig";
|
|
|
|
|
import TooltipInnerContentActionRequired from "./components/Tooltip/ActionRequired";
|
|
|
|
|
|
2024-04-15 13:17:08 +00:00
|
|
|
export const isDiskEncryptionProfile = (profileName: string) => {
|
|
|
|
|
return profileName === FLEET_FILEVAULT_PROFILE_DISPLAY_NAME;
|
|
|
|
|
};
|
|
|
|
|
|
2023-11-29 14:32:42 +00:00
|
|
|
export type ProfileDisplayOption = {
|
|
|
|
|
statusText: string;
|
|
|
|
|
iconName: IconNames;
|
|
|
|
|
tooltip: TooltipInnerContentOption | null;
|
|
|
|
|
} | null;
|
|
|
|
|
|
|
|
|
|
type OperationTypeOption = Record<
|
|
|
|
|
OsSettingsTableStatusValue,
|
|
|
|
|
ProfileDisplayOption
|
|
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
type ProfileDisplayConfig = Record<ProfileOperationType, OperationTypeOption>;
|
|
|
|
|
|
2024-07-31 13:21:53 +00:00
|
|
|
// Profiles for iOS and iPadOS skip the verifying step
|
|
|
|
|
const APPLE_PROFILE_VERIFIED_DISPLAY_CONFIG: ProfileDisplayOption = {
|
2024-03-25 19:15:33 +00:00
|
|
|
statusText: "Verified",
|
|
|
|
|
iconName: "success",
|
|
|
|
|
tooltip: (innerProps) =>
|
|
|
|
|
innerProps.isDiskEncryptionProfile
|
|
|
|
|
? "The host turned disk encryption on and sent the key to Fleet. " +
|
2024-07-31 13:21:53 +00:00
|
|
|
"Fleet verified."
|
|
|
|
|
: "The host applied the setting. Fleet verified.",
|
2024-03-25 19:15:33 +00:00
|
|
|
} as const;
|
|
|
|
|
|
|
|
|
|
const MAC_PROFILE_VERIFYING_DISPLAY_CONFIG: ProfileDisplayOption = {
|
|
|
|
|
statusText: "Verifying",
|
|
|
|
|
iconName: "success-outline",
|
|
|
|
|
tooltip: (innerProps) =>
|
|
|
|
|
innerProps.isDiskEncryptionProfile
|
|
|
|
|
? "The host acknowledged the MDM command to turn on disk encryption. " +
|
|
|
|
|
"Fleet is verifying with osquery and retrieving the disk encryption key. " +
|
|
|
|
|
"This may take up to one hour."
|
|
|
|
|
: "The host acknowledged the MDM command to apply the setting. Fleet is " +
|
|
|
|
|
"verifying with osquery.",
|
|
|
|
|
} as const;
|
|
|
|
|
|
2023-11-29 14:32:42 +00:00
|
|
|
export const PROFILE_DISPLAY_CONFIG: ProfileDisplayConfig = {
|
|
|
|
|
install: {
|
2024-07-31 13:21:53 +00:00
|
|
|
verified: APPLE_PROFILE_VERIFIED_DISPLAY_CONFIG,
|
|
|
|
|
success: APPLE_PROFILE_VERIFIED_DISPLAY_CONFIG,
|
2024-03-25 19:15:33 +00:00
|
|
|
verifying: MAC_PROFILE_VERIFYING_DISPLAY_CONFIG,
|
|
|
|
|
acknowledged: MAC_PROFILE_VERIFYING_DISPLAY_CONFIG,
|
2023-11-29 14:32:42 +00:00
|
|
|
pending: {
|
|
|
|
|
statusText: "Enforcing (pending)",
|
|
|
|
|
iconName: "pending-outline",
|
|
|
|
|
tooltip: (innerProps) =>
|
|
|
|
|
innerProps.isDiskEncryptionProfile
|
|
|
|
|
? "The hosts will receive the MDM command to turn on disk encryption " +
|
|
|
|
|
"when the hosts come online."
|
2024-01-19 19:47:51 +00:00
|
|
|
: "The host will receive the MDM command to apply the setting when the " +
|
2023-11-29 14:32:42 +00:00
|
|
|
"host comes online.",
|
|
|
|
|
},
|
|
|
|
|
action_required: {
|
|
|
|
|
statusText: "Action required (pending)",
|
|
|
|
|
iconName: "pending-outline",
|
|
|
|
|
tooltip: TooltipInnerContentActionRequired as TooltipInnerContentFunc,
|
|
|
|
|
},
|
|
|
|
|
failed: {
|
|
|
|
|
statusText: "Failed",
|
|
|
|
|
iconName: "error",
|
|
|
|
|
tooltip: null,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
remove: {
|
|
|
|
|
pending: {
|
|
|
|
|
statusText: "Removing enforcement (pending)",
|
|
|
|
|
iconName: "pending-outline",
|
|
|
|
|
tooltip: (innerProps) =>
|
|
|
|
|
innerProps.isDiskEncryptionProfile
|
|
|
|
|
? "The host will receive the MDM command to remove the disk encryption profile when the " +
|
|
|
|
|
"host comes online."
|
|
|
|
|
: "The host will receive the MDM command to remove the setting when the host " +
|
|
|
|
|
"comes online.",
|
|
|
|
|
},
|
|
|
|
|
action_required: null, // should not be reached
|
|
|
|
|
verified: null, // should not be reached
|
|
|
|
|
verifying: null, // should not be reached
|
2024-03-25 19:15:33 +00:00
|
|
|
success: null, // should not be reached
|
|
|
|
|
acknowledged: null, // should not be reached
|
2023-11-29 14:32:42 +00:00
|
|
|
failed: {
|
|
|
|
|
statusText: "Failed",
|
|
|
|
|
iconName: "error",
|
|
|
|
|
tooltip: null,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type WindowsDiskEncryptionDisplayConfig = Omit<
|
|
|
|
|
OperationTypeOption,
|
2024-03-25 19:15:33 +00:00
|
|
|
// windows disk encryption does not have these states
|
|
|
|
|
"action_required" | "success" | "acknowledged"
|
2023-11-29 14:32:42 +00:00
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
export const WINDOWS_DISK_ENCRYPTION_DISPLAY_CONFIG: WindowsDiskEncryptionDisplayConfig = {
|
|
|
|
|
verified: {
|
|
|
|
|
statusText: "Verified",
|
|
|
|
|
iconName: "success",
|
|
|
|
|
tooltip: () =>
|
2024-07-31 13:21:53 +00:00
|
|
|
"The host turned disk encryption on and sent the key to Fleet. Fleet verified.",
|
2023-11-29 14:32:42 +00:00
|
|
|
},
|
|
|
|
|
verifying: {
|
|
|
|
|
statusText: "Verifying",
|
|
|
|
|
iconName: "success-outline",
|
|
|
|
|
tooltip: () =>
|
|
|
|
|
"The host acknowledged the MDM command to turn on disk encryption. Fleet is verifying with " +
|
|
|
|
|
"osquery and retrieving the disk encryption key. This may take up to one hour.",
|
|
|
|
|
},
|
|
|
|
|
pending: {
|
|
|
|
|
statusText: "Enforcing (pending)",
|
|
|
|
|
iconName: "pending-outline",
|
|
|
|
|
tooltip: () =>
|
|
|
|
|
"The host will receive the MDM command to turn on disk encryption when the host comes online.",
|
|
|
|
|
},
|
|
|
|
|
failed: {
|
|
|
|
|
statusText: "Failed",
|
|
|
|
|
iconName: "error",
|
|
|
|
|
tooltip: null,
|
|
|
|
|
},
|
|
|
|
|
};
|