Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Hack5190

macrumors 6502a
Original poster
Oct 21, 2015
531
311
(UTC-05:00) Cuba
Recently I purchased a 15" PowerBook G4 to use in cafe's and other public locations. Today I worked on securing the network interfaces. My approach is to use three different firewalls, Little Snitch, Apples Firewall and ipfw.

Little Snitch is used to control outbound traffic. Apples Firewall controls inbound traffic. ipfw controls both inbound and outbound traffic. By default ipfw contains a single rule allowing all inbound and outbound traffic. That means ipfw blocks (or allows) traffic -BEFORE- either Little Snitch or Apples Firewall see it (that's important to understand as you make and test ipfw rules).

For Little Snitch I disabled "Approve rules automatically", enabled "Mark new rules as unapproved" and disabled or edited several of the default rules. In Apples Firewall (accessed via the preference pane) I selected "Set access for specific services and applications". Finally for ipfw I created a custom list of rules and made the needed changes to ensure those rules are auto loaded when Leopard boots.

A good guide for configuring ipfw can be found in this blog post (http://blog.scottlowe.org/2012/04/05/setting-up-ipfw-on-mac-os-x/). For those shy using terminal there is a GUI for working with ipfw access rules called WaterRoof (http://www.hanynet.com/waterroof/).

Hopefully this brief overview of Firewalling for Leopard will help you stay safe while in public.

Code:
# Allow DHCP
add allow udp from any 67 to any dst-port 68 in

# Set up stateful traffic rules
add check-state
add allow tcp from me to any keep-state
add allow udp from me to any keep-state

# Allow outbound ip - TinyFirewall controls traffic
add allow ip from any to any out

# Allow ping replies
add allow icmp from any to me icmptypes 0,3,11 in

# Block all inbound ip traffic not matched by a previous rule
add 65000 reject udp from any to any in
add deny icmp from any to any in
add deny ip from any to any in


If you need to allow SSH, VNC or file sharing (APF) add the following lines as needed.

NOTE: Enabling access to these services on a machine that is used outside of the home / office (IE: in public) is NOT recommended. It exposes services that can be used to attack your machine.

Code:
# Allow inbound SSH
add allow tcp from any to any 22 keep-state setup

# Allow inbound VNC Connections
add allow tcp from any to any 3283 keep-state setup
add allow tcp from any to any 5900 keep-state setup

# Allow inbound APF Connections
add allow tcp from any to any 548 keep-state setup

If you want to log activity on any of these rules add log after the allow or deny command. For example: to log all blocked traffic change
Code:
# Block all inbound ip traffic not matched by a previous rule
add 65000 reject udp from any to any in
add deny icmp from any to any in
add deny ip from any to any in

to
Code:
# Block all inbound ip traffic not matched by a previous rule
add 65000 reject log udp from any to any in
add deny log icmp from any to any in
add deny log ip from any to any in

By default logging is disabled - to enable logging enter the following at the command line (terminal):

$ sudo sysctl -w net.inet.ip.fw.verbose=1

the change will take effect immediately. Note that this change will not survive a reboot.
 
Last edited:
  • Like
Reactions: amagichnich

amagichnich

macrumors 6502a
Feb 3, 2017
516
342
Stuttgart, Germany
does anybody know what the potential impact of Apple's FW vs ipfw on CPU load is? I'm trying to set up the inbuilt fw but must admit that it is pretty useless without a cli. I can't even allow DHCP as the system has to call the specific service for me to approve it
 

amagichnich

macrumors 6502a
Feb 3, 2017
516
342
Stuttgart, Germany
seems like I was mistaken - Apple's FW in system prefs ist just a very basic attempt of a GUI for the inbuilt ipfw and there is indeed a CLI. See sudo /sbin/ipfw -h for more info
 

Macbookprodude

Suspended
Jan 1, 2018
3,306
898
Recently I purchased a 15" PowerBook G4 to use in cafe's and other public locations. Today I worked on securing the network interfaces. My approach is to use three different firewalls, Little Snitch, Apples Firewall and ipfw.

Little Snitch is used to control outbound traffic. Apples Firewall controls inbound traffic. ipfw controls both inbound and outbound traffic. By default ipfw contains a single rule allowing all inbound and outbound traffic. That means ipfw blocks (or allows) traffic -BEFORE- either Little Snitch or Apples Firewall see it (that's important to understand as you make and test ipfw rules).

For Little Snitch I disabled "Approve rules automatically", enabled "Mark new rules as unapproved" and disabled or edited several of the default rules. In Apples Firewall (accessed via the preference pane) I selected "Set access for specific services and applications". Finally for ipfw I created a custom list of rules and made the needed changes to ensure those rules are auto loaded when Leopard boots.

A good guide for configuring ipfw can be found in this blog post (http://blog.scottlowe.org/2012/04/05/setting-up-ipfw-on-mac-os-x/). For those shy using terminal there is a GUI for working with ipfw access rules called WaterRoof (http://www.hanynet.com/waterroof/).

Hopefully this brief overview of Firewalling for Leopard will help you stay safe while in public.

Code:
# Allow DHCP
add allow udp from any 67 to any dst-port 68 in

# Set up stateful traffic rules
add check-state
add allow tcp from me to any keep-state
add allow udp from me to any keep-state

# Allow outbound ip - TinyFirewall controls traffic
add allow ip from any to any out

# Allow ping replies
add allow icmp from any to me icmptypes 0,3,11 in

# Block all inbound ip traffic not matched by a previous rule
add 65000 reject udp from any to any in
add deny icmp from any to any in
add deny ip from any to any in


If you need to allow SSH, VNC or file sharing (APF) add the following lines as needed.

NOTE: Enabling access to these services on a machine that is used outside of the home / office (IE: in public) is NOT recommended. It exposes services that can be used to attack your machine.

Code:
# Allow inbound SSH
add allow tcp from any to any 22 keep-state setup

# Allow inbound VNC Connections
add allow tcp from any to any 3283 keep-state setup
add allow tcp from any to any 5900 keep-state setup

# Allow inbound APF Connections
add allow tcp from any to any 548 keep-state setup

If you want to log activity on any of these rules add log after the allow or deny command. For example: to log all blocked traffic change
Code:
# Block all inbound ip traffic not matched by a previous rule
add 65000 reject udp from any to any in
add deny icmp from any to any in
add deny ip from any to any in

to
Code:
# Block all inbound ip traffic not matched by a previous rule
add 65000 reject log udp from any to any in
add deny log icmp from any to any in
add deny log ip from any to any in

By default logging is disabled - to enable logging enter the following at the command line (terminal):

$ sudo sysctl -w net.inet.ip.fw.verbose=1

the change will take effect immediately. Note that this change will not survive a reboot.


I always use my G4 TI in public to do transactions with Leo AND NOTHING has ever happened and nothing will happen.
 

amagichnich

macrumors 6502a
Feb 3, 2017
516
342
Stuttgart, Germany
I always use my G4 TI in public to do transactions with Leo AND NOTHING has ever happened and nothing will happen.
Nothing that you are aware of ;) ya know, those hacker dudes, they don't flush yer screen and write "U've been hacked!" in green letters on black background :D

Seriously, for you "security through obscurity" may be enough. Others seek at least a bit of security and a Firewall is your best bet without sacrificing much performance.
The most important rules I set on each and every of my devices (may it be Linux or Windows) is to drop any ICMP traffic in any network that's not my home net and drop nearly everything that's not needed for DHCP (and v6), browsing and e-mailing
 

doobybiggs

macrumors 6502a
Mar 5, 2012
561
24
Where would I find a good read or 2 on diving into security and all the above for macs and home in general
 

amagichnich

macrumors 6502a
Feb 3, 2017
516
342
Stuttgart, Germany
Where would I find a good read or 2 on diving into security and all the above for macs and home in general
one or two good reads I usually refer to:
https://blog.bejarano.io/hardening-macos/ (though much of the "good advise" is just crap on this site)
https://forums.macrumors.com/threads/securing-leopard.1879313/
http://preserve.mactech.com/articles/mactech/Vol.21/21.02/Security/index.html
http://newosxbook.com/files/moxii3/AppendixA.pdf
https://www.intego.com/mac-security-blog/15-mac-hardening-security-tips-to-protect-your-privacy/


from TenFourFox Development Blog:

EDIT: How do I get rid of that stupid link formatting??
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.