MacOS Sierra’s firewall feature blocks unwanted network traffic coming into your computer, and Stealth Mode makes your Mac essentially invisible to hackers snooping for computers to target. Symptoms 2 and 3 are caused when the Mac OS X Firewall, found in the Sharing preference pane, blocks the port used for local iChat traffic (5298). Firewall blocks this port in its default configuration. Follow these steps to open port 5298: Open System Preferences. Click the Firewall tab. Click the New button.
![]()
Home > Articles > Apple > Operating Systems
␡
< BackPage 2 of 8Next >
This chapter is from the book
Apple Training Series: Mac OS X Security and Mobility v10.6: A Guide to Providing Secure Mobile Access to Intranet Services Using Mac OS X Server v10.6 Snow Leopard
This chapter is from the bookThis chapter is from the book
Apple Training Series: Mac OS X Security and Mobility v10.6: A Guide to Providing Secure Mobile Access to Intranet Services Using Mac OS X Server v10.6 Snow Leopard
Understanding the Mac OS X Server Firewall
Though Mac OS X’s Application Firewall provides a simplified interface for handling firewall rules based on services and applications, Mac OS X Server administrators require more granular access controls than the Application Firewall provides. Mac OS X Server v10.6 contains a host-based firewall service based on ipfw software that was developed as part of the FreeBSD project. This traditional stateful packet firewall provides stateless or stateful packet inspection.
Stateful packet inspection tracks the state of network connections traveling across it. A stateless firewall looks at packets as individual events. A stateful firewall, on the other hand, can track multipacket communication sessions and more intelligently accept or deny traffic. For example, a stateful firewall can remember that a protected client initiated a request to download data from an Internet server and allow data back in for that connection.
Mac OS X Server can do both stateless and stateful processing. To use stateful processing, Mac OS X Server adds the keep-state keyword to rules. Since the release of Mac OS X Server version 10.5 Leopard, an Adaptive Firewall has been present in OS X Server. The Adaptive Firewall will monitor firewall activity and block an IP address that has excessive failed login attempts.
While documentation may make this seem like a second firewall, the Adaptive Firewall is really a monitor that dynamically creates and disables rules in the ipfw firewall as needed. The Adaptive Firewall is currently called into action following ten failed login attempts. Such behavior blocks the requesting IP address for 15 minutes, which makes brute-force password attacks virtually impossible. No administrator needs to take action to enable the Adaptive Firewall, as it is enabled by default.
Accessing the Firewall Setup
Some servers will have access to several networks such as an internal network, the Internet, and a management network. To avoid having to configure rules manually for each system on a specific network, you can create an address group to handle network addresses. The Address Groups tab in the Settings pane enables you to group addresses logically and create address ranges to which you can then apply rules. An address group can be a single address, such as 192.168.3.1, or a range of addresses, such as 192.168.3.0–192.168.3.255. You can set up a range of addresses using subnet mask notation (192.168.3.0: 255.255.255.0) or Classless Interdomain Routing (CIDR) notation (192.168.3.0/24).
Configuring Service Firewall Rules
The Services tab defines the rules for predetermined services for a given address group selected in the pop-up menu.
By default, all traffic is allowed out, but only Apple administrative ports and established traffic are allowed in. Established traffic has validly been sent out and is receiving a reply. Established traffic may receive reply traffic on ports that are closed, but because the firewall software tracks established traffic, use of the ports is allowed for established traffic streams.
The Services tab contains a long list of predefined services, any of which may be activated for a given address group. If the service or port range needed has not been predefined, it is easy to add a custom service. To add a custom service like Jabber for the iChat service, do the following:
As mentioned earlier in “Understanding the Mac OS X v10.6 Server Firewall,” the firewall service in Mac OS X Server is built on top of ipfw, a kernel-based application. This means that the actual code for the ipfw service(s) is built into the kernel stack, making it extremely fast and secure from tampering. You can control ipfw via the same-named command-line program.
Verifying current firewall rules is simply a matter of asking ipfw to list them. This list corresponds to the list in the Active Rules pane in Server Admin.
Allow An App Through Windows Firewall
Using Stealth Mode
In the Server Admin Settings pane, under the Advanced tab, you can set stealth options and create custom rule sets for the firewall service. Stealth options drop denied packets rather than sending the requesting computer an error message.
Once you have completed setup and testing, you should enable the Stealth Mode option for both TCP and User Datagram Protocol (UDP), which makes the job for attackers much more difficult as probing attacks and open port discovery are thwarted.
Understanding Firewall Rule Priority
The rules in the Firewall Settings Services pane operate with the rules shown in the Advanced tab. Usually, the broad rules in the Advanced tab block (or open) access for all ports. These broad, lower-priority (higher-numbered) rules apply after the rules in the Services pane.
The rules created in the Services pane open access to specific services. Higher in priority, Services rules take precedence over those created in the Advanced tab. For most normal uses, using the Advanced tab to open access to designated services is sufficient.
If you create multiple rules in the Advanced tab, the rule number determines the precedence for a rule. This number corresponds to the order of the rule in the Advanced pane. You can reorder rules in the Advanced pane by dragging them up or down in the list. If necessary, you can add more rules using the Advanced pane.
Using ipfw
Although Server Admin treats the firewall as a service, it does not implement the firewall by a running process. Implementation is simply a set of behaviors in the kernel, controlled by the ipfw and sysctl tools. To start and stop the firewall, Server Admin sets a switch using the sysctl tool. Use the sysctl tool to enable the firewall as follows:
You can also disable the firewall by changing the setting to 0:
A successful command will respond with the change made represented after the arrow.
Regardless of this setting, the rules loaded in the firewall remain. But they are ignored when the firewall is disabled.
You can also use the ipfw command-line program to manipulate firewall rules. This is practical when you’re working remotely or over ssh, or when a scripted solution is needed.
As an example rule, imagine that an Xserve with multiple network interfaces—physical or virtual—is running AFP (Apple Filing Protocol) for file access. The security team decides that AFP should be available only on the subnets that it is serving. AFP does not have the control to specify which interface it binds to. However, you can use the built-in firewall, ipfw, to block AFP on the unwanted ports. For example, to block AFP on the en0 interface, you can use the following command to add the appropriate rule:
The keywords to ipfw are as follows:
If a rule number is not specified, ipfw will assign a default number to the added rule. You may want to specify this rule number yourself because the firewall evaluates rules in a sequential order. When a default rule number is assigned, it will be done in such a way that the rule becomes the last rule, prior to the default rule. You can add an equivalent AFP-blocking rule using this command:
However, doing so specifies the rule number (6000). The command lists the destination port by service name (afpovertcp) and gives an IP address rather than an interface name.
If a rule is incorrect or no longer needed, you can remove it with the del (delete) command by executing the following:
Using Firewall Log Files
The firewall sends log messages to /var/log/ipfw.log. For example, if the AFP service was blocked and a subsequent user request was made to the AFP service from a computer with the IP address of 10.1.17.2, the log might read:
Each log entry follows a similar form:
For the firewall itself, each message follows this pattern:
You can fine-tune logging from the Server Admin graphical user interface (Settings > Logging) or by using the serveradmin command-line utility. For example, to log all allowed packets, you can make the following serveradmin call:
Using Firewall Configuration Files
In Mac OS X Server, the firewall is a service that administrators can configure. In contrast, Mac OS X does not support the firewall directly. Its ipfw-based firewall has no graphical user interface and you must manipulate it via the command line. However, Mac OS X does contain the Application Firewall, which you can configure in Security preferences.
Mac OS X Server uses several files for its ipfw-based firewall. The following configuration files are stored in /etc/ipfilter: Igrill app run on macos.
Server Admin writes to these configuration files. Note that:
https://everdirect526.weebly.com/blog/memory-management-app-mac. When added to ipfw.conf, rule 3000 is appended to the rule list, allowing HTTP on any interface. In addition, two premigration files may exist if the server was upgraded to version 10.6 from an earlier version.
Copytrans apps beta mac. As mentioned in the section “Using Firewall Log Files,” the Mac OS X Server ipfw logs messages to /var/log/ipfw.log. The Mac OS X Server Adaptive Firewall is configured by and uses several files:
Do not manually edit the whitelist and blacklist files. Rather, you should use the command-line utility afctl to modify these files. The Apple Event Monitoring daemon, emond, performs the actual monitoring and spurs the Adaptive Firewall into action. While emond is an off-limits subsystem, the man page states that “emond accepts events from various services, runs them through a simple rules engine, and takes action.” One of its rules is /etc/emond.d/rules/AdaptiveFirewall.plist.
This rule is activated after ten failed login attempts and blocks the offending host attempting the login for a period of 15 minutes.
The Mac OS X Application Firewall also contains configuration files that affect its behavior. The Application Firewall is configured in Security preferences.
The Application Firewall can also be configured using the command line. The socketfilterfw program, which resides in /usr/libexec/ApplicationFirewall, can query and configure the Application Firewall. There is no man page for socketilterfw, but a usage statement can be printed when using the -h switch.
By default, the Application Firewall is set to allow all incoming connections. The Application Firewall offers two choices for any given application: “Allow incoming connections” and “Block incoming connections.”
The Application Firewall logs its activity at /var/log/alf.log and is enabled by default when the Application Firewall is active.
A sample log snippet follows:
Allow App Through Firewall Mac Os 10.13
You can set the Application Firewall state from the command line using the defaults command to alter preferences:
In this command, the integer passed is one of the following:
The main preference file for the Application Firewall is located in /Library/Preferences/com.apple.alf.plist.
The executable files for the Application Firewall are located in /usr/libexec/ApplicationFirewall.
Related Resources
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |