Posted on 11-02-2016 06:27 AM
I have a few computers that check in to Jamf fine, execute policy no problems etc, but we can't Screen Share into them with Casper Remote or SSH in to them. Wondering if the firewall is turned on so I'm looking for a script that might check the firewall status if Anyone has one? I found a Firewall EA on jamf nation, but it's not pulling any data for me, perhaps its dated (2011).
Solved! Go to Solution.
Posted on 11-02-2016 06:33 AM
#!/bin/sh
fw=$(defaults read /Library/Preferences/com.apple.alf globalstate)
if [ "$fw" == 0 ]; then
echo "<result>No</result>"
else
echo "<result>Yes</result>"
fi
Posted on 11-02-2016 06:33 AM
Hi @TomDay .. I wrote this as part of my suite of scripts/EA's for the CIS Security Benchmarks for 10.11. Hope it helps.
https://github.com/franton/CIS-Apple-Security-Casper/tree/master/2.6.3%20Enable%20Firewall
Posted on 11-02-2016 06:33 AM
#!/bin/sh
fw=$(defaults read /Library/Preferences/com.apple.alf globalstate)
if [ "$fw" == 0 ]; then
echo "<result>No</result>"
else
echo "<result>Yes</result>"
fi
Posted on 11-02-2016 06:33 AM
Hi @TomDay .. I wrote this as part of my suite of scripts/EA's for the CIS Security Benchmarks for 10.11. Hope it helps.
https://github.com/franton/CIS-Apple-Security-Casper/tree/master/2.6.3%20Enable%20Firewall
Posted on 11-02-2016 06:52 AM
@franton @ddcdennisb Wow that was fast, thank you both very much, exactly what I needed, I'm off and running.
Posted on 11-02-2016 12:45 PM
@ddcdennisb I've found that reading that plist file is unreliable. Hence my GitHub post above.