Knock knock
“Who’s there?”
macOS 15 Sequoia. Check your firewall checking scripts please
If anyone is following along with my attempt to re-create MunkiReport in SimpleMDM then you’ll be happy to know the space madness is still strong and macOS 15 has made one tiny thing break, my firewall checking script.
My firewall checking script began life as a simple check of the status in the alf pref file but that file no longer exists in macOS 15.
See this Knowledge base article which lists in bug fixes that the file no longer exists and that the socketfilterfw binary be used instead, except that doesn’t work when Macs are managed.
Application Firewall settings are no longer contained in a property list. If your app or workflow relies on changing Application Firewall settings by modifying /Library/Preferences/com.apple.alf.plist, then you need to make changes to use the
socketfilterfw
command line tool instead.
Yes, my Macs are managed with MDM and yes I have a profile to enable the firewall but no I don’t trust it so can I check please with another method. Trust but verify.
So thanks to some friends in the MacAdmins Slack I stole the idea from tuxudo to check firewall in macOS 15 using system profiler, because he had re-written the MunkiReport module already and so there I go again, stealing from MunkiReport and all the hard work they do.
After playing with the output of system_profiler
a bit I looked at the “Mode”
/usr/sbin/system_profiler SPFirewallDataType -detailLevel basic |grep Mode
Mode: Allow all incoming connections
Stealth Mode: No
Of course I could write some nice code to clean this up or instead I switched to searching for “Limit” and if there’s no hit on that there’s no limit (translated: firewall is not enabled“)
/usr/sbin/system_profiler SPFirewallDataType -detailLevel basic |grep Limit
And if there is a limit then the firewall is enabled.
Mode: Limit incoming connections to specific services and applications
Simple. Good enough to add to my SimpleMDM script to run and populate the value to the custom attribute and update my dashboard. And my crazy mission to build everything into SimpleMDM dashboard is still… madness …. but also quite fun.