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:

Section

Setting

General

Enabled. Triggers: Enrollment Complete, Recurring Check-in and Custom pb-install. Frequency: Once per computer.

Packages

Add the PortBlocker package. Action: Install. Distribution point: Cloud distribution point.

Scripts

Add PortBlocker Registration. Priority: Before. Fill in the Connection URL, plus the token and audit-mode days if you use them.

Scope

The same Macs as the two profiles. Start with one test Mac.

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.

Troubleshooting

What you see

What to do

Invalid Message - The message could not be parsed.

Package distribution is not set up. See step 1.

No policies were found for the "pb-install" trigger.

The policy is disabled, the Mac is not in scope, or it already ran once. To run it again, go to Computers > (the Mac) > History > Policy Logs and click Flush on the PortBlocker entry.

Jamf won't save: Policies that update inventory on all computers cannot be set to ongoing frequency at recurring check-in.

Scope the policy to specific Macs or a group instead of All Computers, or use Once per computer.

The policy log shows the script running after the package

Set the script priority to Before in the policy (step 6).

The script result says token length 0

Parameter 5 is empty in the policy. Fill it in if you use registration tokens.

PortBlocker is not listed under Full Disk Access in System Settings

This is normal for profile-granted access. Use the fda-missing check in step 7 instead.

No PortBlocker notifications

Check that the notifications profile is installed, then restart the PortBlocker menu bar app, or log out and back in.