TweetFollow Us on Twitter

Mac OS X Security Volume Number: 17 (2001)
Issue Number: 4
Column Tag: Mac Security

Mac OS X Security

By Jesse Corbeil, Montréal Québec

Securing a Mac OS X workstation for stand-alone or home use out of the box

Note: Mac OS X is currently in Public Beta. The final version may invalidate any or all of this paper. That's just a chance we take when we write how-tos about beta operating systems

In the world of operating systems, the Macintosh platform has traditionally been everybody else's secure neighbour. Not many virii or cracks affected the Mac (unless we counted cross-platform Word macros), and we were generally spared the heaps of abuse that were laid onto our Windows-using brethren. Whether this has been due to the brotherly Mac community or the simple fact that there aren't enough Mac OS computers out there to make it worthwhile is up for debate. The truth will become clear when we all trash our old Macs and buy brand-new Cubes to run Apple's swank new OS. Why is that? Because Mac OS X is nothing more than a shiny interface on top of a tweaked BSD core, and BSD is very much slugging it out at the centre of the cracks and exploits blattleground. With that in mind, this article will discuss how to secure the default installation for a workstation or for home use.

BSD

Unix-cowboys have it all over us Mac users. They trade in the ease-of-use and smooth operation to which we are accustomed on the Mac side for raw, unlimited power over their machines. The easy Mac or Windows click-to-install approach is shunned in favour of the ability to tweak the code of an app that didn't install properly; cutting, thwacking, and generally forcing the code until the app clicks smoothly into place. Further, whereas we tend to troubleshoot by twiddling the knobs and banging the pipes, Unix-gurus crawl under the sink to pull the works apart. They know their machines better than we know our mothers.

Now, all that is about to change- at least for those of us who actually want to dig about under the hood and still enjoy the Mac OS experience.

With the change to Mac OS X, Apple reduces the number of major-player non-Unix OSes by one, while simaultaneously giving the Unix world something it has been trying to develop with imperfect solutions like KDE and Gnome: a distro with a polished and usable GUI.

What the BSD core (fetchingly called 'Darwin') gives back to the Mac is a rock-solid OS with all the buzz-technologies incorporated: multi-this, protected-that, and the new-to-Mac concept of an application crashing without taking down the OS. Unfortunately, what else we get is a security headache. Suddenly, all those Unix-savvy hacks and virii are mac-savvy too. Added to that (and I feel safe in going out on this particular limb), the country-bumpkin image that the Mac OS has enjoyed in hacker circles is about to be replaced by a perception of the OS as the sexy new Unix. Eager crackers will want to try out all the exploits and probe the nooks and crannies.

The Swiss-Cheese OS

Once they've been properly set up, the BSDs are generally pretty secure. They are developed by security-conscious communities and tend to be deployed in sensitive areas like networking and databasing. The Calgary-based OpenBSD is regarded as the most secure BSD distribution, incorporating many crypto and security features that would be non-exportable had it been an American distro subject to US export laws. Obviously, Apple could not have based Mac OS X in Open BSD and still sold the OS outside the US, but the more freely-exportable BSDs are still very secure, and the choice to base Mac OS X on the platform is still a solid one.

OpenBSD aside, any distro must be properly hardened to close up some of the dozens of holes left open by a default installation. This is where Darwin shows its BSD roots, and where a certain familiarity with Unix system hardening comes in. On a typical BSD system, one of the things an admin would do to secure the system is to edit the inetd.conf file to disable unneeded services. Mac OS X comes with the inetd.conf file already set up in a pretty secure configuration, but that doesn't mean that the OS is completely tight. There are other security holes in the default setup (such as services not covered by inetd.conf) that must be addressed before deploying the OS in a secured environment. When configuring services, the general rule of thumb is If you're not using it, turn it off.

There are some cool gewgaws in Mac OS X, though their default configurations can be pretty insecure. Running dmesg, for instance, reveals that there is an IP packet filter initialised but that it's wide open; The NFS daemon is active by default, which opens up a security hole, as does the Portmap daemon. There's an NTP daemon enabled, which opens a very slight security risk: though one wouldn't generally try to compromise the system through NTP, it is theoretically possible to muck about with it to make time-sensitive apps do one's bidding. But by far the coolest feature of the OS in terms of un-fubar-ability is the separation of admin accounts from the central, all-powerful root user. As part of the OS installation, I was asked to create an administrator account for myself. I set the system up as "jcorbeil," which is the account I generally use. From there I can administer just about anything on the machine - so long as the function is GUI accessible. However, if I try to enter rm -rf * in a Terminal window, the system will tell me to stuff myself. Why is this? It's due to Apple's approach to Mac OSX's design. Apple has made it as difficult as possible to hose your system by limiting GUI access to most of the really dangerous functions. That's a smart move on Apple's part, as it effectively stops non-gurus from inadvertently committing atrocities.

Another safety feature was revealed when I checked out the NetInfo application, which is where all system and user information is centralised. I discovered (and verified via a quick etc/passwd check) that even though my account is an administrator account, the system still pledges its allegiance to a separate root account that was automatically generated during installation. In other words, "jcorbeil" may be the system admin, but he doesn't have the same set of priviledges as the bonafide root user. To do something that only the root can (like erase the works), I have to su to root in Terminal, then do my damage. It's not hard, as the root account shares jcorbeil's password by default, but there's a certain level of know-how involved in getting to the 'destroy-the-OS' point that is beyond the ken of most new users coming from a classic Mac OS background.

Openings and Closings

To get a bit of an aperçu of what ports are open on your system, open a Terminal window and enter netstat -an (Figure 1). This will display your machine's ports and whether they are listening, established, or closed. If you want to see the ports' names, use the netstat -a command. It's a safe bet that you'll find ports you don't recognise. That's normal, but for for those who want to know all about ports, http://www.doshelp.com/trojanports.htm has some resources for the inquisutive firewall admin.


Figure 1. What comes up when you type netstat -an

Chances are, you'll find two local addresses near the bottom of the list, called *.111 and *.514. These are our first two security issues. *.111 is portmap, which is a daemon for making RPC calls. It is also lousy for security, and is best turned off. *.514 is the syslog daemon, which listens on UDP and receives log broadcasts from other servers. Sounds pretty innocuous, right? Well, UDP is not a two-way protocol, so there's no way for syslog to verify whether or not the sender of a given datum is who he says he is, which opens up the potential for a denial of service attack. Nasty stuff. Tighten *.514 up by using IPF to stop connections other than 127.0.0.1 (more on this later).

After that, run a search for any files that are either world-writeable or owned by the "nobody" user or group. Every one of these opens up a little security hole, and should therefore be viewed with great circumspection. You might need a couple of them, you might not. Look about and clean up what you can by tightening up the access control to world-writeable files or files with 'nobody' ownership.

IPFilter: Built-in Security

IPFilter is a firewall that gets installed with the kernel, and is where some of the power of a BSD-based OS comes to the fore. IPFilter alone warrants a book or two, but there are some basics that everyone can use as a springboard to using IPF fairly quickly.

IPF works by processing a rules file. The rules file is a text file of conditions and actions for IPF to take when those conditions come to pass, for example blocking packets, letting packets through, and logging them. Set up IPF's rules file for blocking, passing, and logging based upon the criteria you want to employ. For example, say you don't want TCP packets coming in. You would edit the ipf.rules file by entering the following line of text:

block in on ed0 proto tcp from any to any

If you wanted the above to block only one port (say *.514), you would change the text to read:

block in on ed0 proto tcp from any to any port = 514.

Fiddle with the file, blocking and unblocking ports until you have a tight system from which you can still run the transactions you need. It is generally a good idea to start off your rules file with a command to block all ports. That way, any port that doesn't have a rule expressly attributed to it is covered by the first rule, and is blocked.

IPF is quite powerful, and it's a good idea to become well-acquainted with it. More in-depth information can be found at http://coombs.anu.edu.au/ipfilter.

SSH and Kerberos

Two things that I haven't touched on in this article are SSH and Kerberos. That has been done on purpose, as there is very little to be done with either of them for a home or standalone system set-up. SSH comes as part of the standard installation and is an extremely effective tool for keeping your system tight. For our purposes, you won't need to change the configuration. Just be serene in the knowledge that it's running and it has your safety in mind. Accordingly, you don't need to run services like rsh, telnet, rlogin, or ftp. They represent unneeded security risks, so unless you expressly need one of them for something, shut them down.

Kerberos uses a client/server setup, and you would only worry about Kerberos if you were on a network that uses the protocol. Since we're securing a home machine, we'll leave Kerberos alone.

Take it to the Bone

