A Security Primer for Mac OS X
Pages: 1, 2, 3
Use and Maintain Antivirus Software
A few Mac users unfortunately sometimes think that they do not need to worry about viruses since "there are no viruses for Mac OS X."
First of all, this is not entirely true and some macro viruses can travel cross-platform. However, even if this really were the case, you should still scan your computer regularly. That way, you will not only be able to stop PC viruses before you forward them to your PC friends inadvertently but also will be able to react very quickly in the event of a massive Mac compatible infection.
Again, there are many anti-virus solutions out there and many companies sell anti-virus software with more or less identical features. However, since many .Mac members will use Virex, this is the program I am going to focus on. Would you already rely on another product, you should be able to adapt most of this advice.
The default Virex preferences are curiously set up and you may want to change them a bit.
The first thing to do is to make sure that Virex performs an "advanced scan of applications and macros." Heuristic scanning is a method of scanning the files that attempts to recognize the characteristics of viruses, even if they are not listed in the virus definitions. This slows the scan down a bit but definitely provides an extra layer of security you shouldn't live without.
Of course, no anti-virus software, even with the best heuristic scanning capabilities can protect you in an efficient manner if you do not update your anti-virus definitions. McAfee, like most anti-virus companies, updates its Mac definitions once a month--and, let's face it, this is not enough to stop PC or Unix viruses. Would you be ready to use the Terminal, there is a way to update your definitions a lot more often! Here's how.
- Open Virex and click on the "Virus info" button located in the toolbar
- This will open the Network Associates Virus Information Library in your default web browser
- By using the navigation bar on the left, click on "Downloads"
- On the page that appears, click on "DATs"
- Then, click on "Weekly v.4.x (DAT only)
- Click on the link next to "Unix"
- This will download to your desktop a compressed file called dat-xxxx.tar that you should decompress.
- Now, open the Terminal application located in your "Utilities" folder and enter "cd [path to the folder]" Hit return to execute the command.
- Enter this command : sudo cp *.dat /usr/local/vscanx and hit return. You will be asked to type your administrator password - no feedback will appear on the screen while you type it - and to press return once again.
- You should now be able to quit and re-launch Virex to use the latest definitions. In order to make sure that the upgrade was successful, just have a look at the "Results" field. It should state that your virus definitions have been updated recently.
Virex Command-Line Scanning
Note: This paragraph assumes that you are comfortable with the Terminal.
Virex allows you to automate scanning each time that you log in.... This may be convenient for some users but you may want to scan your hard drive at another time every day.
Ideally, you should scan your hard drive every day during your lunch hour : at this time, the computer is probably almost idle so the scan can go more quickly and it won't interfere with your daily routine.
Also, would Virex find an infected file, you will be able to see it almost immediately and take the appropriate steps.
Since Mac OS X is a UNIX-based operating system, it allows you to automate tasks by using a built-in component called "cron". You will need to edit the system's cron file to automate Virex.
Since this file already contains some important system information, you may want to use caution while you edit it: you definitely don't want to disable the Mac OS X maintenance tasks.
Follow these steps carefully in your terminal. In our example, the scan will run at 1 PM every day. Feel free to choose another hour, knowing that the command reads:
minutes hours day of the month month weekday
A "*" says "any"
- Open the Terminal application located into your Utilities folder
- Enter "cd /private/etc" to tell the Terminal to focus on the contents of the "etc" folder
- Enter "sudo pico crontab" and enter your administrator password when prompted
- By using the arrow keys on your keyboard, place the cursor below the last line of ext.
- Enter the following command :
0 13 * * * root /usr/local/vscanx/vscanx -rv
--secure / >/Applications/virexreport.txt
Note that the stars and numbers are separated by "tabs" and not by spaces. To check if the line has been entered correctly, makes sure that it aligns perfectly with the ones already existing in the file.
Now, enter Control X to exit, then enter Y and return to save the file to the disk.
Every day at 1 PM, Virex will run in the background as root and scan your computer. Once it is done, it will create a text file in your Applications folder, containing the report. Make sure that you read it carefully every day to make sure that your system wasn't infected and to know more about what happened. Once you have read it, delete it. That way, if the next day the test crashes and does not produce a report, you will notice it instead of reading the old one, thinking that it is the latest status of your system!
Do Not Enable the Root User
Since the root user is, according to the Unix permission scheme, all powerful, most attacks and exploits are targeted at it. Therefore, for security reasons, Apple has disabled it and only allows you to temporarily gain root privileges by entering your administrator password.
Some advanced Unix users may need to enable the root account to perform some complex administrative tasks but you should not do it, even if some tutorials suggest it. Doing so is not creating a security issue in itself but will make breaking into your system much more rewarding!
To temporarily execute commands in the terminal with root privileges, simply add "sudo" in front of all the commands you want to execute with super user privileges.
Some security tutorials even recommend that you create another, simple user, account for your everyday work. If you feel comfortable about doing it, it may indeed be a good idea. However, it can be a real issue for users who often install or compile applications on their Macs-- since such operations require administrative privileges.
Going Further
|
Related Reading
Mac OS X: The Missing Manual, Panther Edition |
Now that your computer is properly firewalled, that you have a solid anti-virus protection and that you use secure passwords, you have achieved a security level that every single Mac user--and computer user in general--should at least have.
However, there are still ways to go a bit further without disturbing your workflow too much... If you are willing to have a look at a few other cool applications and technologies, here we go!
Use a Reverse Firewall
While you are using your Mac, many, many applications constantly try to access the internet, to either get information or send some. The problem is that some of them may, along the way, send some details that you deem confidential--or be simple Trojan Horses.
To avoid this, you can install "reverse firewalls" that monitor outgoing connections and provide you with live alerts, allowing you to accept or deny attempts.
Of course, such third-party products are not perfect since you have to trust the authors and that they too, install kernel extensions to provide you with alerts.
However, the best of them can be a real help--give it a try and you will be surprised to see how many applications try to establish connections without your permissions!
One application in this category that is widely known in the Mac community is Little Snitch--but it's not the only one and you may want to look at other options and their various feature sets first.
Before installing them, though, you should be aware that such products may sometimes interfere with Mac OS X in itself--they can prevent fast user switching from working, for example. Luckily, since their authors are at hard work to improve them, compatibility issues disappear pretty quickly.
On a more legal note, keep in mind that preventing some applications from connecting to their authors site for registration and license controlling purposes may be unlawful in your country. You may want to check with your legal advisor or the authors of the application first.
Reverse firewalls are likely to generate many alerts when you first install them. You should take the time to fine-tune their rules to ensure maximum security. For example, allowing an application to establish "any connection" can be tempting but it entirely disables the protection that you could enjoy against this application--even if the application is trusted, remember that everything is hackable.
An important point to check is whether or not your reverse firewall can protect itself against malicious applications that would try to alter its database. Most of them won't have a very secure self-check system but you should make sure that there is one to increase your security.
Use a Tripwire-Like System
Let's say that someone has broken into your computer and has begun to alter various configurations files to use your computer as a base for his unlawful activities.
Luckily, there are some applications out there that can regularly calculate the checksum of your files (see the md5 information above) and compare it with a list of known-good files. Such a system can certainly be defeated by altering the reference database but it will provide you with an extra layer of security--and can be a real life saver under certain circumstances.
Brian Hill, author of the world famous Brickhouse has released an application called "CheckMate" that acts the same way and that can check on a regular basis if any of your system files--or data files of your choice-- were altered without your consent.
Here is how to use this application.
- Download it from here
- Launch the installer and read carefully the information printed on the screen. Do not install it system-wide but instead, on a per-user basis : that way, the installer won't ask you for your password.
- To install CheckMate, click on the "Install" button--nothing ground breaking but there is a tip : you are likely to only hear the alert sound. This does not indicate an issue and chances are that CheckMate has indeed been installed, even if no feedback is given
- To set CheckMate up, open the "System Preferences" application and click on the "CheckMate" icon, located in the "Other" category.
- Once you have authenticated, set up the check schedule and your notification options. I would recommend to avoid sending a mail --unless you work remotely but be sure to both log it and display an alert dialog.
- In the Files tab, click on the "Update checksums" button : this will create a database of "considered-good" checksums. Would a file be already corrupted, CheckMate wouldn't notice the issue at this point. Would you see files for which no checksum appears, this may mean that they do not ship with Panther any more. Simply remove the file from the list. Add any files you deem important or that may hold critical data.
- You can now click on "Apple Settings" and exit CheckMate
- To perform a test, re-open it and launch a manual scan by using the "Scan" tab. In my test, CheckMate sometimes ran into an infinite loop when multiple manual scans are performed in a row but the application never has an issue with background scanning--and that's the important part.
To make sure that CheckMate runs normally, you can have a look at the system log, by using the "Console" utility.
The fact that an application like CheckMate reports an integrity check error does not necessarily mean that you have been hacked. Indeed, updating the prebinding of files--a task commonly performed by installer-- can alter the checksum and cause an alert to appear.
Before worrying about an alert, you should always ask yourself whether there was a reason for which the file was modified.
There are many applications like CheckMate and each has its own strengths and weaknesses. By going through their respective feature sets, you will be able to find the one that best fits your needs. For example, do you need a GUI or do you prefer the Terminal? How secure should the application be? And how easy to use?
Final Thoughts
Security is a never-ending quest but, thanks to Apple's attention to detail and commitment to security, we Mac users enjoy one of the most secure operating systems in the world. By following a few simple steps, we can go even further and make sure that even if the worse happens, we will remain safe and secure. By applying the same principles to online security than you would in real life, you can avoid many, if not most issues. Have the right attitude, use the right tools, and you should be safe.FJ de Kermadec is an author, stylist and entrepreneur in Paris, France.
Return to the Mac DevCenter
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 12 of 12.
-
Checksums for Virex?
2005-10-11 13:37:12 John W. Adams |
[Reply | View]
-
Symantec firewall scan
2004-02-27 14:39:30 won [Reply | View]
Disclaimer. While I'd class myself as an advanced-to-power Mac user, I freely admit that the inner workings of firewalls are mysteries to me. I can set them up, given the correct tools and advice...
Or can I?
All of my attempts to glean a useful response from Symantec's so-called firewall scanner produced what seems to be the exact same result, regardless of personal software firewall configuration.
Firstly, it won't run in Mozilla. Minus ten points. :-)
After having spent quite some time earlier hardening my Firewalk and built-in Apple firewalls using the GRC site (https://www.grc.com/x/ne.dll?bh0bkyd2), I was shocked and dismayed (the woe! the agony! gnash, rend etc.) to see that my FTP ports (20-21) were wide open, my "RPC backdoor" port (514) was open, port 80 was open and my computer was responding to pings like an unpatched Windows machine at a h4x0r symposium.
I then tried explicitly blocking those exact ports and firming up the ping response in Firewalk. To no avail. Apparently the same results. GRC, meanwhile was still reporting that my Mac was 100% stealthed.
As they say in modern parlance, WTF?
I tried the Symantec thing days later in Safari after having deleted the cache and, get this, AFTER HAVING DISABLED BOTH FIREWALLS.
Same result.
I then fired up Explorer. Same result.
Doubtless, you can understand why I no longer trust Symantec's analysis. Were I a little richer and perhaps more paranoid, I'd have ordered one of the two products so prominently displayed on the results page, Norton Personal Firewall or Norton Internet Security.
Is it that I NEED a hardware firewall? Is there some hidden magic that Symantec products work that will protect me from things other than their scanning page?
Suspiciously, (though probably ignorantly) yours,
won -
Symantec firewall scan
2004-02-28 02:01:28 FJ de Kermadec |
[Reply | View]
Hi !
Ooops !
First of all, keep in mind that, like any scanning service, the Symantec site may not always be 100% accurate. You may want to ask the authors of the firewall you are using for another reliable site that you can use.
All the companies that provide such tests do use the result pages to include advertising for their products. The fact that I included a link to the Symantec site in my article is not a "recommendation" to use their products : you know best which firewall suits your needs.
However, having ports 20-21 open is, unless you have turned FTP on, both abnormal and dangerous.
Indeed, this may indicate that you are running ( knowingly or not ) an application that listens to these ports and is ready to receive or transmit data. Would you know which application could act in such a way, try to uninstall it and see if the results change.
As a test, you may also want to disable the third-party firewall you use and to turn the Apple one on temporarily... Does it change the test results ?
Let me know if this helps !
F.J.
-
Virus scanners are a problem!
2004-02-26 03:21:45 Chris_ [Reply | View]
In my experience virus scanners are a big problem on OS X. I don't care for .Mac and won't buy it just to get Virex but I haven't found a way to buy it separately yet. McAfee seems to be quite shy to talk about the existence of Virex -- or perhaps they just sell it via .Mac exclusively ... :-P
And Norton AntiVirus (9.0) isn't really an alternative because AFAIK it *still* doesn't run on 10.3 -- and I know from my own experience that they had similar problems to get version 8 to run on 10.2 when that was new. And customer support was incompetent and unfriendly and, well, generally powerless to solve the problem.
Neither McAfee/NAI nor Symantec seem to care very much for Mac customers and, at least in Symantec's case, the non-working product they are selling is even more expensive than it Windumb counterpart ...!
So, no virus scanner for now.
-
Cron Clarification
2004-02-25 05:48:44 eaprince [Reply | View]
I was unsure about the crontab entry "--secure / >/Applications/virexreport.txt". How is this to be entered in relation to the main entries? -
Cron Clarification
2004-02-25 06:10:02 FJ de Kermadec |
[Reply | View]
Hi !
The command should be entered on one single line : just replace the line break by a space.
However, would you not be comfortable with the Virex command line scanner, you may want to have a look at the PDF manual included with the application. Indeed, you may find that the options I have chosen do not match your needs perfectly -- every configuration is different...
Also, please note that this scan does NOT clean your computer and that you will have to read through the entire output file to check if your system is infected. Would you find it inconvenient, you may want to use the Virex GUI on a regular basis instead or to change the command line options.
Let me know if this helps,
F.J.
-
More information about Virex
2004-02-24 15:52:12 FJ de Kermadec |
[Reply | View]
Hi all !
Some of you have asked me for some more information about the Virex command-line scanner.
The document produced by the command I list in my article must be checked manually to see if Virex encountered any viruses or issues. In that case, you should then take the appropriate steps to clean the infected files.
Would you want to automate the process further with auto-cleaning or auto-deletion of files, you may want to have a look at the PDF user manual that comes with the Application. In it, you will find more command line options to fine-tune your scans.
F.J.
-
No mention of Snort
2004-02-23 16:47:30 bdyck [Reply | View]
I know that running an IDS is perhaps something of an esoteric subject, but you did mention using software like CheckMate to perform tripwire-type checks, and Snort seemed conspicuously absent.. :)
There's a great OS X-native installer/utility app called HenWen that installs Snort and provides a very easy to use management interface. It's extremely powerful, and can be configured to log to a database as well as send alerts to a Unix socket so that the bundled notification app can send email and/or pop up a warning dialog.
More info here: http://seiryu.home.comcast.net/henwen.html -
It's on purpose...
2004-02-24 01:09:37 FJ de Kermadec |
[Reply | View]
Hi !
First of all, thank you very much for taking the time to post your feedback, I really do appreciate it !
I did not mention Snort on purpose. Indeed, as powerful as this application can be, it also requires a certain level of knowledge to effectively set up -- even by using a specially packaged version of Snort.
Also, like any complex application, Snort has been at the root of security issues in the past. Would it be installed but not maintained on a daily basis, this could effectively weaken the security systems set by the user of a computer.
Thanks again !
F.J.
-
Virex & Mail
2004-02-22 07:04:36 maartensneep [Reply | View]
Hi,
I use an Applescript and Virex to scan all attachments I receive in the mail (virex doesn't offer a way to do so by default). In the default configuration it uses the "file" utility on unix to determine if an attachment is a Windows executable, and treats all such files as a virus.
You can find a link on my home.
Maarten
-
crontab running from 1pm to 2pm
2004-02-21 07:16:31 brooksch [Reply | View]
The crontab entry:
* 13 * * * root /usr/local/vscanx/vscanx...
will run a crontab entry from 13:00 until 13:59 as the wild card '*' will work for every minute. You probably want:
0 13 * * * root /usr/local/vscanx/vscanx...
to run the command exactly at 13:00 and no other time - otherwise you'll have a really slow machine once you get back from lunch!
-
crontab running from 1pm to 2pm
2004-02-21 17:01:14 FJ de Kermadec |
[Reply | View]
Hi !
Thank you very much for pointing this unfortunate typo out !
I have sent it up !
F.J.






While I'm satisfied it's a legitmately licensed copy, I'd like to be certain it's also not doing anything untoward to my iBook, particularly since the institution in question is assertive about telling me that I have no expectation of privacy on its network.
I've been unable to find way from McAfee to verify the dmg I was given is an untampered-with copy.
Any thoughts on doing so?