One Jamf policy writes the SafeConsole settings, installs PortBlocker and enrolls the Mac. Two configuration profiles grant Full Disk Access and turn on notifications, so users see no prompts.
Before you start
The signed PortBlocker installer from DataLocker (PortBlocker-Setup.pkg).
Your SafeConsole connection URL, for example https://yourtenant.safeconsolecloud.io/connect, and a registration token if you use one.
Macs enrolled in Jamf Pro with MDM. Full Disk Access profiles only apply to MDM-enrolled Macs.
The two profiles attached to this article: PortBlocker-FDA.mobileconfig and PortBlocker-Notifications.mobileconfig.
Steps
1. Set up package distribution
In Settings > Server infrastructure, make sure the cloud distribution point (Jamf Cloud Distribution Service) is set up and enabled.
Important: Without it, every policy that contains a package fails on the Mac with Invalid Message - The message could not be parsed. The option still appears in the policy menus, so check the setting itself.
2. Upload the Full Disk Access profile
Go to Computers > Configuration Profiles > Upload and choose PortBlocker-FDA.mobileconfig. Scope it to your target Macs and save. Deploy it before PortBlocker installs.
3. Upload the notifications profile
Go to Computers > Configuration Profiles > Upload and choose PortBlocker-Notifications.mobileconfig. Use the same scope and save. It turns notifications on for com.datalocker.portblocker so users don't miss device alerts.
4. Upload the PortBlocker package
Go to Settings > Computer management > Packages > New, choose the signed .pkg and save. Wait for the upload to finish.
5. Add the registration script
Go to Settings > Computer management > Scripts > New. Name it PortBlocker Registration and paste this on the Script tab:
#!/bin/bash
# PortBlocker Registration: writes PortBlocker's SafeConsole settings.
# $4 = Connection URL, $5 = Registration token, $6 = Audit-mode days
SHARED="/Library/Preferences/com.datalocker.safeconsole"
URL="$4"
TOKEN="$5"
DAYS="$6"
if [ -z "$URL" ]; then
echo "PortBlocker Registration: parameter 4 (Connection URL) is empty"
exit 1
fi
/usr/bin/defaults write "$SHARED" url -string "$URL"
/usr/bin/defaults write "$SHARED" eula -string "true"
if [ -n "$TOKEN" ]; then
/usr/bin/defaults write "$SHARED" userToken -string "$TOKEN"
fi
/usr/sbin/chown root:wheel "$SHARED.plist"
/bin/chmod 644 "$SHARED.plist"
case "$DAYS" in
''|*[!0-9]*) ;;
*) /usr/bin/defaults write com.safeconsole.massdeploy enableAuditModeDays -int "$DAYS" ;;
esac
echo "PortBlocker Registration: seeded url and eula, token length ${#TOKEN}, days '${DAYS}'"
exit 0
On the Options tab, label the parameters: 4 Connection URL, 5 Registration token, 6 Audit-mode days. Save.
6. Create the policy
Go to Computers > Policies > New, name it PortBlocker and set:
Important: Set the script priority to Before inside the policy. The priority on the script's own page is only a default. With After, PortBlocker starts before its settings exist.
7. Test on one Mac
Run the policy now instead of waiting for check-in:
sudo jamf policy -event pb-install -verbose
The output shows Running script PortBlocker Registration, then the package download and Successfully installed. Then check:
sudo defaults read /Library/Preferences/com.datalocker.safeconsole
sudo launchctl print system/com.datalocker.portblocker.service | grep "state ="
ls /etc/com.datalocker.portblocker/fda-missing
The settings show your url and eula = true.
The service shows state = running.
ls reports No such file or directory, which means Full Disk Access is granted.