Created
September 20, 2023 14:31
-
-
Save homebysix/41b099cf1f7ff49e0fb286a854b64551 to your computer and use it in GitHub Desktop.
Escrow Buddy logout pkginfo for Munki
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>RestartAction</key> | |
<string>RequireLogout</string> | |
<key>catalogs</key> | |
<array> | |
<string>testing</string> | |
</array> | |
<key>category</key> | |
<string>Support</string> | |
<key>description</key> | |
<string><p>A recovery key for FileVault full-disk encryption needs to | |
be escrowed for this Mac. Please log out at your earliest convenience.</p><br /> | |
<p>For more information, see this KB article: | |
<strong><a href="https://www.betterbag.com/kb/13243546">"FileVault Escrow" | |
item appears in Managed Software Center</a></strong></p></string> | |
<key>display_name</key> | |
<string>FileVault Escrow</string> | |
<key>icon_name</key> | |
<string>FileVault.png</string> | |
<key>installcheck_script</key> | |
<string>#!/bin/bash | |
# This script detects whether this Mac meets the conditions required to escrow | |
# a FileVault recovery key at the next login. If so, a nopkg item will be | |
# displayed in MSC to prompt the user to logout. | |
# Exit zero if the Mac is ready for logout and escrow, else exit nonzero. | |
CURRENT_USER=$(/bin/echo "show State:/Users/ConsoleUser" | /usr/sbin/scutil | /usr/bin/awk '/Name :/&&!/loginwindow/{print $3}') | |
if [[ -z $CURRENT_USER || $CURRENT_USER == "loginwindow" || $CURRENT_USER == "_mbsetupuser" || $CURRENT_USER == "root" ]]; then | |
echo "Skipping FileVault Escrow helper: No user is logged in." | |
exit 1 | |
fi | |
if [[ ! -d "/Library/Security/SecurityAgentPlugins/Escrow Buddy.bundle" ]]; then | |
echo "Skipping FileVault Escrow helper: Escrow Buddy is not installed." | |
exit 1 | |
fi | |
if ! profiles -Cv | grep -qE 'type\s+= com.apple.security.FDERecoveryKeyEscrow'; then | |
echo "Skipping FileVault Escrow helper: FileVault escrow profile is not present." | |
exit 1 | |
fi | |
FDESTATUS=$(fdesetup status) | |
if ! echo "$FDESTATUS" | grep -qi "FileVault is On"; then | |
echo "Skipping FileVault Escrow helper: FileVault is not enabled." | |
exit 1 | |
fi | |
GENERATENEWKEY=$(defaults read /Library/Preferences/com.netflix.Escrow-Buddy GenerateNewKey 2>/dev/null) | |
if (( GENERATENEWKEY != 1 )); then | |
echo "Skipping FileVault Escrow helper: FileVault escrow is not needed." | |
exit 1 | |
fi | |
echo "FileVault escrow is needed." | |
exit 0 | |
</string> | |
<key>installer_type</key> | |
<string>nopkg</string> | |
<key>minimum_os_version</key> | |
<string>10.14.4</string> | |
<key>name</key> | |
<string>filevault_escrow_helper</string> | |
<key>unattended_install</key> | |
<false/> | |
<key>version</key> | |
<string>1.0</string> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment