Updated: See http://securosis.com/2007/11/15/ipfw-rules/.
I just spent entirely too much time digging into the Leopard firewall, and here’s what I’ve found. The less geeky version will be out on TidBITS (probably tomorrow); this is just the summary of actual behavior:
- “Allow all incoming connections” allows all- no surprises.
- In all firewall modes, if you don’t select Stealth mode, mDNS (Bonjour, 5353/udp) is open on a port scan.
- “Block all incoming connections” does seem to block actual connections, but any shared ports are detected as “open/filtered” on a port scan.
- In “Block all” mode with stealth mode enabled, those shared services no longer show on a port scan.
- Once you connect to another computer (outbound), Kerberos (88/tcp) is open and stays open no matter what you change on the firewall, including enabling stealth mode. This disappears on reboot. Other services may exhibit this behavior.
- If you choose “Set access for specific services and applications”, any time you launch a program which starts a listner, the system automatically pokes a hole in the firewall to reach it listeners, but only those in the Sharing preferences pane appear in the list of services. This rather defeats the purpose of the firewall, since any listener is automatically accessible!
- That mode is labeled differently in the help file than on the screen. In the help file, it’s “Limit incoming connections to specific services and applications”. Just a nit, but that seems clearer to me. At least they warn us if you dig into the help:
IMPORTANT: Some programs have access through the firewall although they don’t appear in the list. These might include system applications, services, and processes (for example, those running as “root”). They can also include digitally signed programs that are opened automatically by other programs. You might be able to block these programs” access through the firewall by adding them to the list.
- “Set access” mode seems incredibly inconsistent- some applications require you to authorize network connectivity on launch, and others don’t. For example, Skype and Firefox asked me for access, but Colloquy and Twitteriffic didn’t.
- If you are asked to authorize an application and let it connect to the network, the binary is automatically signed by the system if it wasn’t already. If that application changes, it breaks and won’t launch. You get no warning or indication that this is why your program no longer works. I only stumbled across an oblique reference in the console.
- If you open Sharing, but set “Block all”, your computer still appears on the network via mDNS, but no one can connect. Annoying.
I feel like I’m missing something, but I think that’s it. In short, block mode seems to block inbound connections but ports show as open/filtered. Stealth mode works, partially, but some ports still show on a port scan no matter what (like Kerberos). Bonjour is ALWAYS accessible, unless you’re in stealth mode. Application (“Set access…”) mode is a mess- code signing breaks applications, and the behavior is inconsistent. Any launched services are authorized and you can’t change the settings in the firewall GUI.
The good news is that ipfw
is still enabled and you can manually configure it or use a GUI like WaterRoof.
Looking at how all this works I can see what Apple was thinking, even though they made many bad decisions. When block all is enabled it does seem to block most traffic, but instead of leaving ports open/filtered it should close them, not show them as filtered (I suppose not everyone will agree; feel free to say so in the comments). Stealth works, mostly. It’s hard to tell without playing more, but I think the Kerberos issue is related to outbound services. I suspect (thinking back to how Kerberos works) that it must open an outbound port to authenticate a session when you connect to a remote server. The firewall allows this since it was initiated locally (thus implicitly trusted), but the Kerberos implementation probably doesn’t tear down the port when it’s finished and the firewall still sees it as authorized for return traffic. Just a guess, but this could also explain some behavior noted elsewhere.
This should address the findings in the heise security article which inspired this research. They just seemed to miss enabling stealth mode and I’ve added a bunch more on how application control works.
I’m done with the firewall for now- it took far too long to run all the scans in all the different modes just to come up with a few bullet points!
Reader interactions
10 Replies to “Investigating the Leopard Firewall”
All this so called stealth mode does, is blocking all ICMP traffic. You can check that with “sudo ipfw list”.
That means UDP port scanning does not work any more.
It relies on “ICMP port unreachable” packets.
So you are right, that the open ports don
[…] options? Are they independent or do they work in tandem? I did some poking around and found an excellent discussion that shed a little light on the subject. First off, “Block all” does not actually do that. It sort of does. So, most […]
[…] rmogull’s post on the 10.5 firewall for a lot more details, but without a detailed rant about […]
[…] under-the-hood as well). These features were heavily scrutinized, with the new firewall taking an especially hard beating and was the subject of the aforementioned end of year 10.5.1 […]
So how about us ‘‘non’’ techies? I miss Norton Firewall because I somehow felt protected – I don’‘t see anywhere in Leopard where it says Block All Incoming Connections – mine are
Allow All Incoming
Allow Only Essential Services
Set Access for Specific Services and Applications
So are you saying Stealth Mode is not worth using? And what do the logs mean anyway? that someone was trying to access the computer through any open ports? or didn’‘t get in?
I looked at the logs but can’‘t really define what they mean: as an example, here’s a couple – does this mean an attempt was made thru the Firewall? (I removed the name of the macbook pro so my real name wouldn’‘t show up there)
Dec 3 21:18:55 my-macbook-pro-15 Firewall[48]: krb5kdc is listening from 0.0.0.0:88 uid = 0 proto=6
Dec 3 21:21:14 my-macbook-pro-15 Firewall[47]: krb5kdc is listening from :::88 uid = 0 proto=6
Dec 3 21:21:14 my-macbook-pro-15 Firewall[47]: krb5kdc is listening from 0.0.0.0:88 uid = 0 proto=6
Dec 3 21:22:35 my-macbook-pro-15 Firewall[47]: Stealth Mode connection attempt to UDP 10.0.1.200:49187 from 10.0.1.1:53
Dec 3 21:40:24 my-macbook-pro-15 Firewall[47]: Stealth Mode connection attempt to TCP 10.0.1.200:49205 from 17.250.248.161:5354
Dec 3 21:55:44 my-macbook-pro-15 Firewall[47]: Stealth Mode connection attempt to UDP 10.0.1.200:49309 from 10.0.1.1:53
Dec 3 21:56:24 my-macbook-pro-15 Firewall[47]: Stealth Mode connection attempt to UDP 10.0.1.200:49318 from 10.0.1.1:53
Where can I get plain English information on what to use for the firewall settings and what will actually work? I don’‘t think WaterRoof is for folks like me with no technical understanding. I don’‘t know what kind of rules to set in it. I didn’‘t understand the automated ones with the questions ether. It was supposed to set it up automatically with asking a couple of questions but the answers don’‘t apply to me.
Is there actually firewall software that will do the trick to keep the mac secure? Thanks for your help. Perhaps I’‘m in the wrong area with these questions, but any help would be appreciated.
P
[…] uno de los mayores errores que he visto en Mac OS X desde hace tiempo. Efectivamente, en internet las críticas a este nuevo firewall de Leopard no son pocas, y las justificaciones de Apple de no tratarse de un firewall, sino de una “Aplicación […]
[…] on Leopard Firewall: Tidbits article securosis.com article Apple’s article on the 10.5.1 […]
[…] but I have found some rebuttals of the Heise article which say it’s not as bad as it all seems. One here, and this one which is a good rundown of what’s happening. I’‘m not saying Apple couldn’‘t have done […]
[…] to applications not working anymore. For a concise reading about the whole thing I recommend this article on securosis.com. At the time of this writing the best compromise seems to be to disallow incoming connctions and […]
[…] need to completely thank and acknowledge windexh8er for suggesting this post in the comments on the Leopard firewall post, and providing the starting content. In his (or her) own words: So how about everyone constantly […]