Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Apple > Operating Systems

Mac OS X Security and Mobility v10.6: Using a Firewall

  • Print
  • + Share This
This chapter focuses on mitigating and controlling access using Mac OS X firewalls on both the client and server. You’ll learn how to verify when attack attempts and system failures occur, and how to configure firewalls to guard against them.
This chapter is from the book


This lesson takes approximately 30 minutes to complete.


Control network traffic

Understand the firewall options in Mac OS X and Mac OS X Server

Explore the command line and remote configuration of firewalls

Security has never been more critical when administrating client and server systems.

Today’s external threats range from macro viruses embedded in documents and spreadsheets, to denial of service network attacks. All networked systems are potentially vulnerable to probes and attacks—intentional and unintentional—as assailants constantly scan systems connected to the Internet. However, attacks can also come from internal sources. In 2008 and 2009, the greatest number of reported data breaches actually came from within corporate networks.

To help administrators protect their systems, this chapter focuses on mitigating and controlling access using Mac OS X firewalls on both the client and server. In this chapter, you’ll learn how to verify when attack attempts and system failures occur, and how to configure firewalls to guard against them.

Understanding the Mac OS X Firewall

In the days before digital technology, the term firewall described an actual fireproof wall designed to contain fires, such as the barrier between a car’s engine and its passenger section.

Like those physical walls, computer firewalls work to prevent improper network packets from “burning through” a host or network perimeter. Today’s digital firewalls consist of hardware or software that blocks unauthorized network access from sources outside or inside your network.

Mac OS X has two software firewalls: the IP Firewall (ipfw) and the Application Firewall. While ipfw is available in both Mac OS X and Mac OS X Server, Mac OS X Server includes a graphical user interface for detailed configuration, monitoring, and troubleshooting. Mac OS X provides basic, user-oriented service configuration, and optional advanced configuration. Mac OS X Server also includes an Adaptive Firewall, which can add and remove firewall rules based on network events.

Using the Mac OS X Application Firewall

The most common method for securing network services is to configure a firewall at the network perimeter, where the network connects to a remote network such as the Internet. Most networks use a firewall to limit inbound traffic from the Internet or remote connections. In fact, most home and small business routers, such as Apple’s AirPort base stations, are designed with built-in firewall software.

While network-level firewalls will block unauthorized traffic trying to enter your network, they will not block traffic that originated inside your network. Also, if your Mac is mobile and frequently joins new wired or wireless networks, your computer will regularly encounter networks with different firewall rules or, possibly, no firewall protection at all. So secure mobile access is an important consideration in designing your overall firewall policies.

To protect against unauthorized network access to your Mac, you can enable the Application Firewall via System Preferences. Administrators can utilize command-line tools to enable and configure the firewall.

Network-based firewalls use a set of rules that target specific service port numbers, such as TCP port 80, the port used for standard HTTP services. However, certain network services—such as iChatAgent (the background process that receives incoming connections for iChat)—use a wide range of dynamically assigned ports. These dynamic multiport services use more than one port to transfer multiple data types. For example, iChat can transmit audio, video, screen sharing, and text all at one time, which requires a multiport approach. This typically causes configuration complications with network-based firewalls because numerous ports need to be open to allow the service to function.

As a solution to this issue, Mac OS X’s Application Firewall allows connections based on application and service needs without requiring the user or administrator to know the myriad ports these apps and services may use. For example, you can authorize iChatAgent to allow incoming connections without manually configuring ports or port ranges.

The Application Firewall in Mac OS X version 10.6 includes a new feature that enables administrators to allow signed software to receive incoming connections automatically. Applications that have been digitally signed by their authors can accept inbound network connections without further configuration from the user or administrator, simplifying administration of deployed systems. Digitally signing an application provides reassurance that the application has not been tampered with.

Its adaptive nature means the Application Firewall will open necessary ports only when an application is running. This prevents several types of known attacks on personal systems.

Configuring the Mac OS X Application Firewall

To enable and configure the Max OS X firewall using System Preferences, here’s what you do:

  1. Open iChat by clicking its icon in the Dock.
  2. Choose Apple menu > System Preferences and then click the Security icon to open Security preferences.
  3. In the lower-left corner of the security pane, click the lock icon and then authenticate yourself as an administrative user to unlock Sharing preferences.
  4. Click the Firewall tab, and then click Start to turn on the Max OS X firewall using its default rules.

    When the firewall is enabled, the Start button changes to a Stop button and the advanced button is enabled.

    The default firewall configuration allows incoming traffic for established connections (such as a website responding to a click in Safari) and communications from any signed software or enabled services. This default configuration provides a level of security that is adequate for most users.

  5. To customize the firewall, click Advanced for additional configuration options.

    You can see which services are currently enabled from the Sharing preferences. Sharing service ports are enabled by default when a service such as Web Sharing is enabled.

    If you want to exercise more control over the configuration, you can manually set which applications and services the firewall allows by selecting or deselecting the checkbox that automatically allows signed software.

    With this firewall choice enabled, when a network-aware application such as iChat opens or requests a network connection, a dialog, such as the one shown in the following figure, asks if you want to allow the application access to the network. This dialog will appear as a warning anytime a network-aware application requests incoming access for the first time.

  6. Click Allow to create a firewall rule that allows access for the application.

    When manually setting firewall access by application or service in the Advanced tab, you can return to the Advanced tab to review and modify or specifically deny connections.

    Another option provided by the firewall, Stealth Mode, prevents network probing tools that use common discovery tools based on the ICMP protocol (such as ping) from discovering the Mac is even on the network.

  7. Select the checkbox to enable Stealth Mode.
  8. From Applications > Utilities in Finder, open the Terminal and execute the following command to attempt to ping your system:
    ping localhost

    You will see the following timeout message illustrating that your system is not responding to the ping request.

    Request timeout for icmp_seq

    When utilizing your Mac on an unfamiliar network such as at an Internet café or a trade show, you can select “Block all incoming connections” to prevent any access except that required for basic network services, Internet browsing, and email. Selecting this option also will disable access to all shared services hosted on your Mac, but on an unfamiliar network this is highly desirable.

    Unlike in Mac OS X Server, in Mac OS X the command-line ipfw program is the only interface available to configure port-based rules for a firewall manually.

  • + Share This
  • 🔖 Save To Your Account

Peachpit Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Peachpit and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Peachpit products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive:

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020