Skip to content

Commit db37421

Browse files
committed
Fix commands for application firewall
1 parent 2902bda commit db37421

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

README.md

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

403403
Enable the firewall:
404404

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

407407
Enable logging:
408408

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

411411
You may also wish to enable stealth mode:
412412

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

415415
> 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.
416416
417-
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*:
417+
Finally, you may wish to prevent *built-in software* as well as *code-signed, downloaded software from being whitelisted automatically*:
418418

419-
$ sudo defaults write /Library/Preferences/com.apple.alf allowsignedenabled -bool false
420-
421-
$ sudo defaults write /Library/Preferences/com.apple.alf allowdownloadsignedenabled -bool false
419+
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsigned off
420+
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setallowsignedapp off
422421

423422
> 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.
424423
425424
> 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.
426425
426+
After interacting with `socketfilterfw`, you may want to restart (or terminate) the process:
427+
428+
$ sudo pkill -HUP socketfilterfw
429+
427430
#### Third party firewalls
428431

429432
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.
@@ -615,7 +618,7 @@ Install Dnsmasq (DNSSEC is optional):
615618
$ brew install dnsmasq --with-dnssec
616619

617620
$ cp ~/homebrew/opt/dnsmasq/dnsmasq.conf.example ~/homebrew/etc/dnsmasq.conf
618-
621+
619622
Edit the configuration:
620623

621624
$ vim ~/homebrew/etc/dnsmasq.conf
@@ -1247,7 +1250,7 @@ $ xattr -d com.apple.quarantine ~/Downloads/TorBrowser-6.0.5-osx64_en-US.dmg
12471250
$ xattr -l ~/Downloads/TorBrowser-6.0.5-osx64_en-US.dmg
12481251
[No output after removal.]
12491252
```
1250-
1253+
12511254
## Passwords
12521255

12531256
You can generate strong passwords with OpenSSL:
@@ -1269,7 +1272,7 @@ With control over character sets:
12691272

12701273
$ LANG=C tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 40 | head -n 1
12711274
jm0iKn7ngQST8I0mMMCbbi6SKPcoUWwCb5lWEjxK
1272-
1275+
12731276
$ LANG=C tr -dc 'DrDuh0-9' < /dev/urandom | fold -w 40 | head -n 1
12741277
686672u2Dh7r754209uD312hhh23uD7u41h3875D
12751278

0 commit comments

Comments
 (0)