These solutions are not the be-all, end-all secret to how to secure your home system from a brilliant hacker, but they do form a solid foundation from which you can do further research into the methods and tools available to secure your computer. If you want to read further, check out the IP FilterFAQ at http://coombs.anu.edu.au/ipfilter/ipfilfaq.html, or read O'Reilly's Practical UNIX & Internet Security by Garfinkel and Spafford.

Whether or not you decide to delve into the deep, dark depths of computer security, a basic knowledge will still help you understand the basics. Basic knowledge will at least let you understand the theory behind a security breach that might nail your machine, and understanding will hand you the keys you need to get the problem fixed. Computer security doesn't have to be scary, indeed, it can even sometimes be fun. Getting caught unawares by a cracker, on the other hand, can cause you immeasurable pain.


Jesse Corbeil is the Director of Documentation at SecureOps, a network security consulting firm in Montréal, Canada. He has written for beoscentral.com and several other information sites, and is involved in the Marathon Open Source project.

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »
Top Mobile Game Discounts
Every day, we pick out a curated list of the best mobile discounts on the App Store and post them here. This list won't be comprehensive, but it every game on it is recommended. Feel free to check out the coverage we did on them in the links below... | Read more »

Price Scanner via MacPrices.net

Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
Every model of Apple’s 13-inch M3 MacBook Air...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices are the lowest currently available for new 13″ M3 MacBook Airs among... Read more
Sunday Sale: Apple iPad Magic Keyboards for 1...
Walmart has Apple Magic Keyboards for 12.9″ iPad Pros, in Black, on sale for $150 off MSRP on their online store. Sale price for online orders only, in-store price may vary. Order online and choose... Read more
Apple Watch Ultra 2 now available at Apple fo...
Apple has, for the first time, begun offering Certified Refurbished Apple Watch Ultra 2 models in their online store for $679, or $120 off MSRP. Each Watch includes Apple’s standard one-year warranty... Read more
AT&T has the iPhone 14 on sale for only $...
AT&T has the 128GB Apple iPhone 14 available for only $5.99 per month for new and existing customers when you activate unlimited service and use AT&T’s 36 month installment plan. The fine... Read more
Amazon is offering a $100 discount on every M...
Amazon is offering a $100 instant discount on each configuration of Apple’s new 13″ M3 MacBook Air, in Midnight, this weekend. These are the lowest prices currently available for new 13″ M3 MacBook... Read more
You can save $300-$480 on a 14-inch M3 Pro/Ma...
Apple has 14″ M3 Pro and M3 Max MacBook Pros in stock today and available, Certified Refurbished, starting at $1699 and ranging up to $480 off MSRP. Each model features a new outer case, shipping is... Read more
24-inch M1 iMacs available at Apple starting...
Apple has clearance M1 iMacs available in their Certified Refurbished store starting at $1049 and ranging up to $300 off original MSRP. Each iMac is in like-new condition and comes with Apple’s... Read more
Walmart continues to offer $699 13-inch M1 Ma...
Walmart continues to offer new Apple 13″ M1 MacBook Airs (8GB RAM, 256GB SSD) online for $699, $300 off original MSRP, in Space Gray, Silver, and Gold colors. These are new MacBook for sale by... Read more
B&H has 13-inch M2 MacBook Airs with 16GB...
B&H Photo has 13″ MacBook Airs with M2 CPUs, 16GB of memory, and 256GB of storage in stock and on sale for $1099, $100 off Apple’s MSRP for this configuration. Free 1-2 day delivery is available... Read more

Jobs Board

*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
IT Systems Engineer ( *Apple* Platforms) - S...
IT Systems Engineer ( Apple Platforms) at SpaceX Hawthorne, CA SpaceX was founded under the belief that a future where humanity is out exploring the stars is Read more
Nurse Anesthetist - *Apple* Hill Surgery Ce...
Nurse Anesthetist - Apple Hill Surgery Center Location: WellSpan Medical Group, York, PA Schedule: Full Time Sign-On Bonus Eligible Remote/Hybrid Regular Apply Now Read more
Housekeeper, *Apple* Valley Village - Cassi...
Apple Valley Village Health Care Center, a senior care campus, is hiring a Part-Time Housekeeper to join our team! We will train you for this position! In this role, Read more
Sublease Associate Optometrist- *Apple* Val...
Sublease Associate Optometrist- Apple Valley, CA- Target Optical Date: Apr 20, 2024 Brand: Target Optical Location: Apple Valley, CA, US, 92307 **Requisition Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.