Last active
August 29, 2015 14:23
-
-
Save dmitryd/031d9b8eb6b96dc034ed to your computer and use it in GitHub Desktop.
Prevent access to local Apache on OS X with ipfw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add 1000 deny tcp from any to any dst-port 80 recv en0 | |
add 2000 deny tcp from any to any dst-port 80 recv en1 | |
add 3000 deny tcp from any to any dst-port 80 recv en3 | |
# The next one works only if you have tun/tap driver installed for VPN apps. If you do not have it, comment it. | |
add 4000 deny tcp from any to any dst-port 80 recv tun0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http:// | |
www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>ipfw</string> | |
<key>Program</key> | |
<string>/sbin/ipfw</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/sbin/ipfw</string> | |
<string>/etc/ipfw.conf</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true /> | |
</dict> | |
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo launchctl load -w /Library/LaunchDaemons/ipfw.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment