sametsazak / mergen

Mergen is an open-source, native macOS application for auditing and checking the security of your MacOS.
MIT License
154 stars 10 forks source link

Firewall not enabled wrong sratus #6

Open Quorum75 opened 1 year ago

Quorum75 commented 1 year ago

Scan result says that the firewall isn't enabled although it is wrong.

sametsazak commented 1 year ago

The firewall check module is using "➜ ~ defaults read /Library/Preferences/com.apple.alf globalstate" command with globalstate parameter.

Can you share your output and which OS version that you are using? @Quorum75

Here is how it's defined in CIS benchmark:

$ /usr/bin/sudo /usr/bin/osascript -l JavaScript << EOS function run() { let pref1 = ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('com.apple.alf')\ .objectForKey('globalstate')) let pref2 = ObjC.unwrap($.NSUserDefaults.alloc.initWithSuiteName('com.apple.security.fire wall')\ .objectForKey('EnableFirewall')) if ( ( pref1 == 1 ) || ( pref1 == 2 ) || ( pref2 == "true" ) ) { return("true") } else { return("false") } } EOS true