|
|
Firewall configuration for OS X.3IntroductionMac OS X's firewall is included in both the Client and Server version of the operating system, though with different configuration interfaces. OS X is based on BSD so it is not too surprising that the firewall is based on a BSD application, in this case OS X.3 Client offers a basic graphical configuration interface to allow you to turn the firewall on and off, and to selectively allow simple services incluing filesharing, webserving and SSH. More sophisticated configuration must be done through the command line. The graphical interface for Apple's network services documentation (PDF) contains more detailed information on the OS X.3 Server firewall while MacEnterprise.org has an article on GUI firewall tools for OS X clients. Graphical interfaceFirewall configuration under OS X.3 Server is done using the "Firewall" section in the
The "Overview" tab allows you to view the current firewall ruleset.
Selecting the "Log" tab shows the firewall logs. Changing the log settings is done from the "Settings" and "Logging" tab combination.
Under "Settings", the "General" tab allows configuration of common services to be allowed or denied. This can be done for an individual IP address, a network address group, or "any" network address. Address groups can be created using lists of IP addresses, network ranges, or both.
The "Advanced" tab allows you to configure the firewall for services not listed under "General". You can manually enter the action (allow, deny), the protocol (TCP, UDP, Other), the service, and the source and destination ports and addresses. Command line interfaceipfw has a command line interface that is used to enter firewall rules in the format of: [prob match_probability] action [log [logamount number]] proto from src to dst [interface-spec] [options] Each packet can be filtered based on:
"prob" can allow matches to be made based on a probability and is not used much in practice. It could be useful if you wanted to drop packets randomly for some reason. "action" can be one of:
There are other actions, but these are the most common ones. Typing "man ipfw" at an OS X command prompt will bring up the manual page listing all the options. "proto" should be an IP protocol specified either by number or name (as listed in "from" and "to" refer to IP addresses and may be specified as:
"not" can be used to match the inverse, and a port number or range may be included when matching the TCP and UDP protocols. "interface-spec" can include:
OS X uses
To create an OS X server will allow you to use
Example server configurationsServer oneA firewall configuration for a server with a single ethernet connections offering:
# Flush all rules flush # Add stateful behaviour and allow established connections add check-state # Allow all loopback (lo0) traffic # Drop all traffic to 127/8 that doesn't use lo0 add allow ip from any to any via lo0 add drop ip from any to 127.0.0.0/8 # Allow DNS add allow udp from any to any 53 out keep-state add allow tcp from any to any 53 out keep-state # Allow NTP add allow udp from any to any ntp out keep-state # Allow inbound and outbound SSH add allow tcp from any to any ssh keep-state # Allow HTTP, HTTPS add allow tcp from any to any http add allow tcp from any to any https # Allow SMB file sharing to 128.250. range add allow udp from 128.250.0.0/16 to any 137-138 add allow tcp from 128.250.0.0/16 to any 139 add allow tcp from 128.250.0.0/16 to any 445 # Allow Apple file sharing to 128.250. range add allow udp from 128.250.0.0/16 to any 548 add allow tcp from 128.250.0.0/16 to any 548 # Allow all outbound traffic add allow all from any to any out keep-state # Reject and log all remaining traffic add reject log all from any to any Server twoA firewall configuration for a server with dual ethernet connections offering:
# Flush all rules flush # Add stateful behaviour and allow established connections add check-state # Allow all loopback (lo0) traffic # Reject all traffic to 127/8 that doesnít use lo0 add allow ip from any to any via lo0 add reject ip from any to 127.0.0.0/8 # Allow DNS add allow udp from any to any 53 out keep-state add allow tcp from any to any 53 out keep-state # Allow NTP add allow udp from any to any ntp out keep-state # Allow inbound and outbound SSH add allow tcp from any to any ssh keep-state # Allow inbound access to smtp via first ethernet device add allow tcp from any to any smtp in via en0 # Allow access to other mail services via second ethernet device add allow tcp from any to any pop3 in via en1 add allow tcp from any to any imap in via en1 add allow tcp from any to any pop3s in via en1 add allow tcp from any to any imaps in via en1 # Allow all outbound traffic add allow all from any to any out keep-state # Reject and log all remaining traffic add reject log all from any to any |
|
Contact the University : Disclaimer & Copyright : Privacy : Accessibility |
Date Created: 26 October 2004 12:03 |
© The University of Melbourne 1994-2005 |