Skip to content

Commit 7105e42

Browse files
authored
Merge pull request drduh#155 from Eitot/socketfw
Fix commands for application firewall
2 parents acd943c + db37421 commit 7105e42

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -426,28 +426,31 @@ It can be controlled by the **Firewall** tab of **Security & Privacy** in **Syst
426426

427427
Enable the firewall:
428428

429-
$ sudo defaults write /Library/Preferences/com.apple.alf globalstate -bool true
429+
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on
430430

431431
Enable logging:
432432

433-
$ sudo defaults write /Library/Preferences/com.apple.alf loggingenabled -bool true
433+
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode on
434434

435435
You may also wish to enable stealth mode:
436436

437-
$ sudo defaults write /Library/Preferences/com.apple.alf stealthenabled -bool true
437+
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on
438438

439439
> Computer hackers scan networks so they can attempt to identify computers to attack. You can prevent your computer from responding to some of these scans by using **stealth mode**. When stealth mode is enabled, your computer does not respond to ICMP ping requests, and does not answer to connection attempts from a closed TCP or UDP port. This makes it more difficult for attackers to find your computer.
440440
441-
Finally, you may wish to disable *Automatically allow built-in software to receive incoming connetions* as well as *Automatically allow downloaded signed software to receive incoming connections*:
441+
Finally, you may wish to prevent *built-in software* as well as *code-signed, downloaded software from being whitelisted automatically*:
442442

443-
$ sudo defaults write /Library/Preferences/com.apple.alf allowsignedenabled -bool false
444-
445-
$ sudo defaults write /Library/Preferences/com.apple.alf allowdownloadsignedenabled -bool false
443+
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsigned off
444+
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsignedapp off
446445

447446
> Applications that are signed by a valid certificate authority are automatically added to the list of allowed apps, rather than prompting the user to authorize them. Apps included in OS X are signed by Apple and are allowed to receive incoming connections when this setting is enabled. For example, since iTunes is already signed by Apple, it is automatically allowed to receive incoming connections through the firewall.
448447
449448
> If you run an unsigned app that is not listed in the firewall list, a dialog appears with options to Allow or Deny connections for the app. If you choose Allow, OS X signs the application and automatically adds it to the firewall list. If you choose Deny, OS X adds it to the list but denies incoming connections intended for this app.
450449
450+
After interacting with `socketfilterfw`, you may want to restart (or terminate) the process:
451+
452+
$ sudo pkill -HUP socketfilterfw
453+
451454
#### Third party firewalls
452455

453456
Programs such as [Little Snitch](https://www.obdev.at/products/littlesnitch/index.html), [Hands Off](https://www.oneperiodic.com/products/handsoff/), [Radio Silence](http://radiosilenceapp.com/) and [Security Growler](https://pirate.github.io/security-growler/) provide a good balance of usability and security.

0 commit comments

Comments
 (0)