Snow Leopard Security Config v10.6
Snow Leopard Security Config v10.6
Snow Leopard Security Config v10.6
Security Configuration
For Mac OS X Version 10.6 Snow Leopard
K Apple Inc. Adobe and PostScript are trademarks or registered
© 2010 Apple Inc. All rights reserved. trademarks of Adobe Systems Incorporated in the U.S.
and/or other countries.
The owner or authorized user of a valid copy of
Mac OS X software may reproduce this publication for The Bluetooth word mark and logos are registered
the purpose of learning to use such software. No part of trademarks owned by Bluetooth SIG, Inc. and any use of
this publication may be reproduced or transmitted for such marks by Apple is under license.
commercial purposes, such as selling copies of this
publication or for providing paid-for support services. Intel, Intel Core, and Xeon are trademarks of Intel Corp.
in the U.S. and other countries.
Every effort has been made to ensure that the
information in this manual is accurate. Apple is not Java and all Java-based trademarks and logos are
responsible for printing or clerical errors. trademarks or registered trademarks of Sun
Microsystems, Inc. in the U.S. and other countries.
Apple
1 Infinite Loop UNIX® is a registered trademark of The Open Group.
Cupertino, CA 95014 X Window System is a trademark of the Massachusetts
408-996-1010 Institute of Technology.
www.apple.com
This product includes software developed by the
The Apple logo is a trademark of Apple Inc., registered University of California, Berkeley, FreeBSD, Inc., The
in the U.S. and other countries. Use of the “keyboard” NetBSD Foundation, Inc., and their respective
Apple logo (Option-Shift-K) for commercial purposes contributors.
without the prior written consent of Apple may
constitute trademark infringement and unfair Other company and product names mentioned herein
competition in violation of federal and state laws. are trademarks of their respective companies. Mention
of third-party products is for informational purposes
Apple, the Apple logo, AirPort, AppleScript, AppleShare, only and constitutes neither an endorsement nor a
AppleTalk, Back to My Mac, Bonjour, Boot Camp, recommendation. Apple assumes no responsibility with
ColorSync, Exposé, FileVault, FireWire, iCal, iChat, iMac, regard to the performance or use of these products.
iPhoto, iSight, iTunes, Keychain, Mac, MacBook,
MacBook Air, Macintosh, Mac OS, QuickTime, Safari, 019-1828/2010-05
Snow Leopard, Spaces, Spotlight, Tiger, Time Machine,
Xgrid, Xsan, and Xserve are trademarks of Apple Inc.,
registered in the U.S. and other countries.
3
27 Service Access Control Lists
27 VPN Compatibility and Integration
27 Improved Cryptography
28 Extended Validation Certificates
28 Wildcard in Identity Preferences
28 Enhanced Command-Line Tools
28 FileVault and Encrypted Storage
29 Enhanced Encrypted Disk Image Cryptography
29 Smart Card Support for Unlocking Encrypted Storage
30 Enhanced Safari 4.0 Security
4 Contents
51 Removing USB Support Software
52 Removing FireWire Support Software
53 System Hardware Modifications
Contents 5
99 Securing Security Preferences
99 General Security
100 FileVault Security
101 Firewall Security
104 Securing System Swap and Hibernation Storage
105 Securing Sharing Preferences
107 Securing Software Update Preferences
109 Securing Sound Preferences
110 Securing Speech Preferences
111 Securing Spotlight Preferences
114 Securing Startup Disk Preferences
115 Securing Time Machine Preferences
117 Securing Universal Access Preferences
6 Contents
140 About Certificates
140 Creating a Self-Signed Certificate
141 Adding Certificates to a Keychain
Contents 7
167 Remote Content and Hidden Addresses
168 Disabling the Preview Pane for Mail Messages
169 Signing and Encrypting Mail Messages
170 Setting Web Browsing Security with Safari
171 Verifying Server Identity
172 Client-Side Authentication
172 Managing Data Communication and Execution
173 Opening Safe Files
174 Nonsecure Forms
174 Syncing Bookmarks
175 AutoFill
176 Controlling Web Content
177 Cookie Storage or Tracking Information
177 Advanced Settings
177 Securing File Downloads
178 Using Instant Message Security with iChat
179 iChat AV Security
179 Enabling Privacy
180 Enabling Encryption Using MobileMe Identity
181 Enhancing Multimedia Security with iTunes
181 Setting Photo Sharing Security with iPhoto
181 Setting Contact Sharing Security with Address Book
182 Strengthening Data Security with MobileMe
182 Securing iDisk Service Access
182 iDisk Service Access
182 Securing Public Folder Access
8 Contents
198 BTMM Service Architecture
198 Securing BTMM Access
199 Securing Network Sharing Services
199 DVD or CD Sharing
199 About DVD or CD Sharing
200 Screen Sharing (VNC)
200 About Screen Sharing
200 Restricting Access to Specific Users
201 File Sharing (AFP, FTP, and SMB)
201 File Sharing
202 Restricting Access to Specific Users
204 Printer Sharing (CUPS)
204 Scanner Sharing
204 Web Sharing (HTTP)
204 Web Sharing
205 Remote Login (SSH)
205 Restricting Access to Specific Users
206 Enabling an SSH Connection
207 Configuring a Key-Based SSH Connection
210 Preventing Connection to Unauthorized Host Servers
211 Using SSH as a Secure Tunnel
212 Modifying the SSH Configuration File
213 Generating Key Pairs for Key-Based SSH Connections
214 Updating SSH Key Fingerprints
215 Remote Management (ARD)
216 Restricting Access to Specific Users
216 Remote Apple Events (RAE)
217 Restricting Access to Specific Users
217 Xgrid Sharing
218 Restricting Access to Specific Users
219 Internet Sharing
219 Restricting Access to Specific Users
220 Bluetooth Sharing
220 Restricting Access to Specified Users
221 Understanding and Managing Daemons and Agents
221 Listing Active Daemons and Agents on the System
221 Configuration Files for Daemons and Agents
222 Disabling and Re-enabling Daemons and Agents
224 Where to Get Additional Information
Contents 9
225 The Rights Dictionary
227 The Rules Dictionary
228 Managing Authorization Rights
228 Creating an Authorization Right
228 Modifying an Authorization Right
229 Example Authorization Restrictions
229 Example of Authorizing for Screen Saver
231 Maintaining System Integrity
231 Validating File Integrity
232 About File Integrity Checking Tools
232 Using Digital Signatures to Validate Applications and Processes
233 Validating Application Bundle Integrity
233 Validating Running Processes
234 Using Activity Analysis Tools
234 Validating System Logging
235 Configuring syslogd
235 Local System Logging
236 Remote System Logging
236 Auditing System Activity
237 Security Auditing
237 Enabling Security Auditing
237 Analyzing Security Audit Logs
238 Auditing Additional Events
239 Using Antivirus Tools
239 Using Intrusion Detection Systems
Index 268
10 Contents
About This Guide
Preface
This guide provides an overview of features in Mac OS X that
you can use to customize security, known as hardening your
computer.
This guide provides instructions and recommendations for securing Mac OS X v10.6
Snow Leopard, and for maintaining a secure computer.
Audience
This guide is for users of Mac OS X v 10.6 Snow Leopard or later. If you’re using this
guide, you should be an experienced Mac OS X user, be familiar with the Mac OS X user
interface, and have experience using the Terminal application’s command-line interface.
You should also be familiar with basic networking concepts.
Some instructions in this guide are complex, and use could cause serious effects on the
computer and its security. These instructions should only be used by experienced
Mac OS X users, and should be followed by thorough testing.
11
 Chapter 2, “Installing Mac OS X,” describes how to securely install Mac OS X. The
chapter also discusses how to securely install software updates and explains
permissions and how to repair them.
 Chapter 3, “Securing System Hardware,” explains how to physically protect your
hardware from attacks. This chapter also tells you how to secure settings that affect
users of the computer.
 Chapter 4, “Securing Global System Settings,” describes how to secure global system
settings such as firmware and Snow Leopard startup. There is also information on
setting up system logs to monitor system activity.
 Chapter 5, “Securing System Preferences,” describes recommended settings to secure
Mac OS X system preferences.
 Chapter 6, “Securing Accounts,” describes the types of user accounts and how to
securely configure an account. This includes securing the system administrator
account, using Open Directory, and using strong authentication.
 Chapter 7, “Securing Data and Using Encryption,” describes how to encrypt data and
how to use Secure Erase to verify that old data is completely removed.
 Chapter 8, “Securing Applications,” describes how to protect your data while using
Apple applications.
 Chapter 9, “Securing Network Services,” describes how to secure your computer
services.
 Chapter 10, “Advanced Security Management,” describes how to use security audits
to validate the integrity of your computer and data.
 Appendix A, “Security Checklist,” provides a checklist that guides you through
securing your computer.
 Appendix B, “Security Scripts,” provides a script template for creating a script to
secure your computer.
Note: Because Apple periodically releases new versions and updates to its software,
images shown in this book may be different from what you see on your screen.
Important: Any deviation from this guide should be evaluated to determine security
risks that might be introduced and to take measures to monitor or mitigate those risks.
The commands require customizing to your own environments needs and settings
before they can be used. Read the appropriate man pages and usage instructions for
each command before attempting to use the commands.
All the commands must be run with sudo or root authority. Failing to authenticate as a
sudoer will result in failed commands or worse unintended consequences.
Mac Help
You can view instructions and other useful information and documents in the server
suite by using onscreen help.
On a computer running Mac OS X, you can access onscreen help from the Finder or
other applications on the computer. Use the Help menu to open Help Viewer.
You may want to enlarge the printed pages even if you don’t print double sided,
because the PDF page size is smaller than standard printer paper. In the Print dialog
or Page Setup dialog, try changing Scale to 115% (155% for Getting Started, which has
CD-size pages).
Acknowledgments
Apple would like to thank the National Security Agency, the National Institute of
Standards and Technology, and the Defense Information Systems Agency for their
assistance in creating and editing the client and server security configuration guides for
Mac OS X Snow Leopard.
With Mac OS X, a security strategy is implemented that is central to the design of the
operating system. To enhance security on your computer, Snow Leopard provides the
following features.
 Modern security architecture. Mac OS X includes state-of-the-art, standards-based
technologies that enable Apple and third-party developers to build secure software
for the Mac. These technologies support all aspects of system, data, and networking
security required by today’s applications.
 Secure default settings. When you take your Mac out of the box, it is securely
configured to meet the needs of most common environments, so you don’t need to
be a security expert to set up your computer. The default settings make it very
difficult for malicious software to infect your computer. You can further configure
security on the computer to meet organizational or user requirements.
 Innovative security applications. Mac OS X includes features that take the worry out
of using a computer. For example, FileVault protects your documents by using strong
encryption, an integrated VPN client gives you secure access to networks over the
Internet, and a powerful firewall secures your home network.
 Open source foundation. Open-source methodology makes Mac OS X a robust,
secure operating system, because its core components have been subjected to peer
review for decades. Problems can be quickly identified and fixed by Apple and the
larger open-source community.
17
 Rapid response. Because the security of your computer is important, Apple responds
rapidly to provide patches and updates. Apple works with worldwide partners,
including the Computer Emergency Response Team (CERT), to notify users of
potential threats. If vulnerabilities are discovered, the built-in Software Update tool
notifies users of security updates, which are available for easy retrieval and
installation.
UNIX Infrastructure
The Mac OS X kernel—the heart of the operating system—is built from BSD and Mach.
Among other things, BSD provides basic file system and networking services and
implements a user and group identification scheme. BSD enforces access restrictions to
files and system resources based on user and group IDs.
Access Permissions
An important aspect of computer security is the granting or denying of access
permissions (sometimes called access rights). A permission is the ability to perform
a specific operation, such as gaining access to data or to execute code.
Permissions in Mac OS X are controlled at many levels, from the Mach and BSD
components of the kernel through higher levels of the operating system, and
—for networked applications—through network protocols.
Authentication is the process by which an entity (such as the user) demonstrates that
they are who they say they are. For example, the user, entering a password which only
he or she could know, allows the system to authenticate that user. Authentication is
normally done as a step in the authorization process. Some applications and operating
system components perform their own authentication. Authentication might use
authorization services when necessary.
Security Framework
The security framework in Mac OS X is an implementation of the CDSA architecture.
It contains an expandable set of cryptographic algorithms to perform code signing
and encryption operations while maintaining the security of the cryptographic keys.
It also contains libraries that allow the interpretation of X.509 certificates.
The CDSA code is used by Mac OS X features such as Keychain and URL Access for
protection of login data.
Apple built the foundation of Mac OS X and many of its integrated services with open
source software—such as FreeBSD, Apache, and Kerberos, among others—that has
been made secure through years of public scrutiny by developers and security experts
around the world.
Strong security is a benefit of open-source software because anyone can inspect the
source code, identify theoretical vulnerabilities, and take steps to strengthen the
software.
Network Security
Secure Transport is used to implement SSL and Transport Layer Security (TLS) protocols.
These protocols provide secure communications over a TCP/IP connection such
as the Internet by using encryption and certificate exchange. A firewall can then
filter communication over a TCP/IP connection by permitting or denying access to
a computer or a network.
Mac OS X Keychain services enable you to create keychains and securely store keychain
items. After a keychain is created, you can add, delete, and edit keychain items, such as
passwords, keys, certificates, and notes for users.
A user can unlock a keychain through authentication (by using a password, digital
token, smart card, or biometric reader) and applications can then use that keychain to
store and retrieve data, such as passwords.
These functions are used when the services call Common Security Service Manager
(CSSM) functions. This is transparent to users.
Signed Applications
By signing applications, your Mac can verify the identity and integrity of an application.
Applications shipped with Snow Leopard are signed by Apple. In addition, third-party
software developers can sign their software for the Mac. Application signing doesn’t
provide intrinsic protection, but it integrates with several other features to enhance
security.
Features such as parental controls, managed preferences, Keychain, and the firewall use
application signing to verify that the applications they are working with are the correct,
unmodified versions.
With Keychain, the use of signing dramatically reduces the number of Keychain dialogs
presented to users because the system can validate the integrity of an application that
uses Keychain. With parental controls and managed preferences, the system uses
signatures to verify that an application runs unmodified.
The application firewall uses signatures to identify and verify the integrity of
applications that are granted network access. In the case of parental controls and
the firewall, unsigned applications are signed by the system on an ad hoc basis to
identify them and verify that they remain unmodified.
Mandatory access controls are policies that cannot be overridden. These policies set
security restrictions created by the developer. This approach is different from
discretionary access controls that permit users to override security policies according to
their preferences.
Mandatory access controls in Snow Leopard aren’t visible to users, but they are the
underlying technology that helps enable several important new features, including
sandboxing, parental controls, managed preferences, and a safety net feature for
Time Machine.
Time Machine uses this strict policy because it utilizes new file system features in
Snow Leopard. The policy prevents corruption in the backup directory by preventing
tools from deleting files from backups that may not consider the new file system
features.
Mandatory access controls are integrated with the exec system service to prevent the
execution of unauthorized applications. This is the basis for application controls in
parental controls in Snow Leopard and managed preferences in Snow Leopard Server.
Mandatory access controls enable strong parental controls. In the case of the new
sandboxing facility, mandatory access controls restrict access to system resources as
determined by a special sandboxing profile that is provided for each sandboxed
application. This means that even processes running as root can have extremely limited
access to system resources.
Sandboxing
Sandboxing helps ensure that applications do only what they’re intended to do by
placing controls on applications that restrict what files they can access, whether the
applications can talk to the network, and whether the applications can be used to
launch other applications.
In Snow Leopard, many of the system’s helper applications that normally communicate
with the network—such as mDNSResponder (the software underlying Bonjour) and the
Kerberos KDC—are sandboxed to guard them from abuse by attackers trying to access
the system.
In addition, other programs that routinely take untrusted input (for instance, arbitrary
files or network connections), such as Xgrid and the Quick Look and Spotlight
background daemons, are sandboxed.
You can secure these ports by disabling them. For information about disabling
hardware, see Chapter 3, “Securing System Hardware.”
Enhanced Quarantining
Applications that download files from the Internet or receive files from external sources
(such as mail attachments) can use the Quarantine feature to provide a first line of
defense against malicious software such as Trojan horses. When an application receives
an unknown file, it adds metadata (quarantine attributes) to the file using functions
found in Launch Services.
Files downloaded using Safari, Mail, and iChat are tagged with metadata indicating
that they are downloaded files and referring to the URL, date, and time of the
download. This metadata is propagated from archive files that are downloaded (such
as ZIP or DMG files) so that any file extracted from an archive is also tagged with
the same information. This metadata is used by the download inspector to prevent
dangerous file types from being opened unexpectedly.
The first time you try to run an application that has been downloaded, Download
Inspector inspects the file, prompts you with a warning asking whether you want to
run the application, and displays the information on the date, time, and location of the
download.
You can continue to open the application or cancel the attempt, which is appropriate
if you don’t recognize or trust the application. After an application is opened, this
message does not appear again for that application and the quarantine attributes
are lifted.
Users can restrict firewall access to essential network services (such as those needed for
DHCP, BOOTP, IPSec VPNs, and Bonjour), or they can allow (or block) access to selected
applications on an individual basis.
The application firewall uses digital signatures to verify the identity of applications. If
you select an unsigned application, Snow Leopard signs that application to uniquely
identify it. Also new in Snow Leopard, is the ability to permit all signed software to
automatically receive incoming connections.
For expert users, the IPFW firewall is available. Because IPFW handles packets at the
protocol layer of the networking stack and the application firewall is an application
layer filter, IPFW rules take precedence.
Snow Leopard has the following 64-bit protection features: no-execute stack,
noexecute data, and no-execute heap. In Snow Leopard, no-execute stack is available
for 32- and 64-bit applications. For 64-bit processes, Snow Leopard provides protection
from code execution in both heap and stack data areas.
Snow Leopard also has Library Randomization. Library Randomization uses shifting
memory locations for operating system processes each time the system starts up.
Because an attacker cannot depend on key system processes running in known
memory locations, it is very difficult to compromise the operating system.
Snow Leopard also has process sandboxing, which is a way of restricting what kinds of
activities an application can perform.
You can also use digital certificates and one-time password tokens from RSA or
CRYPTOcard for authentication with the VPN client. The one-time password tokens
provide a randomly generated passcode number that must be entered with the VPN
password—a great option for those who require extremely robust security.
In addition, the L2TP VPN client can be authenticated using credentials from a Kerberos
server. In either case, you can save the settings for each VPN server you routinely use as
a location, so you can reconnect without reconfiguring your system each time.
Apple’s L2TP VPN client can connect you to protected networks automatically by using
its VPN-on-demand feature. VPN-on-demand can detect when you want to access a
network that is protected by a VPN server and can start the connection process for you.
This means that your security is increased because VPN connections can be closed
when not in use, and you can work more efficiently.
In Snow Leopard, the VPN client includes support for Cisco Group Filtering. It also
supports DHCP over PPP to dynamically acquire additional configuration options such
as Static Routes and Search Domains.
Improved Cryptography
Snow Leopard includes Elliptical Curve Cryptography (ECC) support in most of its
encryption technologies. ECC encryption is an additional mathematical model for
generating and reading encryption keys. Snow Leopard supports Elliptic Curve Digital
Signature Algorithm (ECDSA) for signing and key exchange.
ECC is supported in the following areas: TLS/SSL, S/MIME, Apple’s Certificate Assistant,
and Apple’s certtool command-line tool.
CAs who want to issue EV certificates must provide an investigation process that passes
an independent audit, and also establishes the legal identity and legal claim to the
domain name of the certificate applicant.
This is often used with certificates used by Common Access Cards (CACs). For more
information on Smart Cards, see “Smart Card Support for Unlocking Encrypted Storage”
on page 29.
To see the contents of the disk image, including metadata such as file name, date, size,
or other properties, a user must enter the password or have a keychain with the correct
password.
The file is decrypted in real time, as it is used. For example, if you open a QuickTime
movie from an encrypted disk image, Snow Leopard decrypts only the portion of the
movie currently playing.
Snow Leopard has the following token modules to support this robust, two-factor
authentication mechanism and Java Card 2.1 standards:
 Belgium National Identification Card (BELPIC)
 U.S. Department of Defense Common Access Card (CAC)
 Japanese government PKI (JPKI)
 U.S. Federal Government Personal Identity Verification, also called FIPS-201(PIV)
Other commercial smart card vendors provide token modules to support integration of
their smart card with the Snow Leopard Smart Card architecture. For more information,
see http://smartcardservices.macosforge.org/.
Similar to an ATM card and a PIN code, two-factor authentication relies on something
you have and something you know. If your smart card is lost or stolen, it cannot be
used unless your PIN is also known.
Snow Leopard has additional functionality for smart card use, such as:
 Lock system on smart card removal. You can configure your Mac to lock the system
when you remove your smart card.
 Unlock keychain. When you insert a smart card, the keychain can be unlocked and
then your stored information and credentials can be used.
 Unlock FileVault. You can use a smart card to unlock your FileVault encrypted home
directory. You can enable this function by using a private key on a smart card.
Safari also includes a fraudulent site detection feature. It works like this: Google
maintains a blacklist of known and highly suspected malware-transmitting sites and
phishing sites (harvesters of sensitive data). Google adds a hash of each site’s URL
to a database that some web browsers can use at safebrowsing.clients.google.com.
When Safari launches, it downloads an abbreviated list of these sites’ hashes. When
you navigate to a web site, Safari checks the blacklist. If the website you’re accessing
matches a hash, Safari contacts Google for complete URL information. If it is a positive
match, Safari warns you that you may be attempting to access a malware site or
phishing site.
Safari stores data in the folder at /private/var/folders/ in folders with two- letter names.
The full path is /private/var/folders/xx/yy/-Caches-/com.apple.Safari, where “xx” and
“yy” are unique codes. When you access that folder, you see Safari’s cache file Cache.db
and Google’s Safe Browsing initiative blacklist file SafeBrowsing.db.
Because some recoverable data might remain on the computer, securely erase the
partition you’re installing Mac OS X on. For more information, see “Using Disk Utility to
Securely Erase a Disk or Partition” on page 160.
If you decide against securely erasing the partition, securely erase free space after
installing Mac OS X. For more information, see “Using Disk Utility to Securely Erase Free
Space” on page 162.
During installation, install only the packages you plan on using. Removing unused
packages frees disk space and reduces the risk of attackers finding vulnerabilities in
unused components.
31
To install Mac OS X v10.6 from original installation discs:
WARNING: When you install Mac OS X, you erase the contents of the partition you’re
installing on. Before continuing, back up the files you want to keep.
In addition, verify the image to make sure it is correct. For more information about
verifying images, see “Verifying the Integrity of Software” on page 40.
Thoroughly test the settings, making sure the computer meets the standards of your
organization, and then create a disk image of the computer. You can then deploy this
image to each computer, avoiding the need to manually configure each computer.
You can use NetBoot or Apple Software Restore (ASR) to configure your computer from
a network-based disk image:
 With NetBoot, you can install an image directly from the network. For information
about how to use NetBoot, see System Imaging and Software Update Administration.
 With ASR, you can install an image deployed by an ASR server, or you can save that
image to disk. By saving the image to disk, you can verify its validity before using it. If
you’re configuring multiple computers simultaneously, ASR can be much more
efficient. For information about how to use ASR, enter man asr in a Terminal window.
Note: Apple protects information submitted by Setup Assistant, but avoid entering
information considered sensitive by your organization.
Important: The system administrator account should be used only when absolutely
necessary to perform administrative tasks. Create additional accounts for
nonadministrative use. For more information, see “Types of User Accounts” on page 118.
Mac OS X can set the time by retrieving date and time information from a Network
Time Protocol (NTP) server. You should still set valid time settings in case you decide to
disable this feature, or in case you don’t have access to a secure internal NTP server.
For more information about using a secure NTP server, see “Securing Date & Time
Preferences” on page 75.
You can configure Software Update to check for updates automatically. You can also
configure Software Update to download, but not install, updates, if you want to install
them later.
Before installing updates, check with your organization for their policy on downloading
updates. They might prefer that you use an internal software update server, which
reduces the amount of external network traffic and lets the organization qualify
software updates using organization configurations before updating systems.
Important: Security updates published by Apple contain fixes for security issues and
are usually released in response to a specific known security problem. Applying these
updates is essential.
If Software Update does not install an update that you request, contact your network
administrator.
If you run Software Update on a wireless network or untrusted network, you might
download malicious updates from a rogue software update server. However, Software
Update will not install a package that has not been digitally signed by Apple. If
Software Update does not install a package, delete it from /Library/Updates/; then
download the update again.
You can connect your computer to a network that manages its client computers, which
enables the network to require that the computer use a specified software update
server. Or, you can modify the /Library/Preferences/com.apple.SoftwareUpdate.plist file
by entering the following command in a Terminal window to specify your software
update server.
# Suggested Settings:
# Specify the software update server to use.
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate
CatalogURL http://swupdate.apple.com:8088/index-leopard-
snowleopard.merged-1.sucatalog
# Available Settings:
# Replace swupdate.apple.com with the fully qualified domain name (FQDN)
# or IP address of your software update server.
If you are a network administrator, instead of using your operational computer to check
for and install updates, consider using a test computer to download updates and verify
file integrity before installing updates. For more information about verify file integrity,
see “Verifying the Integrity of Software” on page 40.
You can then transfer the update packages to your operational computer. For
instructions on installing the updates, see “Updating Manually from Installer Packages”
on page 38.
Important: Make sure updates are installed when the computer can be restarted
without affecting users accessing the server.
# Suggested Settings:
# Download and install software updates.
sudo softwareupdate --download --all --install
# Available Settings:
# Use the following commands to view softwareupdate options:
# $ softwareupdate -h
# or
# $ man softwareupdate
You can review the contents of each security update before installing it. To see
the contents of a security update, go to Apple’s Security Support Page at
www.apple.com/support/security/ and click the Security Updates page link.
Install the system update and then install subsequent security updates. Install the
updates in order by release date, oldest to newest.
# Suggested Settings:
# Download software updates.
sudo softwareupdate --download --all
# Install software updates.
sudo installer -pkg $Package_Path -target /Volumes/$Target_Volume
# Available Settings:
# Use the following commands to view installer options:
# $ installer -h
# or
# $ man installer
# Suggested Settings:
# Use the sha1 command to display a file’s SHA-1 digest.
# Replace $full_path_filename with the full path filename of the update
# package or image that SHA-1 digest is being checked for.
sudo /usr/bin/openssl sha1 $full_path_filename
# Available Settings:
# Use the following command to view the version of OpenSSl installed on
# your computer:
# $ openssl version
# Use the following command to view openssl options:
# $ man openssl
If provided, the SHA-1 digest for each software update or image should match the
digest created for that file. If not, the file was corrupted. Obtain a new copy.
Note: In this guide, the term “privileges” refers to the combination of ownership and
permissions. The term “permissions” refers to permission settings that each user
category can have (Read & Write, Read Only, Write Only, and None).
An ACL is a list of access control entries (ACEs), each specifying the permissions to be
granted or denied to a group or user and how these permissions are propagated
throughout a folder hierarchy.
In addition, ACLs are compatible with Windows Server 2003, Windows Server 2008,
Windows XP, and Windows Vista, giving you added flexibility in a multiplatform
environment.
ACLs allow you to be more specific than POSIX when granting permissions. For
example, rather than giving a user full write permission, you can restrict the user to the
creation of folders but not files.
If a file or folder has no ACEs defined for it, Mac OS X applies standard POSIX
permissions. If a file or folder has ACEs defined for it, Mac OS X starts with the first ACE
in the ACL and works its way down the list until the requested permission is satisfied or
denied.
After evaluating ACEs, Mac OS X evaluates standard POSIX permissions defined for the
file or folder. Then, based on the evaluation of ACL and standard POSIX permissions,
Mac OS X determines what type of access a user has to a shared file or folder.
Most software you install in Mac OS X is installed from package (.pkg) files. Each time
something is installed from a package file, a Bill of Materials (.bom) file is created and
the installer database is updated. Each Bill of Materials file contains a list of files
installed by that package, along with the correct permissions for each file.
You should repair disk permissions if you experience symptoms that indicate
permission-related problems after installing software, software updates, or applications.
# Suggested Setting:
# Verify disk permissions
sudo diskutil verify Permissions /Volumes/$Target_Boot_Drive
# If permission discrepancies exist that were not set by your
# organizations, use the following Repair disk permissions command:
sudo diskutil repairPermissions /Volumes/$Target_Boot_Drive
# Available Setting:
# Use the following command to view diskutil options:
# $ diskutil
Note: You can also use the pkgutil command to repair specific package permissions.
For more information see pkgutil man pages.
Protecting Hardware
The first level of security is protection from unwanted physical access. If someone can
physically access a computer, it becomes much easier to compromise the computer’s
security. When someone has physical access to the computer, they can install malicious
software or event-tracking and data-capturing services.
Use as many layers of physical protection as possible. Restrict access to rooms that
contain computers that store or access sensitive information. Provide room access only
to those who must use those computers. If possible, lock the computer in a locked or
secure container when it is not in use, and bolt or fasten it to a wall or piece of
furniture.
The hard disk is the most critical hardware component in your computer. Take special
care to prevent access to the hard disk. If someone removes your hard disk and installs
it in another computer, they can bypass safeguards you set up. Lock or secure the
computer’s internal hardware.
If you can’t guarantee the physical security of the hard disk, consider using FileVault
for each home folder. FileVault encrypts home folder content and guards against the
content being compromised. For more information, see “Encrypting Home Folders”
on page 153.
43
FileVault does not protect against the threat of an attacker tampering with files on the
disk and reinstalling the drive. For example, an attacker could install a modified kernel,
and use it to obtain your FileVault password by logging your keyboard keystrokes. To
prevent such an attack, lock your computer when it is unattended. Also, if you share
your computer with others, limit those who have sudoer permissions. For information
about limiting sudoers, see “Securing Administrator Accounts” on page 124.
If you have a portable computer, keep it secure. Lock it up or hide it when it is not in
use. When transporting the computer, never leave it in an insecure location. Consider
buying a computer bag with a locking mechanism and lock the computer in the bag
when you aren’t using it.
Although wireless technology gives your network more flexibility with your users, it
can cause security vulnerabilities you may be unaware of. Whenever possible, disable
wireless access for security reasons. When using a wireless access point, make sure you
properly configure the security settings to prevent unauthorized users from attempting
to access your network.
Your wireless access point should require encryption of the connection, user
authentication (through the use of certificates or smart cards), and time-outs for
connections.
By requiring an encrypted wireless connection, you can maintain the integrity and
confidentiality of data being transmitted to your wireless access point. The use of
certificates or smart cards helps ensure the users’ identity, so your users are who they
say they are.
Also, setting a time-out that disconnects wireless user connections lasting longer than
8 to 10 hours prevents your network from being attacked by a computer that is
connected through your wireless access point and left unattended.
If you need to use WiFi, see “Network Access Control (802.1X)” on page 87 to leverage
802.1x for securing WiFi traffic.
Anyone within wireless range can gain access to your network by using an authorized
user’s insecurely configured wireless LAN. These possible points of access can be very
large, depending on the number of users with wireless technology on their computers.
The challenge arises when trying to prevent users from creating access points to your
network or trying to identify where the access points are and who is attempting to use
them.
Many organizations restrict the use of wireless technology in their network
environment. However, most Mac computers have wireless capability built in, so
turning it off might not meet your organization’s wireless technology restrictions.
You might need to remove components from Snow Leopard to disable them from
being turned on in System Preferences.
About OS Components
Special hardware, such as wireless networking cards and audio/video components,
need driver software that runs at the kernel level. This driver software is implemented
as kernel extensions (“kexts”) in Snow Leopard and are also known as OS components.
These kernel extensions can be removed from Snow Leopard to prevent the use of
a piece of hardware.
You can also have an Apple Authorized Technician remove Airport hardware from your
Apple computer.
# -------------------------------------------------------------------
# Securing System Hardware
# -------------------------------------------------------------------
# Removing Wi-Fi Support Software
# -------------------------
# Default setting:
# kext files are installed and loaded.
# Suggested Setting:
# Remove Apple AirPort kernel extensions.
sudo srm -rf /System/Library/Extensions/IO80211Family.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
For information about turning AirPort off using launchctl, see “Understanding and
Managing Daemons and Agents” on page 221.
You can also have an Apple Authorized Technician remove the built-in Bluetooth
hardware from your Apple computer.
# Suggested Setting:
# Remove Bluetooth kernel extensions.
sudo srm -rf /System/Library/Extensions/IOBluetoothFamily.kext
sudo srm -rf /System/Library/Extensions/IOBluetoothHIDDriver.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
You can also have an Apple Authorized Technician remove IR hardware from your
Apple computer.
# Suggested Setting:
# Remove IR kernel extensions.
sudo srm -rf /System/Library/Extensions/AppleIRController.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
Note: Some organizations insert a dummy plug into the audio input and output ports
to ensure that audio hardware is disabled.
You can also have an Apple Authorized Technician remove the built-in microphone
hardware from your Apple computer.
# Suggested Setting:
# Remove Audio Recording kernel extensions.
sudo srm -rf /System/Library/Extensions/AppleUSBAudio.kext
sudo srm -rf /System/Library/Extensions/IOAudioFamily.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
Note: The support for external iSight cameras should be removed on all machines.
Removing only support for internal iSight cameras still leaves support for external
cameras.
You can also have an Apple Authorized Technician remove the built-in video camera
hardware from your Apple computer.
# Suggested Setting:
# Remove Video Recording kernel extensions.
# Remove external iSight camera.
sudo srm -rf /System/Library/Extensions/Apple_iSight.kext
# Remove internal iSight camera.
sudo srm -rf /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/\
AppleUSBVideoSupport.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
You can protect your system by preventing an unauthorized user from using your data
ports. This prevents users from booting to a different volume using a USB Flash drive,
USB, or FireWire external hard drive. This task requires you to have administrator
privileges.
Also, by setting a firmware password using the Firmware Password Utility, you can
prevent a physical Direct Memory Access (DMA) attack over Firewire. When the
firmware password is set, any external device is denied direct access to computer
memory content. For more information about the Firmware Password Utility, see “Using
the Firmware Password Utility” on page 55.
The removal of this kernel extension only affects USB mass storage devices. It does not
affect other USB devices such as a USB printer, mouse, or keyboard. This task requires
you to have administrator privileges.
# Suggested Setting:
sudo srm -rf /System/Library/Extensions/IOUSBMassStorageClass.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
# Suggested Setting:
# Remove FireWire kernel extensions.
sudo srm -rf /System/Library/Extensions/\
IOFireWireSerialBusProtocolTransport.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
If your environment does not permit the use of the following hardware components,
you must physically disable them:
 Airport
 Bluetooth
 Microphone
 Camera
 IR Port
Note: If you are in a government organization and need a letter of volatility for
Apple products, send your request to AppleFederal@apple.com.
Single-user mode logs the user in as root. This is dangerous because root user access is
the most powerful level of access, and actions performed as root are anonymous.
If you create an EFI password, you prevent users from accessing single-user mode. The
password also stops users from loading unapproved partitions or disks and from
enabling target disk mode at startup.
After creating an EFI password, you must enter this password when you start the
computer from an alternate disk (for situations such as hard disk failure or file system
repair).
WARNING: EFI settings are critical. Take great care when modifying these settings and
when creating a secure Firmware password.
54
An EFI Firmware password provides some protection, but it can be reset if a user has
physical access to the machine and changes the physical memory configuration of the
machine.
EFI password protection can be bypassed if the user changes the physical memory
configuration of the machine and then resets the PRAM three times (by holding down
Command, Option, P, and R keys during system startup).
Intel-based computers can use the Firmware Password Utility to password-protect the
hardware layer. For information on using the Firmware Password Utility, see “Using the
Firmware Password Utility” on page 55.
You can set the security mode to one of the following values:
 None: This is the default value of security-mode and provides no security to your
computer’s EFI.
 Command: This value requires a password if changes are made to EFI or if a user
attempts to start up from an alternate volume or device.
 Full: This value requires a password to start up or restart your computer. It also
requires a password to make changes to EFI.
For example, to set the security-mode to full you would use the following command:
$ sudo nvram security-mode=full
To securely set the password for EFI, use the Firmware Password Utility.
# Suggested Setting:
# Secure startup by setting security-mode. Replace $mode-value with
# "command" or "full."
sudo nvram security-mode="$mode-value"
# Verify security-mode setting.
sudo nvram -x -p
# Available Settings:
# security-mode:
# "command"
# "full"
# Use the following command to view the current nvram settings:
# $ nvram -x -p
# Use the following commands to view nvram options:
# $ nvram -h
# or
# $ man nvram
When a user tries to access the computer’s login window (locally or through Apple
Remote Desktop), the user sees the access warning you create, such as the following:
Security
Applications
Agent
Authorization Biometric
1 5 Credential 4 3
Juan Chavez
Security
Password :
Request user
Server interaction Password
Request if necessary
authorization
for right 2
Smart Card
Rights Database
/etc/authorization
When an application requests authorization rights from the security server, the
security server interrogates the rights database (/etc/authorization) to determine
the mechanisms to be used for authentication.
Then the security agent sends the authentication information back to the security
server, which passes it back to the application.
For more information about the banner sample, see the bannersample README file.
When a user opens Terminal locally or connects to the computer remotely, the user
sees the access warning you create.
The following task must be performed by an administrator user using any text editor.
You can view system preferences by choosing Apple > System Preferences. In the
System Preferences window, click a preference to view it.
62
Some critical preferences require that you authenticate before you modify their
settings. To authenticate, you click the lock (see the images below) and enter an
administrator’s name and password (or use a digital token, smart card, or biometric
reader).
If you log in as a user with administrator privileges, these preferences are unlocked
unless you select “Require password to unlock each System Preferences pane” in
Security preferences. For more information, see “Securing Security Preferences” on
page 99.
If you log in as a standard user these preferences remain locked. After unlocking
preferences, you can lock them again by clicking the lock.
This chapter lists each set of preferences included with Mac OS X and describes
modifications recommended to improve security.
In sensitive environments don’t use MobileMe. If you must store critical data, only store
it on your local computer. You should only transfer data over a secure network
connection to a secure internal server.
If you use MobileMe, enable it only for user accounts that don’t have access to critical
data. Avoid enabling MobileMe for administrator or root user accounts.
Leave the options disabled in the Sync pane of MobileMe preferences (shown below).
Leave iDisk Syncing (shown below) disabled by default. If you must use a Public folder,
enable password protection.
# -------------------------------------------------------------------
# Securing System Preferences
# -------------------------------------------------------------------
# Securing MobileMe Preferences
# -------------------------
# Default Setting:
# If a MobileMe account is entered during setup, MobileMe is configured
# for that account.
# Use the following command to display current MobileMe settings:
# $ defaults -currentHost read com.apple.<Preferenceidentifier>
# Use the following command to view all current settings for currenHost:
# $ defaults -currentHost read
# Suggested Setting:
#Disable Sync options.
sudo defaults -currentHost write com.apple.DotMacSync ShouldSyncWithServer
1
# Disable iDisk Syncing.
sudo defaults -currentHost write com.apple.idisk $USER_MirrorEnabled -bool
no
# Available Settings:
# None
You should immediately change the password of the first account that was created on
your computer. If you are an administrator, you can reset other user account passwords
by selecting the account and clicking Reset Password.
Note: If you are an administrator, password policies are not enforced when you change
your password or when you reset another user’s password. Therefore, when you reset
passwords as an administrator, follow the password policy that you set. For more
information about password policies, see “Setting Global Password Policies” on
page 134.
Although the use of Fast User Switching is convenient when you have multiple users
on a single computer, there are cases in which you may not want to enable it.
Fast User Switching allows multiple users to log in simultaneously. This makes it difficult
to track user actions and allows users to run malicious applications in the background
while another user is using the computer.
Also, some external volumes attached to the computer are mounted when another
user logs in, granting all users access to the volume and ignoring access permissions.
Avoid creating accounts that are shared by several users. Individual accounts maintain
accountability. Each user should have his or her own standard or managed account.
5 Under “Display login window as,” select “Name and password” and deselect all other
options.
Recent items are applications, documents, and servers you’ve recently used. You access
recent items by choosing Apple > Recent Items.
If intruders gain access to your computer, they can use recent items to quickly view
your most recently accessed files. Additionally, intruders can use recent items to access
authentication mechanisms for servers if the corresponding keychains are unlocked.
Removing recent items provides a minimal increase in security, but it can deter
unsophisticated intruders.
# Suggested Setting:
# Disable display of recent applications.
sudo defaults write com.apple.recentitems Applications -dict MaxAmount 0
# Available Settings:
# MaxAmount 0,5,10,15,20,30,50
Note: Some high security areas do not allow radio frequency (RF) communication such
as Bluetooth. Consult your organizational requirements for possible further
disablement of the component.
When you disable Bluetooth in System Preferences, you must disable Bluetooth for
every user account on the computer.
This does not prevent users from reenabling Bluetooth. You can restrict a user account’s
privileges so the user cannot reenable Bluetooth, but to do this, you remove several
important user abilities, like the user’s ability to change his or her password. For more
information, see “Types of User Accounts” on page 118.
2 Deselect “On.”
# Suggested Setting:
# Turn Bluetooth off.
sudo defaults write /Library/Preferences/com.apple.Bluetooth\
ControllerPowerState -int 0
# Available Settings:
# 0 (OFF) or 1 (On)
When you disable automatic actions in System Preferences, you must disable these
actions for every user account on the computer.
This does not prevent users from reenabling automatic actions. To prevent the user
from reenabling automatic actions, you must restrict the user’s account so the user
cannot open System Preferences. For more information on restricting accounts, see
“Securing Nonadministrator Accounts” on page 121.
# Suggested Setting:
# Disable blank CD automatic action.
sudo defaults write /Library/Preferences/com.apple.digihub
com.apple.digihub.blank.cd.appeared -dict action 1
# Disable music CD automatic action.
sudo defaults write /Library/Preferences/com.apple.digihub
com.apple.digihub.cd.music.appeared -dict action 1
# Disable picture CD automatic action.
sudo defaults write /Library/Preferences/com.apple.digihub
com.apple.digihub.cd.picture.appeared -dict action 1
# Disable blank DVD automatic action.
sudo defaults write /Library/Preferences/com.apple.digihub
com.apple.digihub.blank.dvd.appeared -dict action 1
# Disable video DVD automatic action.
sudo defaults write /Library/Preferences/com.apple.digihub
com.apple.digihub.dvd.video.appeared -dict action 1
# Available Settings:
# action 1 = "Ignore"
# action 2 = "Ask what to do"
# action 5 = "Open other application"
# action 6 = "Run script"
# action 100 = "Open Finder"
# action 101 = "Open itunes"
# action 102 = "Open Disk Utility"
# action 105 = "Open DVD Player"
# action 106 = "Open iDVD"
# action 107 = "Open iPhoto"
# action 109 = "Open Front Row"
You can use Date & Time preferences (shown below) to set the date and time based on
a Network Time Protocol (NTP) server.
If you require automatic date and time, use a trusted, internal NTP server.
# Suggested Setting:
# Set the NTP server.
sudo cat >> /etc/ntp.conf << END server time.apple.com END
# Set the date and time.
sudo systemsetup -settimezone $Time_Zone
# Available Settings:
# NTP Server: Any valid NTP server
# Time Zone: /usr/share/zoneinfo
You can use several authentication methods to unlock the screen saver, including
digital tokens, smart cards, and biometric readers.
You should also set a short inactivity interval to decrease the amount of time the
unattended computer is unlocked. For information about requiring authentication for
screen savers, see “Securing Security Preferences” on page 99.
When you configure Desktop & Screen Saver preferences, you configure the
preferences for every user account on the computer.
This doesn’t prevent users from reconfiguring their preferences. You can restrict a user’s
account privileges so the user cannot reconfigure preferences. Doing this removes
several important user abilities, like the user’s ability to change his or her password. For
more information, see “Types of User Accounts” on page 118.
# Suggested Setting:
# Set idle time for screen saver. Replace XX with the idle time in seconds.
sudo defaults -currentHost write com.apple.screensaver idleTime -int XX
# Set host corner to activate screen saver.
sudo defaults write /Library/Preferences/com.apple.dock.wvous-corner_code-
corner -int 5
# Set modifier key to 0 wvous-corner_code-modifier
sudo defaults write /Library/Preferences/com.apple.dock.wvous-corner_code-
modifier -int 0
# Available Settings:
# Corner options:
# wvous-bl-corner (bottom-left)
# wvous-br-corner(bottom-right)
# wvous-tl-corner (top-left)
# wvous-tr-corner (top-right)
# Suggested Setting:
# Automatically hide and show Dock.
sudo defaults write /Library/Preferences/com.apple.dock autohide -bool YES
# Available Settings:
# autohide -bool YES
# autohide -bool NO
If the computer receives directory services from a network that manages its client
computers and you computer is in sleep mode, it is unmanaged and cannot be
detected as being connected to the network. To allow management and network
visibility, configure the display and the hard disk to sleep, but not the computer.
You can require authentication by use of a password, digital token, smart card, or
biometric reader to reactivate the computer (see “Securing Security Preferences” on
page 99). This is similar to using a password-protected screen saver.
# Suggested Setting:
# Disable computer sleep.
sudo pmset -a sleep 0
# Enable hard disk sleep.
sudo pmset -a disksleep 1
# Disable Wake for Ethernet network administrator access.
sudo pmset -a womp 0
# Disable Restart automatically after power failure.
sudo pmset -a autorestart 0
# Available Settings:
# 0 (OFF) or 1 (ON)
For information about requiring authentication for the screen saver, see “Securing
Security Preferences” on page 99.
Dashboard widgets included with Mac OS X can be trusted. However, be careful when
you install third-party Dashboard widgets. You can install Dashboard widgets without
authenticating. To prevent Dashboard from running, remove the Dashboard application
from the /Applications folder.
When you configure Exposé & Spaces preferences, you must configure these
preferences for every user account on the computer.
This doesn’t prevent users from reconfiguring their preferences. You can restrict a user
account’s privileges so the user cannot reconfigure preferences. To do this, you remove
several important user abilities, like the user’s ability to change his or her password. For
more information, see “Types of User Accounts” on page 118.
If your organization does not want to use Dashboard because of its potential security
risk, you can disable it. If the user has access to the Terminal application, Dashboard
can be re-enabled at any time.
# Suggested Setting:
# Disable dashboard.
sudo launchctl unload -w /System/Library/LaunchDaemons/
com.apple.dashboard.advisory.fetch.plist
# Available Settings:
# Enabled or Disabled
When configuring your computer for network access, use a static IP address when
possible. A DHCP IP address should be used only if necessary.
Some organizations use IPv6, a new version of the Internet protocol (IP). The primary
advantage of IPv6 is that it increases the address size from 32 bits (the current IPv4
standard) to 128 bits.
An address size of 128 bits is large enough to support a large number of addresses. This
allows more addresses or nodes than are otherwise available. IPv6 also provides more
ways to set up the address and simplifies autoconfiguration.
By default IPv6 is configured automatically, and the default settings are sufficient
for most computers that use IPv6. You can also configure IPv6 manually. If your
organization’s network cannot use or does not require IPv6, turn it off.
# Suggested Setting:
# Disable IPv6.
sudo networksetup -setv6off $interface
# Available Settings:
# The interface value can be AirPort, Bluetooth, Ethernet, or FireWire.
The 802.1X standard enhances the security of LANs by preventing unauthorized devices
from gaining access to the network through wired or wireless LAN connections. It
supports a wide range of authentication methods, including TLS, EAP–FAST, TTLS, LEAP,
MD5, and PEAP.
You might need to connect to a wireless (IEEE 802.11) or Ethernet (IEEE 802.3) network
that is protected by the 802.1X standard if you are in an education or business
environment. In an 802.1X secured environment, a computer cannot gain access to
network services, such as email or the Internet, until it is authenticated.
When configuring your 802.1X settings in Snow Leopard, you’ll need one or all of the
following information depending on the security method being used:
 User name and password
 Wireless network name (case sensitive)
 Authentication methods and options
 Server certificate or certificate chain
If you are using TLS, you need a user or machine identity (certificate or private key),
commonly distributed in a .p12 file (PKCS12).
Snow Leopard uses a concept of profiles to implement the 802.1X standard. The
authentication server does not understand the concept of profiles, nor does it care.
Authentication through any of the profile types is standards-based.
A User profile cannot be used if the computer is bound to a directory server such as
Open Directory and requires directory authentication to log into the computer. For
computers bound to a directory server, a System profile or a Login Window profile is
required.
At the login screen, a user enters a user name and password. If Login Window can’t find
a local user account with that name, it initiates an 802.1X session using the same name
and password. In the case of an 802.11 network it also associates to the wireless
network. After the 802.1X authentication completes, Login Window authenticates the
user with the directory service. If that authentication succeeds, the user is logged in.
When the user logs out, Login Window checks the 802.1X session to determine if it
started the session, and if so, it stops the 802.1X session. Also, if it is an 802.11 network,
it disassociates from the network.
If no one is logged in, no 802.1X session is running, so no 802.11 network is joined. The
Mac is not available on the authenticated network.
You can have multiple Login Window profiles for each location.
System Profile
In the System mode Snow Leopard authenticates to the network as long as this mode
is enabled. That means the computer authenticates to the network even when no one
is logged in, regardless of which user account logs in afterwards.
In computer labs and other similar environments where a system administrator needs
to update large groups of computers at the same time, this may be the best method.
After the user logs out, the computer authenticates using the System profile.
When you connect to an 802.1X network, you may be presented with a certificate trust
dialogue asking if you want to continue with the authentication to the server. In the
dialogue, you can select “Always Trust” the certificate, or click “Continue” to
authenticate a single time.
Certificates are stored in Keychain Access. All User profile certificates are installed in the
Login Keychain section of Keychain Access and all Login Window and System profile
certificates are installed in the System Keychain section of Keychain Access.
One purpose of the certificate trust dialogue is to inform you when a server presents a
certificate that has not been explicitly trusted. Another purpose is to allow you to
examine the certificate to ensure that it is appropriate for the network you are
authenticating to.
You should carefully examine certificates and not just blindly accept them. It’s possible
for someone to set up a rogue access point with their own certificate, and if you
continue with the authentication, the rogue access point could gather your password
from the authentication exchanges.
A certificate contains SHA-1 and MD-5 fingerprints, which uniquely identify the
certificate. Verify each certificate in the list, and if you are confident in the validity, trust
the certificates. If you are unsure, consult with your system administrator before
continuing.
When selecting a certificate for your 802.1X configuration, it must be the specific one
for access to the RADIUS server you are connecting to.
There is a distinction between a certificate for which you have the private key, usually
referred to as an identity, and just a certificate. A certificate is the public part of public
key infrastructure, and allows people to verify that you hold the private key. A private
key is only held by the entity that corresponds to the subject of the certificate, and
must be stored securely.
It’s also possible that you have the identity (certificate + private key) in the form of a
PKCS12 (.p12, .pfx) file. This file can be imported into the keychain by double-clicking it.
Although it is not necessary to create a Network location for a User profile, it is helpful
in a Login Window and System profile 802.1X configuration. When creating a location,
802.1X profiles that are configured are stored only under that location.
If you create a location, be sure it is selected when you are at that location. For
example, when traveling between two office locations, one in New York and one in
London, you must select the correct location to connect to the 802.1X network of the
office you are visiting.
User profiles are not location-sensitive. They are per user. You can add User profiles as
needed.
If you use TLS authentication, before doing anything else you must install a user
certificate or private key pair. We recommend that the System Administrator do it.
For information about importing 802.1X profiles, see the networksetup man page.
In the Content pane, use the “Allow access to only these websites” option to restrict
and define a list of websites that the user can visit.
7 In the Content pane, limit website access to specific sites by selecting “Allow access to
only these websites.”
8 Click the Add (+) button, select “Add bookmark” from the pop-up menu, and enter the
website name and address.
Only use printers in a secure location. If you print confidential material in an insecure
location, the material might be viewed by unauthorized users.
You can access your printer using the CUPS web interface (http://localhost:631). By
default, CUPS web interface cannot be accessed remotely. It can only be accessed by
the local host.
You can create policies in CUPS that restrict users from such actions as canceling jobs
or deleting printers using the CUPS web interface. For more information about creating
CUPS policies, see http://localhost:631/help/policies.html.
# Suggested Setting:
# Disable the receiving of faxes.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.efax.plist
# Disable printer sharing.
sudo cp /etc/cups/cupsd.conf $TEMP_FILE
if /usr/bin/grep "Port 631" /etc/cups/cupsd.conf
then
usr/bin/sed "/^Port 631.*/s//Listen localhost:631/g" $TEMP_FILE > /
etc/cups/cupsd.conf
else
echo "Printer Sharing not on"
fi
# Available Settings:
# Enabled or Disabled
The settings under “For all accounts on this computer” require you to unlock Security
preferences. Disable automatic login, require a password to unlock Security
preferences, disable automatic logout because of inactivity, use secure virtual memory,
and disable remote control infrared receivers.
General Security
Consider the following general security guidelines:
 Wake computer: Require a password to wake this computer from sleep or screen
saver. This helps prevent unauthorized access on unattended computers. Although
there is a lock button for Security preferences, users don’t need to be authorized as
an administrator to make changes. Enable this password requirement for every user
account on the computer.
 Automatic login: Disabling automatic login is necessary for any level of security. If
you enable automatic login, an intruder can log in without authenticating. Even if
you automatically log in with a restricted user account, it is still easier to perform
malicious actions on the computer.
 Password protect System Preferences: Some system preferences are unlocked
when you log in with an administrator account. By requiring a password, digital
token, smart card, or biometric reader to unlock secure system preferences, you
require extra authentication. This helps prevent accidental modification of system
preferences.
FileVault Security
Mac OS X includes FileVault (see below), which encrypts information in your home
folder.
For more information about FileVault, see “Encrypting Home Folders” on page 153.
Firewall Security
When you start firewall using the Firewall pane, only signed software is allowed to
receive incoming connections. Using the advanced section of the firewall (shown here),
you can specify which applications are authorized or unauthorized to accept incoming
network connections.
Note: We recommend that you block all incoming connections and allow only basic
Internet services.
Advanced options also include stealth mode that prevents the computer from sending
responses to uninvited traffic.
# Suggested Setting:
# Enable Require password to wake this computer from sleep or screen saver.
sudo defaults -currentHost write com.apple.screensaver askForPassword -int
1
# Disable Automatic login.
sudo defaults write /Library/Preferences/.GlobalPreferences\
com.apple.userspref.DisableAutoLogin -bool yes
# Require password to unlock each System Preference pane.
# Edit the /etc/authorization file using a text editor.
# Find <key>system.preferences<key>.
# Then find <key>shared<key>.
# Then replace <true/> with <false/>.
# Disable automatic login.
sudo defaults write /Library/Preferences/.GlobalPreferences\
com.apple.autologout.AutoLogOutDelay -int 0
# Enable secure virtual memory.
sudo defaults write /Library/Preferences/com.apple.virtualMemory\
UseEncryptedSwap -bool yes
# Disable IR remote control.
sudo defaults write /Library/Preferences/com.apple.driver.AppleIRController
DeviceEnabled -bool no
# Enable FileVault.
# To enable FileVault for new users, use this command.
sudo /System/Library/CoreServices/ManagedClient.app/Contents/Resources/\
createmobileaccount
# Enable Firewall.
# Replace value with
# 0 = off
# 1 = on for specific services
# 2 = on for essential services
sudo defaults write /Library/Preferences/com.apple.alf globalstate -int
value
# Enable Stealth mode.
sudo defaults write /Library/Preferences/com.apple.alf stealthenabled 1
# Enable Firewall Logging.
sudo defaults write /Library/Preferences/com.apple.alf loggingenabled 1
While the data is on the hard disk, it can be easily viewed or accessed if the computer is
later compromised. You can protect this data by securing the system swap file in case
of an attack or theft of your computer.
When your computer is turned off, information stored in RAM is lost, but information
stored by virtual memory in a swap file may remain on your hard disk in unencrypted
form. The Snow Leopard virtual memory system creates this swap file to reduce
problems caused by limited memory.
The virtual memory system can swap data between your hard disk and RAM. It’s
possible that sensitive information in your computer’s RAM will be written to your hard
disk in the swap file while you are working, and remain there until overwritten. This
data can be compromised if your computer is accessed by an unauthorized user,
because the data is stored on the hard disk unencrypted.
When your computer goes into hibernation, it writes the content of RAM to the /var/
vm/sleepimage file. The sleepimage file contains the contents of RAM unencrypted,
similar to a swap file.
You can prevent your sensitive RAM information from being left unencrypted on your
hard disk by enabling secure virtual memory to encrypt the swap file and the /var/vm/
sleepimage file (where your hibernation files are stored).
Using FileVault in combination with the “Secure Virtual Memory” feature provides
protection from attacks on your sensitive data when it is stored on the hard disk.
You can prevent your sensitive information from remaining on your hard disk and
eliminate the security risk by using secure virtual memory. Secure virtual memory
encrypts the data being written to disk.
# Suggested Setting:
# Enable secure virtual memory.
sudo defaults write /Library/Preferences/com.apple.virtualMemory\
UseEncryptedSwap -bool YES
# Available Setting:
# UseEncryptedSwap -bool NO
# UseEncryptedSwap -bool YES
# You can also turn hibernate off by using the following command:
# sudo pmset hibernatemode 0
Service Description
DVD or CD Sharing Allows users of other computers to remotely use the DVD or CD drive on
your computer.
Screen Sharing Allows users of other computers to remotely view and control the
computer.
File Sharing Gives users of other computers access to each user’s Public folder.
Printer Sharing Allows other computers to access a printer connected to this computer.
Scanner Sharing Allows other users to use a scanner connected to this computer.
Web Sharing Allows a network user to view websites located in /Sites. If you enable
this service, securely configure the Apache web server.
Remote Login Allows users to access the computer remotely by using SSH. If you require
the ability to perform remote login, SSH is more secure than telnet, which
is disabled by default.
Remote Management Allows the computer to be accessed using Apple Remote Desktop.
Remote Apple Events Allows the computer to receive Apple events from other computers.
Xgrid Sharing Allows computers on a network to work together in a grid to process
a job.
You can change your computer’s name in Sharing preferences, shown here.
When users use Bonjour to discover available services, your computer appears as
hostname.local. To increase privacy, change your computer’s host name so you are not
identified as the owner of your computer.
For more information about these services and the firewall and sharing capabilities of
Mac OS X, see Chapter 9, “Securing Network Services.”
# Suggested Setting:
# Change computer name where $host_name is the name of the computer.
sudo systemsetup -setcomputername $host_name
# Change computer Bonjour host name.
sudo scutil --set LocalHostName $host_name
# Available Setting:
# The host name cannot contain spaces or other non-DNS characters.
Instead of using Software Update (shown here), you can also update your computer by
using installer packages.
You can install and verify updates on a test computer before installing them on your
operational computer. For more information about how to manually update your
computer, see “Updating Manually from Installer Packages” on page 38.
After transferring installer packages to your computer, verify the authenticity of the
installer packages. For more information, see “Repairing Disk Permissions” on page 40.
Software Update will not install a software package that has not been digitally signed
by Apple.
# Suggested Setting:
# Disable check for updates and Download important updates automatically.
sudo softwareupdate --schedule off
# Available Setting:
# Check for Updates: Enabled or Disabled
# Check Updates: Daily, Weekly, Monthly
2 Select Internal microphone (if present), and set “Input volume” to zero.
3 Select Line In (if present), and set “Input volume” to zero.
This ensures that “Line In” is the device selected rather than the internal microphone
when Sound preferences is closed. This provides protection from inadvertent use of the
internal microphone.
# Suggested Setting:
# Disable internal microphone or line-in.
# This command does not change the input volume for input devices. It
# only sets the default input device volume to zero.
sudo osascript -e "set volume input volume 0"
# Available Setting:
# Internal microphone or line-in: Enabled or Disabled
Only enable these features if you work in a secure environment where no one can
hear you speak to the computer or hear the computer speak to you. Also make sure
no audio recording devices can record your communication with the computer.
If you enable text-to-speech, use headphones to keep others from overhearing your
computer.
# Suggested Setting:
# Disable Speech Recognition.
sudo defaults write
"com.apple.speech.recognition.AppleSpeechRecognition.prefs"
StartSpeakableItems -bool false
# Disable Text to Speech settings.
sudo defaults write "com.apple.speech.synthesis.general.prefs"
TalkingAlertsSpeakTextFlag -bool false
sudo defaults write "com.apple.speech.synthesis.general.prefs"
SpokenNotificationAppActivationFlag -bool false
sudo defaults write "com.apple.speech.synthesis.general.prefs"
SpokenUIUseSpeakingHotKeyFlag -bool false
sudo defaults delete "com.apple.speech.synthesis.general.prefs"
TimeAnnouncementPrefs
# Available Setting:
# Each item can be set to ON or OFF:
# OFF: -bool false
# ON: -bool true
Spotlight finds files regardless of their placement in the file system. You must still
properly set access permissions on folders containing confidential files. For more
information about access permissions, see “Repairing Disk Permissions” on page 40.
By placing specific folders or disks in the Privacy pane (shown below), you can prevent
Spotlight from searching them.
# Suggested Setting:
# Disable Spotlight for a volume and erase its current meta data, where
# $volumename is the name of the volume.
sudo mdutil -E -i off $volumename
# Available Setting:
# Spotlight can be turned ON or OFF for each volume.
In addition to choosing a new startup volume from Startup Disk preferences, you can
restart in Target Disk Mode. When your computer is in Target Disk Mode, another
computer can connect to your computer and access your computer’s hard disk. The
other computer has full access to all files on your computer. All file permissions for your
computer are disabled in Target Disk Mode.
For more information about enabling an EFI password, see “Using the Firmware
Password Utility” on page 55.
# Suggested Setting:
# Set startup disk.
sudo systemsetup -setstartupdisk $path
# Available Setting:
# Startup Disk = Valid Boot Volume
Time Machine is off by default. After you enable Time Machine for the first time,
no authentication is required and subsequent changes require authentication.
3 Select the disk where backups will be stored, and click Use for backup.
# Suggested Setting:
# Enable Time Machine.
sudo defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup 1
# Available Setting:
# 0 (OFF) or 1 (ON)
# Suggested Setting:
# Disable VoiceOver service.
launchctl unload -w /System/Library/LaunchAgents/com.apple.VoiceOver.plist
launchctl unload -w /System/Library/LaunchAgents/\
com.apple.ScreenReaderUIServer.plist
launchctl unload -w /System/Library/LaunchAgents/com.apple.scrod.plist
# Available Setting:
# None
When you define a user’s account you specify the information to prove the user’s
identity, such as user name, authentication method (password, digital token, smart
card, or biometric reader), and user identification number (user ID). Other information
in a user’s account is needed by various services—to determine what the user is
authorized to do and to personalize the user’s environment.
118
Unless you need administrator access for specific system maintenance tasks that
cannot be accomplished by authenticating with the administrator’s account while
logged in as a normal user, always log in as a nonadministrator user. Log out of the
administrator account when you are not using the computer as an administrator. Never
browse the web or check email while logged in to an administrator’s account.
If you are logged in as an administrator, you are granted privileges and abilities that
you might not need. For example, you can potentially modify system preferences
without being required to authenticate. This authentication bypasses a security
safeguard that prevents malicious or accidental modification of system preferences.
The user ID is a unique string of digits between 500 and 2,147,483,648. New users
created using the Accounts pane of System Preferences are assigned user IDs starting
at 501.
The user ID 0 is reserved for the root user. User IDs below 100 are reserved for system
use. User accounts with these user IDs should not be deleted and should not be
modified except to change the password of the root user.
If you don’t want the user name to appear in the login window of a computer, assign
a user ID of less than 500 and enter the following command in a Terminal window:
sudo defaults write /Library/Preferences/com.apple.loginwindow Hide500Users
-bool YES
In general, after a user ID is assigned and the user starts creating files and folders, you
shouldn’t change the user ID.
One possible scenario in which you might need to change a user ID is when merging
users from different servers onto a new server or cluster of servers. The same user ID
might have been associated with a different user on the previous server.
In security sensitive environments the guest account should remain disabled. If you
enable the guest account, enable parental controls to limit what the user can do.
Enabling parental control on an account does not defend against a determined
attacker and should not be used as the primary security mechanism.
Whether or not the guest account is enabled, disable guest account access to shared
files and folders by deselecting the “Allow guest to connect to shared folders”
checkbox. If you permit the guest account to access shared folders, an attacker can
easily attempt to access shared folders without a password.
When you finish with this account, disable it by deselecting the “Allow guests to log
into this computer.” This prevents the guest user account from logging into the
computer.
Note: If your computer is connected to a network, a managed user can also be a user
whose preferences and account information are managed through the network.
When creating nonadministrator accounts, restrict the accounts so they can only use
what is required. For example, if you plan to store sensitive data on your local
computer, disable the ability to burn DVDs.
If your computer is connected to a directory server, you can add directory users to your
computer and grant them access. You can restrict a directory user account by using
Parental Controls.
Access to directory servers is usually tightly restricted to protect the data on them.
If multiple users can log in as root, you cannot track which user performed root actions.
Do not allow direct root login because the logs cannot identify which administrator
logged in. Instead, log in using accounts with administrator privileges, and then use the
sudo command to perform actions as root.
For instructions about how to restrict root user access in Directory Utility, open Mac
Help and search for “Directory Utility.”
If the root account is enabled, you can disable it by using an administrative account
and the dsenableroot command. For example, the following command disables the
root account.
$ dsenableroot -d
By default, sudo is enabled for administrator users. From the command line, you can
disable root login or restrict the use of sudo. Limit the administrators allowed to use
sudo to those who require the ability to run commands as root.
The computer uses a file named /etc/sudoers to determine which users can use sudo.
You can modify root user access by changing the /etc/sudoers file to restrict sudo
access to specific accounts, and only allow those accounts to perform specifically
allowed commands. This gives you control over what users can do as root.
This value is set in the /etc/sudoers file. For more information, see the sudo and sudoers
man pages.
3 In the Defaults specification section of the file, add the following lines.
Defaults timestamp_timeout=0
Defaults tty_tickets
These lines limit the use of the sudo command to a single command per
authentication and also ensure that, even if a timeout is activated, later sudo
commands are limited to the terminal where authentication occurred.
Doing this means that when an administrator is added to the computer, the
administrator must be added to the /etc/sudoers file as described, if the administrator
needs to use sudo.
5 Save and quit visudo.
For more information, enter man vi or man visudo in a Terminal window. For information
about how to modify the /etc/sudoers file, see the sudoers man page.
Local accounts are hosted in a local directory domain. When you log in to a local
account, you authenticate with that local directory domain. Users with local accounts
typically have local home folders. When a user saves files in a local home folder, the
files are stored locally. To save a file over the network, the user must connect to the
network and upload the file.
Users with mobile accounts have local and network home folders that combine to form
portable home directories. When users save files, the files are stored in a local home
folder. The portable home directory is a synchronized subset of a user’s local and
network home folders. For information about protecting your home folder, see
Chapter 7, “Securing Data and Using Encryption.”
Directory Utility can be accessed from Account preferences by clicking Login Options
and then clicking Join or Edit and then clicking Open Directory Utility.
In Directory Utility, you can disable directory search services that are not used by
deselecting them in the Services pane (shown here).
You can also enable or disable each kind of directory service protocol.
Mac OS X doesn’t access disabled directory services, except for the local directory
domain, which is always accessed.
In addition to enabling and disabling services, you can use Directory Utility to choose
the directory domains you want to authenticate with. Directory Utility defines the
authentication search policy that Mac OS X uses to locate and retrieve user
authentication information and other administrative data from directory domains.
The login window Finder and other parts of Mac OS X use this authentication
information and administrative data. File service, Mail service, and other services
provided by Mac OS X Server also use this information.
Directory Utility also defines the contacts search policy that Mac OS X uses to locate
and retrieve name, address, and other contact information from directory domains.
Address Book can use this contact information, and other applications can be
programmed to use it as well.
The authentication and contacts search policy consists of a list of directory domains
(also known as directory nodes). The order of directory domains in the list defines the
search policy.
For more information about using Directory Utility, see Open Directory Administration.
To make sure your settings match your network’s required settings, contact your
network administrator. Whenever possible, all LDAP connections should be configured
to be encrypted using SSL.
For information about changing the security policy for an LDAP connection or for
information about protecting computers from malicious DHCP servers, see Open
Directory Administration.
Mac OS X v10.6 also supports digital signing and encrypted packet security settings
used by Active Directory. These setting are enabled by default.
If you’re connecting to an Active Directory server with Highly Secure (HISEC) templates
enabled, you can use third-party tools to further secure your Active Directory
connection.
When you configure Active Directory access, the settings you choose are generally
dictated by the Active Directory server’s settings. To make sure your settings match
your network’s required settings, contact your network administrator.
The “Allow administration by” setting should not be used in sensitive environments. It
can cause untended privilege escalation issues because any member of the group
specified will have administrator privileges on your computer. Additionally, you should
only connect to trusted networks.
For more information about using Directory Utility to connect to Active Directory
servers, see Open Directory Administration.
You can require passwords to log in, to wake the computer from sleep or from a screen
saver, to install applications, or to change system settings. Mac OS X also supports
authentication methods such as smart cards, digital tokens, and biometric readers.
Using a combination of these dimensions makes authentication more reliable and user
identification more certain.
For example, you can create a randomly generated password or a FIPS-181 compliant
password that is 12 characters long.
You can open Password Assistant from some applications. For example, when you
create an account or change passwords in Accounts preferences, you can use Password
Assistant to help you create a secure password.
Using Kerberos
Kerberos is an authentication protocol used for systemwide single sign-on, allowing
users to authenticate to multiple services without reentering passwords or sending
them over the network. Every system generates its own principals, allowing it to offer
secure services that are fully compatible with other Kerberos-based implementations.
Note: Snow Leopard supports Kerberos v5 but does not support Kerberos v4.
Snow Leopard uses Kerberos to make it easier to share services with other computers.
A key distribution center (KDC) server is not required to use Kerberos authentication
between two Snow Leopard computers.
For example, consider two Snow Leopard computers named “Mac01”and “Mac02.”
Mac02 has screen sharing and file sharing turned on. If Mac01 connects to a shared
folder on Mac02, Mac01 can subsequently connect to screen sharing on Mac02 without
supplying login credentials again.
This Kerberos exchange is only attempted if you connect using Bonjour, if you navigate
to the computer in Finder, or if you use the Go menu in Finder to connect to a server
using the local hostname of the computer name (for example, computer_name.local).
Kerberos is also used to secure the Back to My Mac (BTMM) service. For more
information about using Kerberos with BTMM, see “Securing BTMM Access” on
page 198.
Normally, after your computer gains a Kerberos ticket in this manner, keep the Kerberos
ticket until it expires. However, you can manually remove your Kerberos ticket using the
Kerberos utility in Snow Leopard.
You can also use the kinit, kdestroy, and kpasswd commands to manage Kerberos
tickets. For more information, see the kinit, kdestroy, and kpasswd man pages.
The microprocessor inside the smart card can do authentication evaluation offline
before releasing information.
Before the smart card processes information, you must authenticate with the smart
card by a PIN or biometric measurement (such as a fingerprint), which provides an
additional layer of security.
For more information, see the Smart Card Setup Guide at www.apple.com/business/
resources/.
Using Tokens
You can use a digital token to identify a user for commerce, communication, or access
control. This token can be generated by software or hardware.
Some common tokens are the RSA SecurID and the CRYPTOCard KT-1 devices. These
hardware devices generate tokens to identify the user. The generated tokens are
specific to that user, so two users with different RSA SecurIDs or different CRYPTOCard
KT-1s have different tokens.
You can use tokens for two-factor authentication. Two-factor refers to authenticating
through something you have (such as a one-time-password token) and something you
know (such as a fixed password). The use of tokens increases the strength of the
authentication. Tokens are frequently used for VPN authentication.
Using Biometrics
Mac OS X supports biometrics authentication technologies such as thumbprint readers.
Password-protected websites and applications can be accessed without requiring the
user to remember a long list of passwords.
Some biometric devices allow you to authenticate by placing your finger on a pad.
Unlike a password, your fingerprint can never be forgotten or stolen. Fingerprint
identification provides personal authentication and network access.
The use of biometrics can enhance authentication by using something that is a part of
you (such as your fingerprint).
Global password policies are not implemented in Mac OS X; instead, password policies
are set for each user account.
You can set specific rules governing the size and complexity of acceptable passwords.
For example, you can specify requirements for the following:
 Minimum and maximum character length
 Alphabetic and numeric character inclusion
 Maximum number of failed logins before account lockout
For advanced password policies, use Password Server in Mac OS X Server. You can use it
to set global password policies that specify requirements for the following:
 Password expiration duration
 Special character inclusion
 Mixed-case character inclusion
 Password reuse limits
You can use pwpolicy to set a password policy that meets your organization’s password
standards. For more information about how to use pwpolicy, enter man pwpolicy in a
Terminal window.
Storing Credentials
Mac OS X includes Keychain Access, an application that manages collections of
passwords and certificates in a single credential store called a keychain. Each keychain
can hold a collection of credentials and protect them with a single password.
Keychains store encrypted passwords, certificates, and other private values (called
secure notes). These values are accessible only by unlocking the keychain using the
keychain password and only by applications that are approved and added to the access
control application list.
You can create multiple keychains, each of which appears in a keychain list in Keychain
Access. Each keychain can store multiple values. Each value is called a key item. You can
create a key item in any user-created keychain.
Each item in a keychain has an Access Control List (ACL) that can be populated with
applications that have authority to use that keychain item. A further restriction can be
added that forces an application with access to confirm the keychain password.
The main issue with remembering passwords is that you’re likely to make all passwords
identical or keep a written list of passwords. By using keychains, you can greatly reduce
the number of passwords you need to remember. Because you no longer need to
remember passwords for multiple accounts, the passwords you choose can be very
complex and can even be randomly generated.
If a credential must be stored on the computer, store and manage it using Keychain
Access. Check your organization’s policy on keychain use.
Snow Leopard Keychain services enable you to create keychains and provide secure
storage of keychain items. After a keychain is created, you can add, delete, and edit
keychain items, such as passwords, keys, certificates, and notes. A user can unlock a
keychain with a single password and applications can then use that keychain to store
and retrieve data, such as passwords.
You should change the settings for the login keychain so the user must unlock it when
he or she logs in, or after waking the computer from sleep.
For example, a user might want to group credentials for mail accounts into one
keychain. Because mail programs query the server frequently to check for mail, it is not
practical for the user to reauthenticate when such a check is performed.
The user could create a keychain and configure its settings, so that he or she is required
to enter the keychain password at login and whenever the computer is awakened from
sleep.
He or she could then move all items containing credentials for mail applications into
that keychain and set each item so that only the mail application associated with that
credential can automatically access it. This forces other applications to authenticate to
access that credential.
You can also create multiple keychains to accommodate varying degrees of sensitivity.
By separating keychains based on sensitivity, you prevent the exposure of sensitive
credentials to less sensitive applications with credentials on the same keychain.
You can also use the security and systemkeychain commands to create and manage
your keychains. For more information, see the security and systemkeychain man
pages. For information, see “Securing Keychains and Their Items” on page 137.
Smart cards are seen by the operating system as dynamic keychains and are added to
the top of the Keychain Access list. They are the first searched in the list. They can be
treated as other keychains on the user’s computer, with the limitation that users can’t
add other secure objects.
When you attach a supported smart card to your computer, it appears in Keychain
Access. If multiple smart cards are attached to your computer, they appear at the top of
the keychain list alphabetically as separate keychains.
You can manually unlock and change the PIN using Keychain Access. When changing
the PIN on your smart card it is the same as changing the password on a regular
keychain.
In Keychain Access, select your smart card and unlock it by double-clicking it. If it is not
unlocked, you are prompted to enter the password for the smart card, which is the
same as the PIN. Enter the PIN and Keychain Access to view the PIN-protected data on
that smart card.
For more information, see the Smart Card Setup Guide at www.apple.com/business/
resources/.
Anyone attempting to access data on the portable computer needs the portable
computer, portable drive, and password for the keychain stored on the portable drive.
This provides an extra layer of protection if the laptop is stolen or misplaced.
To use a portable drive to store keychains, move your keychain files to the portable
drive and configure Keychain Access to use the keychains on the portable drive.
The default location for your keychain is ~/Library/Keychains/. However, you can store
keychains in other locations.
You can further protect portable keychains by storing them on biometric USB flash
memory drives, or by storing portable drive contents in an encrypted file.
For information, see “Encrypting Portable Files” on page 157.
Check with your organization to see if they allow portable drives to store keychains.
When you communicate with a secure site, the information exchanged with the site is
encrypted. This protects your login information, credit card numbers, addresses, and
other secure data.
In Snow Leopard, certificates are part of your digital identity and are stored in your
keychain. Keychain Access lets you manage your certificates and keychains.
Certificates are issued by trusted organizations, such as VeriSign, Inc. or RSA Data
Security, Inc. When you go to a secure website, Snow Leopard checks the site’s
certificate and compares it with certificates that are known to be legitimate. If the
website’s certificate is not recognized, or if the site doesn’t have one, you receive a
message.
The validity of a certificate is verified electronically using the public key infrastructure,
or PKI. Certificates consist of your public key, the identity of the organization, the
certificate authority (CA) that signed your certificate, and other data that may be
associated with your identity.
A certificate is valid only for a limited time; it then becomes invalid and must be
replaced with a newer version. The CA can also revoke a certificate before it expires.
If you need to send a certificate to someone, you can export it using Keychain Access,
and then send it through email or by other means. Likewise, if someone sends you a
certificate, you can add it to your keychain by dragging it onto the Keychain Access
icon, or by using the Import menu in Keychain Access.
By default, certificates created using Certificate Assistant have a 2048 bit key size. Keys
less than 1024 bits are known to be broken, and 1024 bit keys are expected to be
broken within the expiration time of the certificate issued.
For Keychain Access to recognize a certificate file, it must have a file extension that
identifies it as containing certificates.
If Keychain Access is open, you can add a certificate by dragging the certificate onto
the Keychain Access icon in the Dock.
You can also add a certificate to a keychain by choosing File > Import in Keychain
Access.
By setting global permissions, encrypting home folders, and encrypting portable data,
you can be sure your data is secure. In addition, by using the secure erase feature of
Mac OS X, deleted data is completely erased from the computer.
Understanding Permissions
You protect files and folders by setting permissions that restrict or allow users to access
them. Mac OS X supports two methods of setting file and folder permissions:
 Portable Operating System Interface (POSIX) permissions—standard for UNIX
operating systems.
 Access Control Lists (ACLs) permissions—used by Mac OS X, and compatible with
Microsoft Windows Server 2003 and Microsoft Windows XP.
ACL uses POSIX when verifying file and folder permissions. The process ACL uses to
determine if an action is allowed or denied includes verification rules called access
control entries (ACEs). If no ACEs apply, standard POSIX permissions determine access.
Note: In this guide, the term “privileges” refers to the combination of ownership and
permissions, while the term “permissions” refers only to the permission settings that
each user category can have (Read & Write, Read Only, Write Only, and None).
143
Setting POSIX Permissions
Mac OS X bases file permissions on POSIX standard permissions such as file ownership
and access. Each share point, file, and folder has read, write, and execute permission
defined for three categories of users: owner, group, and everyone.
You can assign four types of standard POSIX access permissions to a share point, folder,
or file: Read & Write, Read Only, Write Only, and None.
Before setting or changing POSIX permissions, view the current permission settings.
Note: The “~” refers to your home folder, which in this case is /Users/ajohnson.
~/Documents/ is the current working folder.
You can also use the Finder to view POSIX permissions. In the Finder, Control-click a file
and choose Get Info. Open the Sharing & Permissions disclosure triangle to view POSIX
permissions.
In this example, NewFolder has the POSIX permissions drwxr-xr-x and has an owner
and group of ajohnson. Permissions are as follows:
 The d of the POSIX permissions signifies that newfolder is a folder.
 The first three letters after the d (rwx) signify that the owner has read, write, and
execute permissions for that folder.
 The next three characters, r-x, signify that the group has read and execute
permissions.
 The last three characters, r-x, signify that all others have read and execute
permissions.
In this example, users who can access ajohnson’s ~/Documents/ folder can open the
NewFolder folder but can’t modify or open the file.txt file. Read POSIX permissions are
propagated through the folder hierarchy.
Although NewFolder has drwxr-xr-x privileges, only ajohnson can access the folder.
This is because ajohnson‘s ~/Documents/ folder has drwx------ POSIX permissions.
By default, most user folders have drwx------ POSIX permissions. Only the ~/, ~/Sites/,
and ~/Public/ folders have drwxr-xr-x permissions. These permissions allow other
people to view folder contents without authenticating. If you don’t want other people
to view the contents, change the permissions to drwx------ .
In the ~/Public/ folder, the Drop Box folder has drwx-wx-wx POSIX permissions. This
allows other users to add files into ajohnson‘s drop box but they can’t view the files.
You might see a t for others’ privileges on a folder used for collaboration. This t is
sometimes known as the sticky bit. Enabling the sticky bit on a folder prevents people
from overwriting, renaming, or otherwise modifying other people’s files. This can be
common if several people are granted rwx access.
The sticky bit can appear as t or T, depending on whether the execute bit is set for
others:
 If the execute bit appears as t, the sticky bit is set and has searchable and executable
permissions.
 If the execute bit appears as T, the sticky bit is set but does not have searchable or
executable permissions.
Viewing Flags
Before setting or changing file or folder flags, view the current flag settings.
This example displays the flag settings for a folder named secret.
Modifying Flags
After your determine current file or folder flag settings, modify them using the chflags
command.
WARNING: There is an schg option for the chflags command. It sets the system
immutable flag. This setting can only be undone when the kernel security level
(kern.securelevel) is less than or equal to zero. To determine your current kernel
security level, use this command sysctl kern.securelevel.
The rules specify the permissions to be granted or denied to a group or user and
controls how the permissions are propagated through a folder hierarchy.
ACLs in Mac OS X let you set file and folder access permissions for multiple users and
groups, in addition to standard POSIX permissions. This makes it easy to set up
collaborative environments with smooth file sharing and uninterrupted workflows
without compromising security.
Mac OS X has implemented file system ACLs that are fully compatible with Microsoft
Windows Server 2003, Windows Server 2008, Windows XP, and Windows Vista.
To determine if an action is allowed or denied, ACEs are considered in order. The first
ACE that applies to a user and action determines the permission and no further ACEs
are evaluated. If no ACEs apply, standard POSIX permissions determine access.
The umask value is subtracted from the maximum permissions value (777) to
determine the default permission value of a new file or folder. For example, a umask of
022 results in a default permission of 755.
The default umask setting 022 (in octal) removes group and other write permissions.
Group members and other users can read and run these files or folders. Changing the
umask setting to 027 enables group members to read files and folders and prevents
others from accessing the files and folders. If you want to be the only user to access
your files and folders, set the umask setting to 077.
You must be logged in as a user who can use sudo to perform these operations and
you must use the octal number.
Note: Users and applications can override default umask settings at any time for their
own files.
WARNING: Many installations depend on the default umask setting. There can be
unintended and possibly severe consequences to changing it. Instead, use inherited
permissions, which are applied by setting permissions on a folder. All files contained
in that folder inherit the permissions of that folder.
Users can use the Finder’s Get Info window or the chmod command-line tool to change
permissions for files and folders.
The setuid bit is represented with an “s” in the field of permissions, in the position that
contains the file owner’s execute permission. The program runs with the privilege level
of the file’s owner. The owner of the file is root, so when ping is executed—no matter
who executes it—it runs as root. For setgid programs, an “s” appears in the group
execute permission and the file runs with the privileges of the group owner.
Because attackers try to influence or co-opt the execution of setuid programs to try to
elevate their privileges, there is benefit in removing the setuid bit from programs that
may not need it. There is also benefit in restricting to administrators the right to
execute a setuid program.
If a program is needed but has had its setuid bit stripped, an administrator can run the
program using sudo, which runs the program as the root user. An administrator can
also temporarily enable the setuid bit while the program is needed, and then disable it
again afterward.
To strip the setuid or setgid bit from a program, use the following command:
$ sudo chmod -s programname
The following programs can have their setuid bit removed, unless needed for the
purpose shown in the second column:
Important: The Repair Permissions feature of Disk Utility reenables the setuid bit on
these programs. Software updates may also reenable the setuid bit on these programs.
To achieve some persistence for the permissions change, create a shell script to strip
the bits and then implement a launchd job (for the root account) to execute this script
every half hour. This ensures that no more than half an hour passes from the time a
system update is applied until the setuid bits are removed.
For information about how to set up a launchd job, see Introduction to Command-Line
Administration, available at www.apple.com/server/macosx/resources/.
All users on the system are in the staff group, so the following commands allow
members of the admin group to execute <program name> but deny that right to
members of the staff group:
$ sudo chmod +a “group:staff deny execute” <program name>
$ sudo chmod +a# 0 “group:admin allow execute” <program name>
Because the ACL is evaluated from top to bottom, users in the admin group are
permitted to execute the program. The following rule denies that right to all users.
Important: Although the "Repair Permissions" feature of Disk Utility does not strip
ACLs from programs, software updates might strip these ACLs. To achieve a degree
of persistence for the ACLs, create a shell script to set the ACLs and then implement
a launchd job (for the root account) to execute this script.
For information about how to set up a launchd job, consult Introduction to Command-
Line Administration, available at http://www.apple.com/server/macosx/resources/.
A launchd job should ensure that a specific time period (or less) should pass from the
time a system update is applied and the ACL is reset. Because the ACL described above
uses the +a# option to place rules in noncanonical order, its reapplication results in
additional rules. The following script can successfully apply and reapply the rules:
chmod –a “group:admin allow execute” <program name>
chmod +a “group:staff deny execute” <program name>
chmod +a# 0 “group:admin allow execute” <program name>
When FileVault is not enabled, permissions on the home folder of a user account allow
other users to browse the folder’s contents. However, users might inadvertently save
sensitive files to their home folder, instead of into the more-protected ~/Documents, ~/
Library, or ~/Desktop folders.
The ~/Sites, ~/Public, and ~/Public/Drop Box folders in each home folder may require
world-readable or world-writeable permissions if File Sharing or Web Sharing is
enabled. If these services are not in use, permissions on these folders can be safely
changed to prevent other users from browsing or writing to their contents.
In Snow Leopard, all users are a member of the staff group, not of a group that has
the same name as their user name.
Note: Changing permissions on a user’s home directory from 750 to 700 disables
Apple file sharing (using the ~/Public directory) and Apple web sharing (using the
~/Sites directory).
As the owner of his or her home folder, the user can alter the folder’s permission
settings at any time, and can change these settings back.
FileVault moves all content of your home folder into a bundle disk image that supports
AES-256 encryption. Snow Leopard supports the Mac OS X version 10.4 Tiger sparse
disk image format created using AES-128 encryption. Sparse format allows the image
to maintain a size proportional to its contents, which can save disk space.
If you remove files from a FileVault-protected home folder, it takes time to recover free
space from the home folder. After the home folder is optimized, you can access files in
FileVault-protected home folders without noticeable delays.
If you’re working with confidential files that you plan to erase later, store those files in
separate encrypted images that are not located in your home folder. You can then
erase those images without needing to recover free space. For more information, see
“Encrypting Portable Files” on page 157.
If you’ve insecurely deleted files before using FileVault, these files are recoverable
after activating it. When you initially enable FileVault, securely erase free space. For
information, see “Using Disk Utility to Securely Erase Free Space” on page 162.
Because FileVault is an encryption of a user’s local home folder, FileVault does not
encrypt or protect files transferred over the network or saved to removable media,
so you must encrypt specific files or folders. FileVault can only be enabled for local or
mobile accounts and cannot be enabled for network home folders.
When you set up FileVault, you create a master password. If you forget your login
password, you can use your master password to recover encrypted data. If you forget
your login password and your master password, you cannot recover your data. Because
of this, consider sealing your master password in an envelope and storing it in a secure
location.
You can use Password Assistant to help create a complex master password that cannot
be easily compromised. For information, see “Using Password Assistant to Generate or
Analyze Passwords” on page 130.
Enabling FileVault copies data from your home folder into an encrypted home folder.
After copying, FileVault erases the unencrypted data.
By default, FileVault insecurely erases the unencrypted data, but if you enable secure
erase, your unencrypted data is securely erased.
Overview of FileVault
Snow Leopard allows the unlocking of FileVault accounts by smart cards, which
provides the most secure practice for protecting FileVault accounts.
FileVault encrypts the Data Key (DK) using the User Key (UK1), which can be generated
from your passphrase or from the public key on your smart card. FileVault separately
encrypts the Data Key using the FileVault Master Key (MK).
The architectural design of FileVault makes it possible for the MK and UK1 to encrypt
and decrypt files. Providing strong encryption protects user data at rest while ensuring
access management by IT staff.
Managing FileVault
You can set a FileVault master keychain to decrypt an account that uses FileVault to
encrypt data. Then, if users forget their FileVault account password (which they use to
decrypt encrypted data), you can use the FileVault master keychain to decrypt the data.
This ensures that even if someone unlocks the FileVault master keychain they cannot
decrypt the contents of a FileVault account because there is no FileVault master
password private key available for decryption.
This provides network management of any FileVault account created on any computer
with the modified FileVaultMaster.keychain located in the /Library/Keychains/ folder.
These computers indicate that the master password is set in Security preferences.
When an account is created and the modified FileVault master keychain is present, the
public key from the FileVault recovery key is used to encrypt the dynamically generated
To decrypt access to the encrypted disk image, the FileVault master password private
key is required to decrypt the original dynamically generated AES 128-bit or 256-bit
symmetric key.
The user’s original password continues to work as normal, but the assumption here is
that the master password service is being used because the user has forgotten the
password or the organization must perform data recovery from a user’s computer.
5 Log in to the FileVault account you are attempting to recover and incorrectly enter the
account password three times.
If “Password Hints” is enabled, you are granted an additional try after the hint appears.
6 When prompted for the master password, have the security administrators combine
their password components to unlock access to the account.
7 When the account is unlocked, provide a new password for the account.
The password is used to encrypt the original symmetric key used to encrypt and
decrypt the disk image.
Note: This process does not reencrypt the FileVault container. It reencrypts the original
symmetric key with a key derived from the new user account password you entered.
You are now logged in to the account and given access to the user’s home folder.
8 Delete the private key from FileVaultMaster.keychain again, or replace the keychain file
with the original copy of FileVaultMaster.keychain that was stored before the private
key was deleted.
This process does not change the password used to protect the user’s original login
keychain, because that password is not known or stored anywhere. Instead, this
process creates a login keychain with the password entered as the user’s new account
password.
Using a server-based encrypted disk image provides the added benefit of encrypting
network traffic between the computer and the server hosting the mounted encrypted
disk image.
Creating an encrypted image from existing data copies the data from an unprotected
area to the encrypted image. If the data is sensitive, create the image before creating
the documents. This creates the working copies, backups, or caches of files in
encrypted storage from the start.
Note: To prevent errors when a file system inside a sparse image has more free space
than the volume holding the sparse image, HFS volumes inside sparse images report
an amount of free space slightly less than the amount of free space on the volume the
image resides on.
If you plan to add files to this image instead of creating an image from existing data,
create an encrypted disk image and add your existing data to it. For information, see
“Creating an Encrypted Disk Image” on page 157.
Some applications do not support printing to PDF. In this case, create an encrypted disc
image. For information, see “Creating an Encrypted Disk Image from Existing Data” on
page 158.
The zero-out erase is the quickest. The 35-pass erase is the most secure, but it is also 35
times slower than the zero-out erase.
Each time you use a 7-pass or 35-pass secure erase, the following seven-step algorithm
is used to prevent the data from ever being recovered:
 Overwrite file with a single character
 Overwrite file with zeroes
 Overwrite file with a single character
 Overwrite file with random characters
 Overwrite file with zeroes
 Overwrite file with a single character
 Overwrite file with random characters
Note: If you have a partition with Mac OS X installed and you want to securely erase an
unmounted partition, you don’t need to use your installation discs. In the Finder, open
Disk Utility (located in /Applications/Utilities/).
For example, srm supports simple methods, like overwriting data with a single pass of
zeros, to more complex ones, like using a 7-pass or 35-pass erase.
The srm command cannot remove a write-protected file owned by another user,
regardless of the permissions of the directory containing the file.
WARNING: Erasing files with srm is irreversible. Before securely erasing files, back up
critical files you want to keep.
WARNING: Using Secure Empty Trash is irreversible. Before securely erasing files, back
up critical files you want to keep.
To erase free space using a 7-pass secure erase (indicated by the number 2):
$ diskutil secureErase freespace 2 /dev/disk0s3
When you install a guest operating system on your Intel-based Mac computer, ACLs set
on your Mac partition might not be enforced by the guest operating system. This
creates a possible point of intrusion or corruption to your sensitive data. When the
guest operating system is booted, your computer becomes susceptible to network
vulnerabilities of the guest operating system.
If you decide to use a guest operating system on your Mac computer, use encrypted
disk images to store your data when you are using Snow Leopard. This prevents your
sensitive data from being accessed by the guest operating system. For more
information, see “Creating an Encrypted Disk Image” on page 157.
Also, keep backup copies of your data in the event that your Snow Leopard partition
becomes corrupt.
When setting a password for your guest operating system, start in Snow Leopard and
use Password Assistant to create a strong password. For more information, see “Using
Password Assistant to Generate or Analyze Passwords” on page 130.
You can also prevent attacks by keeping your guest operating system installed with the
most current updates.
Time Machine is based on the Mac OS X HFS+ file system. It tracks file changes and
detects file system permissions and user access privileges.
When Time Machine performs the initial backup, it copies the contents of your
computer to your backup disk. Every subsequent backup is an incremental backup,
which copies only the files that have changed since the previous backup.
For example, Mac users that are in a Windows Server environment can use this method
of backing up to ensure that sensitive data is secure and regularly backed up.
Only send mail that is digitally signed and encrypted. Digitally signed messages let
your recipients verify your identity as the sender and provide assurance that the
message was not tampered with in transit. Encrypted messages keep the contents of
the message private and readable only by the intended recipient.
You can only send encrypted messages to recipients if you receive a digitally signed
message from them or if you have access to their public key. Recipients receive your
public key when they receive your signed messages.
165
This certificate-based system is referred to as public key infrastructure (PKI) messaging.
It verifies that the message is from you and that it has not been altered in transit. When
you use PKI and encrypt a message, only the intended recipient can read and view its
contents.
Mail recognizes sender and recipient certificates. It notifies you of the inclusion of
certificates by displaying a Signed (checkmark) icon and an Encrypted (closed lock)
icon.
When sending signed or encrypted mail, the sender’s certificate must contain the
case-sensitive mail address listed in Mail preferences.
To further enhance security, disable the display of remote images in HTML messages in
Mail’s Viewing preferences. Bulk mailers use image-tracking mechanisms to find
individuals who open junk mail. If you don’t load remote images, you help reduce
spam.
If you use a third-party mail application, consider applying similar security guidelines.
For more information, open Mail Help and search for “security.”
If you are using SSL to connect to your mail server, your password and data are securely
transmitted. However, you can further secure your password by using a strong
authentication method that provides additional password protection, as well as
stronger identity validation. You can protect your password by using one of the
following authentication methods:
 MD5 Challenge-Response
 Kerberos Version 5 (GSSAPI)
 NTLM
Note: Password is the default selection. Using Password for this option does not
provide additional authentication or password protection.
The authentication method you choose should match the configuration of the mail
server for the account being established. The server and the client must be configured
with the same authentication method to communicate properly.
An email can be created to display anything in the “To:” line in a graphical, user-friendly
application such as Mail. The Mail application default is set to display the user-friendly
name rather than the actual email address in the “To:” line. This should be changed to
display the email address of the sender.
To send a signed message, you must have a digital identity in your keychain. Your
digital identity is the combination of a personal certificate and a corresponding private
key. You can view digital identities in your keychain by opening Keychain Access and
clicking My Certificates in the Category list.
If you only have the certificate portion of your digital identity, you can’t send signed
messages. You must have the corresponding private key. Also, if people use your
certificate to send you an encrypted message, you must have your private key installed
on the computer that you are trying to view the message on. Otherwise, you cannot
view the encrypted message.
If you’re sending the message to a mailing list, send it unsigned. Many mailing lists
reject signed messages (because the signature is an attachment). To send the message
unsigned, click the Signed icon. An “x” replaces the checkmark.
An Encrypted (closed lock) icon appears next to the Signed icon if you have a personal
certificate for a recipient in your keychain. The icon indicates the message will be
encrypted when you send it.
If you don’t have a certificate for all recipients, you’re asked to cancel the message or
send the message unencrypted. To send the message unencrypted, click the Encrypted
icon. An open lock icon replaces the closed lock icon.
If your recipients use Mail, security headers marked Signed and Encrypted are visible in
the messages they receive. If they’re using a mail application that doesn’t use signed
and encrypted messages, the certificate might be in the form of an attachment. If
recipients save the attachment as a file, they can add your certificate to their keychains.
After disabling cookies, remove existing cookies using the Show Cookies dialog in
Safari Security preferences. For websites that require cookies, enable cookies and then
disable them after visiting the site.
Enabling and disabling cookies can be time-consuming if you visit many sites that use
cookies. Consider using multiple accounts with different cookie settings. For example,
your personal account might allow all cookies, while your more secure account has
restrictive cookie settings.
JavaScript has built-in security restrictions that limit JavaScript applications and prevent
them from compromising your computer. However, by disabling it, you can further
secure your computer from unauthorized JavaScript applications attempting to run on
your computer.
When using Safari, use private browsing. Private browsing prevents Safari from logging
actions, adding webpages to history, keeping items in the Downloads window, saving
information for AutoFill, and saving Google searches. You can still use the Back and
Forward buttons to navigate through visited sites. After you close the window, the Back
and Forward history is removed.
After using Safari, empty the cache. Caching improves performance and reduces
network load by storing viewed webpages and webpage content on your local hard
disk, but it is a security risk because these files are not removed.
For information about how to perform these tasks and for other Safari security tips,
open Safari Help and search for “security.”
There are two common methods for verifying the validity of a certificate: Online
Certificate Status Protocol (OCSP) and Certificate Revocation List (CRL).
OCSP and CRL are off by default. To change the validation settings, use Keychain Access
> Preferences, and then click Certificates.
You can also visually inspect certificates using Safari or Keychain Access.
You can also manually check the validity of a certificate. While using Safari, click the
lock in the upper right corner of the page. A certificate drop-down page appears and
a green check icon indicates that the certificate can be trusted. You can continue to
move up the chain of certificates, checking their validity and verifying the green check
icon is there.
If a certificate is invalid, the lock icon turns red. The invalid certificate also has a red-x
icon indicating it is invalid.
You can use Certificate Assistant in Keychain Access to evaluate a certificate and
determine if it is genuine. Software that uses certificates, such as a mail application or
web browser, usually evaluates certificates before using them. However, Certificate
Assistant lets you evaluate certificates given to you with a greater amount of control
and detail.
To include other certificates from your keychain when evaluating the certificate chain,
select “Include certificates from my keychain.” For example, if the root and intermediate
certificates for your selected certificate are in your keychain, selecting this button
includes them in the evaluation.
The default certificate evaluated is always the user certificate, or leaf. If the certificate
you want to evaluate is an intermediate or root certificate, click Make Leaf.
Client-Side Authentication
Some applications or services require a digital certificate to authenticate. Digital
certificates can be stored in a smart card and can also include a photograph of the
authorized user to further protect a certificate from being used by an unauthorized
user.
Before they are opened, the following content factors are examined to verify that the
file is safe:
 The file extension
 The MIME type
 What’s inside the file
Sometimes malware tries to disguise itself as safe, but Snow Leopard checks for signs
that indicate this. If Safari considers that a downloaded file is safe:
 Safari opens the file after it downloads.
 If the downloaded file is an archive (.zip file), Safari decompresses it.
 If the downloaded file is a disk image (.img file), Safari mounts the image volume.
Other types of files might not be safe. Applications, scripts, web archives, and archives
that contain applications or scripts can harm your computer. Not all such files are
unsafe, but you should exercise caution when opening a downloaded file.
Note: Although Safari, iChat, and Mail offer Download Validation for increased security,
no software can detect all potentially dangerous file types.
If Download Validation determines that a downloaded file is unsafe, you are prompted
to download or cancel the download. If you download the file, it is placed in your
download location as configured in Safari preferences. If you cancel, the file is not
saved.
When you attempt to open a quarantined file, the file is also checked for known
instances of malware software. If malware software is discovered, a warning appears.
Click the Move to Trash button to delete the file. If it is a disk image, eject the image
and delete the source file.
The file is named the same as the original file with “.download” at the end of it. This can
be moved to the Trash or inspected manually.
If you don’t want to see this message, choose Preferences from the Safari menu and
click Security. Deselect the checkbox labeled “Ask before sending a nonsecure form to a
secure website.”
Syncing Bookmarks
If you’re using Snow Leopard or later and Safari 1.0 or later, you can synchronize your
Safari bookmarks with the bookmarks in your MobileMe Bookmarks library on the web.
You can also synchronize your Safari bookmarks across multiple Mac OS X computers.
# -------------------------------------------------------------------
# Securing Applications
# -------------------------------------------------------------------
# Disabling iSync
# -----------------------------
# Default Setting:
# OFF
# Suggested Setting:
# Disable iSync.
launchctl unload -w /System/Library/LaunchAgents/\
com.apple.syncservices.SyncServer.plist
launchctl unload -w /System/Library/LaunchAgents/\
com.apple.syncservices.uihandler.plist
# Available Setting:
# None
For more information about using launchctl, see “Understanding and Managing
Daemons and Agents” on page 221.
For example, if you delete a bookmark from MobileMe Bookmarks with synchronization
turned off, the bookmark is deleted from Safari on your computer’s hard disk the next
time you use iSync with synchronization turned on.
AutoFill
Safari can use information from various sources to complete forms that are on many
webpages:
 Personal information, such as mailing addresses, mail addresses, and phone numbers,
are retrieved from your Address Book card.
 User names and passwords that you enter on websites are saved in your keychain
and retrieved when you try to log in later. (Some websites do not allow you to save
your user name and password.)
 Any other information that you enter at a website is saved in Safari’s cache to be
reused later.
You can select the information that Safari uses to complete web forms. Choose
Preferences from the Safari menu and click AutoFill. Then select the items you want
Safari to use.
To complete individual fields in a form, select a text box and start typing. If Safari
matches saved information for the field, it finishes entering the text for you. If several
items match what you typed, a menu appears. Press the arrow keys to select the
correct item and press Return.
Website forms can include items that Safari doesn’t recognize. You must fill out these
items yourself.
If you enter a user name and password, Safari asks if you want to save the information.
Click Yes to save the name and password. Click Not Now if you don’t want to save the
information yet. Click Never for this Website if you don’t want to be asked to save the
name and password for the website again.
To change or delete saved user names and passwords or other information, click the
Edit button next to the related checkbox in the AutoFill preferences pane.
You can disable plug-ins by removing them form the /Library/Internet Plug-Ins/ folder.
The Java plug-in is enabled by default and handles Java applets on webpages. If you
are not using Java, disable the Java plug-in.
Some webpages display pop-up windows. For example, a webpage might use
a pop-up window to request your user name or to display ads.
Blocking pop-up windows stops windows that appear when you open or close a page.
It does not block pop-up windows that open when you click a link.
If you block pop-up windows, you might miss important information for a webpage.
When you visit a website that uses cookies, the site asks Safari to put cookies on your
computer. When you return to the site later, Safari sends back the cookies that belong
to the site. The cookies tell the site who you are, so the site can show you information
that’s appropriate for you.
Cookies store information that identifies you, such as your user ID for a website and
your website preferences. A website has access only to the information you provide.
A website can’t determine your mail address unless you provide it. A website can’t gain
access to other information on your computer.
When you use the default cookie preferences in Safari, you won’t know when Safari is
accepting or sending cookies. You can change your cookies preferences so that Safari
doesn’t accept cookies or so it accepts them only from limited sources.
Advanced Settings
Use the Advanced preference pane to customize Safari for Universal Access, to
customize the appearance of webpages with your own style sheet, and to set proxy
settings. You can select from the following:
 The “Never use font sizes smaller than” option prevents text from getting so small
that you can longer read it.
 The “Press Tab to highlight each item on a webpage” option helps you find all links
and options on a page by highlighting each one in turn when you press the Tab key.
 The Style Sheet pop-up menu lets you customize the appearance of webpages by
selecting a style sheet you’ve created.
 The Proxies option opens the Network panel in System Preferences so you can edit
proxy settings for your current network location.
When you open a quarantined file, the file is also checked for known instances of
malware software. If malware software is discovered, a warning appears. Click the Move
to Trash button to delete the file. If it is a disk image, eject the image and delete the
source file.
You can set up secure iChat messaging using your MobileMe membership. However,
you and your iChat buddy must be MobileMe members and have Mac OS X version
10.4.3 Tiger or later installed. With a MobileMe membership, you can sign up for a
Secure iChat certificate that allows you to enable secure messaging.
Also, if you can’t use MobileMe you can create a certificate using Certificate Assistant.
You can use that certificate to encrypt the iChat AV communication without using a
MobileMe account. For more information about creating a certificate, see “Creating a
Self-Signed Certificate” on page 140.
When you enable iChat encryption, iChat performs a Certificate Signing Request (CSR)
to MobileMe. iChat then receives a certificate, which includes your original public key
and a private key. The public and private key pair is created by the CSR process.
iChat AV Encryption leverages a PKI approach. The public and private asymmetric keys
are derived from the user’s MobileMe identity, which consists of the user’s certificate
and private key. The private key and certificate represent your MobileMe identity. These
keys are used to encrypt content between you and your buddy.
If your organization runs an internal iChat server, the server can use SSL to certify the
identity of the server and establish secure, encrypted data exchange between an iChat
user and the server. Consider only accepting messages from specific people or from
people on your buddy list. This helps prevent information phishing through iChat.
For more information, open iChat Help and search for “security.” For information about
iChat and SSL, see Web Technologies Administration and iChat Server Administration.
iChat AV Security
When you share your screen with an iChat buddy, the buddy has the same access to
your computer that you have. Share your screen only with trusted parties, and be
particularly careful if you receive a request to share your screen from someone who
isn’t on your buddy list.
If the request comes from someone in your Bonjour list, remember that the person’s
name is not necessarily accurate, so his or her identity is uncertain. To prevent
unauthorized users from instant messaging you, you can reject their request to send
you messages.
iChat AV in Mac OS X version 10.4.3 Tiger and later encrypts all communications
between MobileMe members and certificate users. Text messages, audio chats, video
conferences, and file transfers are secured using robust 128-bit encryption so that
others can’t eavesdrop on your communications.
If you have an active MobileMe account, you can set up iChat to encrypt
communications when you chat, conference, or send files to other MobileMe members
who have set up iChat encryption.
Enabling Privacy
To prevent messages temporarily, set your status to Offline or Invisible, or log out by
choosing iChat > Log Out.
You can also specify that messages from specific people be blocked or allowed. Blocked
people can’t send you messages or see when you are online.
If you select “Allow specific people,” click the Edit List button, click the Add (+) button,
and then enter the names or IDs for those you want to allow. Anyone not added to the
list is blocked.
If you select “Block specific people,” click the Edit List button, click the Add (+) button,
and then enter the names or IDs for those you want to block. Anyone not on the list is
allowed.
To quickly add a person to the list of blocked people, click the Block button that
appears in the message window when you get a message from that person.
Free trial MobileMe memberships are not eligible for secure messaging.
3 Click Security and then click Encrypt.
As part of the setup process, you must enter a MobileMe account password. This is the
password you enter if you are using secure messaging on a second computer. This
password must be different from your Snow Leopard password.
When you and your buddy have the MobileMe certificate installed and you start a chat,
a lock icon appears in the upper-right corner of the iChat window. Text, audio, and
video are encrypted on your computer and are not decrypted until they reach your
buddy’s computer.
To view your Secure iChat certificate, open Keychain Access and click My Certificates
in the Categories window. Double-click the certificate that matches your MobileMe
short name.
You can protect your iTunes account from being compromised by using a strong
password. When creating your iTunes password, use Password Assistant to help you
generate a strong password.
Also, you can use the sharing preference of iTunes to share your music with other
network users. When configuring iTunes sharing preference, require that users set a
strong password to access your shared music. You can generate a strong password
using Password Assistant. When you finish sharing your music, turn the iTunes sharing
preference off to keep unauthorized users from attempting to access your shared
iTunes music.
For more information about creating strong passwords, see “Using Password Assistant
to Generate or Analyze Passwords” on page 130.
When delegating privileges, limit the number of people who have editing privileges.
This prevents users from accidently removing contact information. When your address
book is not being used, turn Address book sharing off.
You can protect iDisk data by creating an encrypted disk image that encrypts the data
stored in it. Then you can upload this encrypted disk image to iDisk and know that your
data is protected.
When sharing data on your public folder on iDisk, require users to use a password to
access the data. When creating the password for your public iDisk folder, use Password
Assistant to help you create a strong password.
Your Snow Leopard computer offers many services that can be quickly set up and
configured. Although these services are helpful and easy to configure, they must be
securely configured to prevent unauthorized users from accessing your computer. Most
services can be securely configured by using strong passwords or by turning the
services off when they are not in use.
Firewall Protection
A firewall is software that protects your Mac OS X computer from unauthorized users.
When you turn firewall protection on, it is similar to erecting a wall to limit access to
your computer. The firewall scans incoming network traffic and rejects or accepts these
packets based on rules. You can restrict access to any network service running on your
computer.
You can monitor activity involving your firewall by enabling firewall logging. Firewall
logging creates a log file that tracks activity such as the sources and connection
attempts blocked by the firewall. You can view this log in the Console utility.
183
Snow Leopard includes two firewalls: the Application Firewall and the IPFW firewall. If
you turn on a sharing service, such as file sharing, Mac OS X’s Application Firewall uses
code-signing technology to verify that the program has been signed by Apple and
allows it to use the network.
In addition to the sharing services you turn on in Sharing preferences, the list can
include other services, applications, and programs that are allowed to accept network
connections. An application or program might have requested and been given access
through the firewall, or it might be signed by a trusted certificate and therefore
allowed access.
Important: Some programs have access through the firewall although they don’t
appear in the list. These might include system applications, services, and processes.
They can also include digitally signed programs that are opened by other programs.
You might be able to block these programs’ access through the firewall by adding
them to the list.
To add an application to the list, click Advanced in the Firewall pane of Security
preferences. Then click the Add (+) button at the bottom of the list and select the
application. After the program is added, click the up and down arrows to allow
or block connections through the firewall.
Note: Blocking a program’s access through the firewall might harm the program or
other programs that depend on it, or it might affect the performance of other
applications and services you use.
When the system detects a connection attempt to a program that is not enabled in
Security preferences or is not signed, you are prompted to allow or deny access to the
program.
The Application Firewall makes it easier for users to gain the benefits of firewall
protection and helps prevent undesirable applications from taking control of network
ports that should only be used by legitimate applications.
The firewall applies to TCP and UDP, the Internet protocols most commonly used by
applications. It does not affect AppleTalk. The system can be set to block incoming
ICMP pings by enabling Stealth Mode in Advanced settings.
Earlier IPFW technology is still accessible from the command line (in Terminal), and the
Application Firewall doesn’t override rules set with IPFW. If IPFW blocks an incoming
packet, the Application Firewall does not process it.
When you turn the Application firewall on, the firewall prevents unauthorized
applications and services from accepting incoming connections.
You can also manually set access for specific services and applications by choosing
whether to allow or deny incoming connections for any application on your system.
After you add an application to the list, you can choose whether to allow or deny
incoming connections for that application. You can even add command-line
applications to this list.
When you add an application to this list, Snow Leopard digitally signs the application
(if it is not signed). If the application is later modified, you are prompted to allow or
deny incoming network connections to it. Most applications do not modify themselves.
This is a safety feature that notifies you of the change.
Stealth Mode
Computer hackers scan networks so they can attempt to identify computers to attack.
You can prevent your computer from responding to some of these scans by using
Stealth Mode.
When Stealth Mode is enabled, your computer does not respond to ICMP ping
requests, and does not answer to connection attempts from a closed TCP or UDP port.
This makes it more difficult for attackers to find your computer.
If you run an unsigned application not in the Application firewall list, you must
allow or deny connections for the application using the dialog. If you choose Allow,
Snow Leopard signs the application and adds it to the Application Firewall list. If you
choose Deny, Snow Leopard signs the application, adds it to the Application Firewall
list, and denies the connection.
Some applications check their own integrity when they are run without using
code-signing. If the Application Firewall recognizes the application, it does not sign
the application. Instead, it displays the dialog every time the application runs. To
prevent this dialog from appearing, upgrade to a version of the application that is
signed by its developer.
Some harmful applications can cause problems for your computer. Frequently, a
harmful application tries to appear as an innocent document, such as a movie or
graphic file. These applications, called trojans, are most often spread by Internet
downloads and mail enclosures.
Important: If you receive an application warning and you don’t expect the file to be an
application, don’t open the file. Delete it from your computer.
The firewall scans incoming IP packets and rejects or accepts them based on the set
of filters or rules you create. You can restrict access to any IP service running on your
computer, and you can customize filters for all incoming addresses or for a range of
IP addresses.
IPFW handles packets at a lower level of the networking stack than the Application
firewall. Therefore, its rules take precedence over the Application firewall.
This firewall can be difficult to configure, and can also disrupt network communications
if improperly configured. It requires manually written rules, and the system must be
configured to read those rules at startup.
Configuring IPFW rulesets requires a higher level of expertise than many system
administration tasks. If an administrator is not mindful of the IPFW ruleset on the
system, confusion can arise when some network connectivity is not available that
apparently should be.
This line shows that the default configuration allows all traffic through the IPFW
firewall, performing no filtering. Like all IPFW rules, it consists of a rule number (65535);
an action (allow); and body (ip from any to any). In this case, the body (ip from any to
any) matches all IP packets.
This rule shows the implementation of Stealth Mode: dropping any incoming ping
echo requests, which is ICMP type 8. Because it is a lower rule number (and thus also
appears earlier when listed), it is consulted before the default rule.
Except for Stealth Mode blocking ping requests, the default configuration for IPFW on
Snow Leopard does not block packets. Snow Leopard relies primarily on the
Application firewall to block unwanted network traffic. IPFW can be used to write
complex and powerful rulesets, which make decisions about connectivity based on the
form of the packet.
The Application Firewall, on the other hand, makes decisions about connectivity based
on whether the program trying to use the network is trusted. These two firewall
technologies complement each other.
This section first describes how to enable logging so that debugging is possible. Next,
a simple ruleset is provided, and then ways in which it can be expanded are presented.
The system’s ability to log packets can then be verified with the following command:
$ sudo sysctl net.inet.ip.fw.verbose
If the command returns a 2, logging is enabled for the Application Firewall and IPFW.
The system sends Application Firewall and IPFW log messages to /var/log/
appfirewall.log. These can be viewed using the Console program in /Applications/
Utilities. Implementation of a basic ruleset can proceed, using the log to debug
connectivity failures.
The following basic ruleset is inclusive and also very strict: it allows packets from other
systems only when the host has initiated a connection to another system. This is
appropriate for a client system that offers no network services to other systems.
The following command can be issued to verify that the rules are loaded as expected:
$ sudo /sbin/ipfw print
Testing can commence to determine whether the ruleset is compatible with your
connectivity needs. If modifications are made to the ruleset in the file, the old rules
must be flushed before new rules are inserted.
To flush old rules and re-insert a ruleset from /etc/ipfw.conf, enter the following:
$ sudo /sbin/ipfw flush
$ sudo /sbin/ipfw /etc/ipfw.conf
To verify that the rules in /etc/ipfw.conf are loaded at startup, see “Configuring the
System to Load the IPFW Ruleset” on page 192. Even if DHCP is not used, unconnected
interfaces can create log messages when they attempt to obtain IP settings from the
computer. To eliminate messages, configure the interfaces to “Off” using the Network
preference pane.
Rules should only be added if the system needs to offer the network services discussed.
Not all possible network services are covered here, but rules to allow other services
should be available from other resources.
Add the following rules to allow Bonjour, substituting your local network and netmask
for a.b.c.d/nm:
add 12600 allow udp from a.b.c.d/nm to any dst-port 5353
add 12601 allow udp from a.b.c.d/nm 5353 to any dst-port 1024-65535 in
Add the following rules to allow the Remote Login (SSH) service to be reached,
substituting a.b.c.d/nm for networks you wish to allow:
add 12500 allow tcp from a.b.c.d/nm to any 22
add 12501 allow udp from a.b.c.d/nm to any 22
Add the following rules to allow the system to host File Sharing over AFP, substituting
a.b.c.d/nm for networks you wish to allow:
add 12700 allow tcp from a.b.c.d/nm to any dst-port 548
Add the following rules to allow Web Sharing, substituting a.b.c.d/nm for networks you
wish to allow:
add 14000 allow tcp from a.b.c.d/nm to any dst-port 80
add 14000 allow tcp from a.b.c.d/nm to any dst-port 443
Add the following rules to allow File Sharing over SMB, substituting your local network
and netmask for a.b.c.d/nm:
add 12801 allow udp from a.b.c.d/nm 137,138,139 to me in keep-state
add 12803 allow tcp from a.b.c.d/nm 137,138,139 to me keep-state setup
For example, to deny traffic addressed for the loopback interface but not originating
from it (must be numbered after rule 1000 above):
add 1010 deny all from any to 127.0.0.0/8
To restrict ICMP traffic, you must remove rule 20000 above, which accepts all ICMP
packets, and then choose which types of ICMP packets to allow. Some ICMP types
such as those for message redirection and router solicitation are not typically needed.
Removing rule 20000 and adding the rules above enables Stealth Mode, because ICMP
message of type 8 are implicitly denied (since they are not accepted). However, it may
be necessary to allow ping responses to other systems on the local network but not
from elsewhere. To do so, add a rule as follows, substituting your network/netmask for
a.b.c.d/nm:
add 20010 allow icmp from a.b.c.d/nm to any icmptypes 8 in
Note: If Stealth Mode is enabled using the Security preference pane, the rule here takes
precedence because it has a lower number (20010) than the system applies for Stealth
Mode (33000).
VPN Security
There are three encrypted transport protocols: Layer Two Tunneling Protocol and
Secure Internet Protocol (L2TP/IPSec), Point–to–Point Tunneling Protocol (PPTP), and
Cisco IPSec.
L2TP/IPSec uses strong IPSec encryption to tunnel data to and from network nodes.
It is based on Cisco’s L2F protocol.
The shared secret is not a password for authentication, nor does it generate encryption
keys to establish secure tunnels between nodes. It is a token that the key management
systems use to trust each other.
L2TP is Snow Leopard Server’s preferred VPN protocol because it has superior transport
encryption and can be authenticated using Kerberos.
About PPTP
PPTP is a commonly used Windows standard VPN protocol. PPTP offers good
encryption (if strong passwords are used) and supports a number of authentication
schemes. It uses the user-password to produce an encryption key.
By default, PPTP supports 128-bit (strong) encryption. PPTP also supports the 40-bit
(weak) security encryption.
PPTP is necessary if you have Windows clients with versions earlier than Windows XP
or if you have Mac OS X v10.2 clients or earlier.
L2TP/IPSec and Cisco IPSec provide the highest level of security because they use
IPSec. PPTP does not use IPsec, which makes it less secure.
# -------------------------------------------------------------------
# Securing Network Services
# -------------------------------------------------------------------
# Disabling IKE VPN Key Management Service
# -----------------------------
# Default Setting:
# OFF
# Suggested Setting:
# If a VPN is not used, disable the IKE VPN key management service.
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.racoon.plist
# Available Setting:
# None
For more information about launchctl, see “Understanding and Managing Daemons
and Agents” on page 221.
This easy exchange of information makes service discovery very convenient, but it also
incurs a security risk. Bonjour broadcasts the services that are present and the services
you have available. These risks must be weighed against the utility of running a
network service such as Bonjour.
To reduce the security risk of running Bonjour, connect only to secure, trusted local
networks. Also verify that Network preferences enables only required networking
connections. This reduces the chance of connecting to an insecure network.
Before using Bonjour to connect to a service, verify that the service is legitimate and
not spoofed. If you connect to a spoofed service, you might download malicious files.
If you cannot trust all services on your local network, do not use Bonjour.
3 In the ProgramArguments key of the plist file, add the following string to the
<array>...</array> section.
<string>-NoMulticastAdvertisements</string>
For example:
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/mDNSResponder</string>
<string>-launchd</string>
<string>-NoMulticastAdvertisements</string>
</array>
4 Save the changes to the mDNSResponder.plist file.
Important: If you edited the file using emacs, remove the emacs backup file (the file
with a tilde at the end of the name, “/System/Library/LaunchDaemons/
com.apple.mDNSResponder.plist~”) or your Mac will not start up.
Add the following rule to the /etc/ipfw.conf in the same way that you edited /System/
Library/LaunchDaemons/com.apple.mDNSResponder.plist in the section above.
# Suggested Setting:
# Add the following line to /etc/ipfw.conf.
add 00001 deny udp from any to me dst-port 5353
# Reload the firewall rules.
sudo /sbin/ipfw flush
sudo /sbin/ipfw /etc/ipfw.conf
# Available Settings:
# Disable firewall and allow Bonjour.
# Enable firewall and block port 5353.
If Bonjour is disabled, you must manually configure network printers. Disabling Bonjour
can also disable functionality in other applications that rely on Bonjour or possibly
make them unusable. For example, there might be issues with calendar and address
book sharing, and finding iChat buddies.
If disabling Bonjour interferes with other applications that are needed by the user,
remove the <string>-NoMulticastAdvertisements</string> from the
mDNSResponder.plist file. Then unblock UDP port 5353 on your firewall.
# Suggested Setting:
# Remove the following line from /etc/ipfw.conf.
add 00001 deny udp from any to me dst-port 5353
# Reload the firewall rules
sudo /sbin/ipfw flush
sudo /sbin/ipfw /etc/ipfw.conf
# Available Settings:
# Disable Firewall and allow Bonjour
# Enable Firewall and block port 5353
Some applications can share data such as contact information, photos, and music.
When these application share data, they use Bonjour to let other network users know
what you are sharing. When you share information, use Password Assistant to help you
create a strong password. For information on securing applications that use Bonjour,
see Chapter 8, “Securing Applications.”
By default, BTMM is disabled. Also, the computer cannot be reached until sharing
services are enabled in Sharing preferences. Like any other service, keep BTMM
disabled unless it is required.
Although BTMM provides a way to set up a secure connection, this service introduces
risk, as described in this section. If BTMM is required, its use should be weighed against
the security risks it can introduce.
Note: Using BTMM, you can only connect to computers that are running
Snow Leopard or later.
Additionally, the following best practices must be completed to secure each computer
in your BTMM network:
 Choose a strong password for your MobileMe account. Anyone who knows your
MobileMe password can access all computers in your BTMM network. Therefore,
choose a strong password and keep it safe. Use Password Assistant to help you
create a strong password.
 Consider who has physical access to your computers. Anyone who knows the login
name and password of your computer can potentially access shared services on all
other computers. Set a strong password for your Mac OS X user account in the
Accounts pane of System Preferences.
 Before you disconnect from sharing a screen with a remote computer, lock the
screen on the remote computer.
When sharing these services, make sure your computer has the most current
Apple updates and turn off services you are not using. Also, make sure you set
permissions for each service to prevent access by unauthorized users.
DVD or CD Sharing
You can enable DVD or CD Sharing on a Mac or Windows computer, to use the Remote
Disc feature of MacBook Air, or to share read-only data stored on your DVD or CD. While
your optical disc drive is shared, a user of another computer can view and access data
stored on the DVD or CD in your optical disc drive.
By default, DVD or CD Sharing is turned off and should be off when it is not used. This
prevents unauthorized users from accessing your computer.
# DVD or CD Sharing
# -------------------------
# Default Setting:
# Disabled (unload)
# Suggested Setting:
# Disable DVD or CD Sharing.
sudo launchctl unload -w /System/Library/LaunchDaemons\
com.apple.ODSAgent.plist
# Available Settings:
# Disabled (unload)
# Enabled (load)
By default, Screen Sharing is turned off and should be off when it is not used. This
prevents unauthorized users from accessing to your computer.
The default setting for Screen Sharing should be changed from “All users” to “Only
these users.” The default setting “All users” includes all users on your local computer
and all users in the directory server you are connected to. If you create a sharing user
account, create a strong password using Password Assistant.
You can also enable “VNC viewers may control screen with password” to permit VNC
users to control your screen using a third-party VNC viewer with a password. The VNC
password is different from the user name and password that is required when
attempting to access the computer. Use Password Assistant to create a strong
password.
# Suggested Setting:
# Disable Screen Sharing.
sudo srm /private/etc/ScreenSharing.launchd
# Available Settings:
# Enabled:
# “All Users”
# “Only these users”
File Sharing
When you share files and folder on your computer, you are permitting users to access
the files on your computer. Permitting access requires that you maintain who has
access to your files, the permissions they have, and the protocol used to access these
shared files.
To securely set up File Sharing, you must configure permissions for your users. If you
don’t, you create an access point for a malicious user to access your files and folders.
Depending on your environment, you can share your files using AFP, FTP, or SMB. When
using AFP, user names and passwords are encrypted when the user authenticates to
your computer to access files. When using SMB, passwords are also encrypted when
attempting to authenticate. However, SMB passwords are not securely stored on your
computer.
FTP does not encrypt user names and passwords. This creates a possible way for
unauthorized users to obtain the user name and password and easily access your files.
Avoid using this protocol to share sensitive data. If you must use this protocol, encrypt
your data using a secure encrypted image.
File Sharing is great for sharing files with others if you are in an environment where file
sharing is frequent. Consider setting up a file server to prevent others from accessing
your computer.
By default, File sharing is turned off and should remain off when it is not used. This
prevents unauthorized users from attempting to access your computer.
The default setting for File Sharing should be changed from “All users” to “Only these
users.” The default setting “All users” includes all users on your local computer and all
users in the directory server you are connected to.
You can securely configure File Sharing by restricting access to specific users. You can
also restrict each user’s file permissions for each file you are sharing by using the
triangles next to the user name (No Access, Read & Write, Read Only, or Write Only
(Drop Box)). If you create a sharing user account, create a strong password using
Password Assistant.
If you are sharing files with Windows users, you must use SMB. When you create the
password for users that will use SMB, use Password Assistant to help create a strong
password. The password you enter is not securely stored on the computer.
# Suggested Setting:
# Disable FTP.
sudo launchctl unload -w /System/Library/LaunchDaemons/ftp.plist
# Disable SMB.
sudo defaults delete /Library/Preferences/SystemConfiguration/\
com.apple.smb.server EnabledServices
sudo launchctl unload -w /System/Library/LaunchDaemons/nmbd.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/smbd.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.smb.server.preferences.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.smb.sharepoints.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.smbfs_load_kext.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
org.samba.winbindd.plist
# Disable AFP.
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.AppleFileServer.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.afpfs_afpLoad.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.afpfs_checkafp.plist
# Disable NFS
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.nfsd.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.lockd.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.statd.notify.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.portmap.plist
# Available Settings:
# Disabled (unload)
# Enabled (load)
Scanner Sharing
Sharing allows users on other computers to access scanners connected to your
computer. Make sure this service remains disabled unless it is necessary. If it is
necessary, consider using dedicated scanner computers instead of sharing a scanner
from your computer. By using a dedicated scanner computer, you won’t have scanner
traffic routed through your computer.
Web Sharing
Two websites are available for users to view.
Users can only view the following website located in /shortname/Sites folder if you are
logged in on the computer:
http://your.computer.address/~yourusername/
By using Web Sharing, you expose your login user name (short name). This can give
hackers the ability to gain information about your computer.
http://your.computer.address
# Web Sharing
# -----------------------------
# Default Setting:
# Web Services: Disabled
# Suggested Setting:
# Disable Web Sharing.
sudo launchctl unload -w /System/Library/LaunchDaemons/
org.apache.httpd.plist
# Available Settings:
# Web Services:
# Disabled
# Enabled
The following table lists tools enabled with Remote Login, and their insecure
counterparts.
For more information about securing SSH, see “Enabling an SSH Connection” on
page 206.
By default, Remote Login is turned off and should remain off when it is not used. This
prevents unauthorized users from accessing your computer.
# Suggested Setting:
# Disable Remote Login.
sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist
# Available Settings:
# Remote Login (SSH):
# Disabled
# Enabled
To establish a secure SSH connection, verify that the client is receiving a valid
fingerprint from the server. Fingerprints help determine the authenticity of the
connection because they prove that the intended server, and not a rogue server, is
receiving SSH requests from the client.
With key-based authentication, the client and server have public and private keys. The
two computers exchange public keys. When the computers communicate with each
other, they send data that is encrypted based on the other computer’s public key.
When a computer receives encrypted data, it can decrypt the data based on its private
key.
To perform this task, enable an SSH connection. For information, see “Enabling an SSH
Connection” on page 206.
If the server uses FileVault to encrypt the home folder of the user you want to use SSH
to connect as, you must be logged in on the server to use SSH. Alternatively, you can
store the keys for the user in a location that is not protected by FileVault. However, this
is not secure.
11 Authenticate, if requested.
12 On the client, edit the following lines:
13 On the client, test the SSH connection by entering the following command:
$ ssh username@ipaddress_or_hostname
Replace username with the name of a user on the server.
Replace ipaddress_or_hostname with the IP address or host name of the server.
When you connect to a host using the IP address, entries are created in the
ssh_known_hosts file. If you connect to the same host using its host name, a separate
entry is created in the ssh_known_host file because each connection is treated as a
unique connection.
If successful, you are prompted to enter your passphrase for the key.
3 Use SSH to connect to every server you want to allow access to by entering the
following command for each server:
$ ssh username@ipaddress_or_hostname
Replace username with the name of a user on the server.
Replace ipaddress_or_hostname with the IP address or host name of the server.
When you connect to a host using the IP address, entries are created in the
ssh_known_hosts file. If you connect to the same host using its host name, a separate
entry is created in the ssh_known_hosts file because each connection is treated as a
unique connection.
6 Authenticate, if requested.
Because ssh_known_hosts is located in /etc/, users can’t modify this file unless they
have administrator access.
7 Enter the following command:
$ srm ~/.ssh/known_hosts
After you remove ~/.ssh/known_hosts, your computer will only connect to servers
listed in /etc/ssh_known_hosts unless the user accepts the warning prompt.
Many organizations only allow connection though a single port on the firewall to
enhance network security. By using SSH tunneling, you can connect through a single
port on a firewall and access a computer on the network.
This is important for computers on the network that are not configured for secure
encrypted communication. SSH tunneling encrypts the data between the computer
and the firewall, securing the data transmitted over an insecure network (such as the
Internet).
port 22 open
Anne Johnson’s
computer AFP server
Encrypted SSH Tunnel Internet
Enter the address localhost:2501 and the RemoteAFPAccount username and password.
The ssh configuration file has connection options and other specifications for a specific
ssh host. A host is specified by the Host declaration. By default, the Host declaration is
an asterisk (“*”) indicating any host you are connecting to will use the options listed
below the Host declaration.
For example, if you are connecting to a server using ssh through the Internet, the
server might require a more secure or stricter connection options. However, if you are
in a more secure environment, such as your own personal network, you might not
need such strict connection options.
For more information about ssh configuration file options, see the ssh man pages.
If the server uses FileVault to encrypt the home folder of the user you want to use SSH
to connect as, you must be logged in on the server to use SSH. Alternatively, you can
store the keys for the user in a location that is not protected by FileVault. However, this
is not secure.
2 When prompted, enter a filename to save the keys in the user’s folder.
3 Enter a password followed by password verification (empty for no password).
For example:
Generating public/private dsa key pair.
Enter file to save the key in (/Users/anne/.ssh/id_dsa): frog
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in frog.
Your public key has been saved in frog.pub.
The key fingerprint is:
4a:5c:6e:9f:3e:35:8b:e5:c9:5a:ac:00:e6:b8:d7:96 annejohnson1@mac.com
This creates two files. Your identification or private key is saved in one file (frog in our
example) and your public key is saved in the other (frog.pub in our example). The key
fingerprint, derived cryptographically from the public key value, is also displayed. This
secures the public key, making it computationally infeasible for duplication.
The location of the server SSH key is /etc/ssh_host_key.pub. Back up your key in case
you need to reinstall your server software. If your server software is reinstalled, you can
retain the server identity by putting the key back in its folder.
4 Copy the resulting public file, which contains the local computer’s public key, to the
.ssh/ folder in the user’s home folder on the remote computer.
The next time you log in to the remote computer from the local computer, you won’t
need to enter a password (unless you entered one in step 3 above).
If you are using an Open Directory user account and you have logged in using the
account, you do not need to supply a password for SSH login. On Snow Leopard Server
computers, SSH uses Kerberos for single sign-on authentication with any user account
that has an Open Directory password (but Kerberos must be running on the Open
Directory server). For more information, see Open Directory Administrator.
Be sure this is the correct key before accepting it. If at all possible, provide your users
with the encryption key through FTP, mail, or a download from the web, so they can
verify the identity of the server.
If you later see a warning message about a man-in-the-middle attack when you try to
connect, the key on the remote computer might no longer match the key on the local
computer. This can happen if you:
 Change your SSH configuration on the local or remote computer.
 Perform a clean installation of the server software on the computer you are logging
in to using SSH.
 Start up from a Snow Leopard Server CD on the computer you are logging in to
using SSH.
 Attempt to use SSH to log in to a computer that has the same IP address as a
computer that you previously used SSH with on another network.
To connect again, delete the entries corresponding to the remote computer you are
accessing (which can be stored by both name and IP address) in ~/.ssh/known_hosts.
An ARD manager with full privileges can run these tasks as the root user. By limiting
the privileges that an ARD manager has, you can increase security. When setting
privileges, disable or limit an administrator’s access to an ARD client.
You can set a VNC password that requires authorized users to use a password to access
your computer. The most secure way is to require authorized users to request
permission to access your computer screen.
ARD is turned off by default and should remain off when it is not being used. This
prevents unauthorized users from attempting to access your computer.
The default setting for remote management should be changed from “All users” to
“Only these users.” The default setting “All users” includes all users on your local
computer and all users in the directory server you are connected to.
Any account using ARD should have limited privileges to prevent remote users from
having full control of your computer.
You can securely configure ARD by restricting access to specific users. You can also
restrict each user’s privileges by setting ARD options. Limit the user’s privileges to the
user’s permission on the computer. For example, don’t give a standard user the ability
to change settings or delete items.
You can also securely configure computer settings for remote management. If users
connect to your computer using VNC, require that they use a password by enabling
“VNC viewer may control screen with password.” Use Password Assistant to create a
strong password for VNC users.
# Suggested Setting:
# Disable Remote Management.
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/\
Resources/kickstart -deactivate -stop
# Available Settings:
# Remote Management:
# Disabled
# Enabled
# Suggested Setting:
# Disable Remote Apple Events.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.eppc.plist
# Available Settings:
# Remote Apple Events:
# Disabled
# Enabled
When securely configuring RAE, restrict remote events to only be accepted from
specific users. This prevents unauthorized users from sending malicious events to your
computer. If you create a sharing user account, create a strong password using
Password Assistant. Avoid accepting events from Mac OS 9 computers. If you need to
accept Mac OS 9 events, use Password Assistant to create a strong password.
Xgrid Sharing
Computers on a network can use Xgrid to work together in a grid to process a job. Your
computer can join the grid as an Xgrid client or as an Xgrid agent. A client submits jobs
to the grid and an agent processes jobs received from an Xgrid controller. A controller
is a server that receives jobs from clients and distributes jobs to agents.
By default, Xgrid Sharing is turned off and should remain off when it is not used. This
prevents unauthorized users from accessing your computer.
Although your computer can use Bonjour to discover controllers on the local network,
when you specify a controller you help ensure that your computer connects to the
intended Xgrid controller and not a malicious controller.
It is still possible for a malicious controller to spoof a legitimate controller’s DNS and
IP address, but choosing a specific controller prevents trivial attacks.
Malicious controllers can make agents run malicious software, create network
connections, and possibly crash your computer. Similarly, clients or controllers that lack
authentication might find their jobs (and sensitive data they contain) hijacked by
malicious agents.
# Xgrid Sharing
# -----------------------------
# Default Setting:
# Xgrid Sharing: Disabled
# Suggested Setting:
# Disable Xgrid Sharing.
sudo launchctl unload -w /System/Library/Daemons/com.apple.xgridagentd
sudo launchctl unload -w /System/Library/Daemons/com.apple.xgridcontrollerd
# Available Settings:
# Xgrid Sharing:
# Disabled
# Enabled
By default, Internet Sharing is turned off and should remain off when it is not used. This
prevents unauthorized users from accessing your computer.
# Internet Sharing
# -----------------------------
# Default Setting:
# Internet Sharing: Disabled
# Suggested Setting:
# Disable Internet Sharing.
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat
NAT -dict Enabled -int 0
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.InternetSharing.plist
# Available Settings:
# Internet Sharing:
# Disabled
# Enabled
When configuring AirPort options to secure Internet Sharing, choose a channel from
the channel pop-up menu and enable encryption using WEP.
Use a strong password for the connection, use Password Assistant to help you create a
strong password, and set the WEP key length to 128 bit.
When you finish sharing your Internet connection, turn the service off.
You can control how your computer handles files that are exchanged between
Bluetooth devices. You can choose to accept or refuse files sent to your computer and
choose which folder other devices can browse.
By default, Bluetooth Sharing is turned off and should remain off when it is not used.
This prevents unauthorized users from accessing your computer.
Bluetooth options should always require pairing and be set to “Ask What to Do” when
receiving or sharing items.
In the advanced section of Bluetooth preferences, make sure that “Allow Bluetooth
devices to wake this computer” and “Share my internet connection with other
Bluetooth devices” are not selected.
# Bluetooth Sharing
# -----------------------------
# Default Setting:
# Bluetooth Sharing: Disabled
# Suggested Setting:
# Disable Bluetooth Sharing.
sudo defaults -currentHost write com.apple.bluetooth PrefKeyServicesEnabled
0
# Available Settings:
# Bluetooth Sharing:
# Disabled
# Enabled
Snow Leopard uses a process called launchd to manage daemons and agents. The
launchd process is responsible for loading and unloading daemons and agents, and it
manages communication between them and the applications or devices they provide
services to. You can use the launchctl command line program to instruct launchd on
how to control daemons and agents.
Daemons are programs that run in the background as part of the overall system (that
is, they are not tied to a particular user). To see a list of the daemons managed by
launchd, run the following command:
$ sudo launchctl list
Agents are programs that run in the background on behalf of a user, to provide
services to that user. To see a list of the agents managed by launchd for you (since you
are the current user), run the following command:
$ launchctl list
In the lists generated by the commands above, the first column shows a process ID
number if the daemon or agent is running when the launchctl command is run, or it
shows a hyphen (-). A major feature of launchd is its ability to run daemons or agents
only when their services are necessary, in response to a direct need for their services.
Daemons and agents that are not running can be activated by launchd as needed.
The following table lists the folders where launchd reads these configuration files, and
the type of configuration file found in each folder.
For example, to disable the daemon that provides Bluetooth service, use the following
command:
$ sudo launchctl unload -w /System/Library/LaunchDaemons/
com.apple.blued.plist
The sudo command is not needed when disabling an agent for the current user.
A user’s id number can be found using the id program. For example, the user with id
501 stores an overrides.plist file in /var/db/launchd.db/com.apple.launchd.peruser.501/
overrides.plist. These overrides.plist files make it easy to identify daemons or agents
that are disabled so they can be reenabled later if necessary.
# Suggested Setting:
# Turn off AirPort Services using the following commands. Run the last
# command as the current user.
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.airportPrefsUpdater.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.AirPort.wps.plist
launchctl unload -w /System/Library/LaunchAgents/com.apple.airportd.plist
# Turn off remote control service using the following command:
launchctl unload -w /System/Library/LaunchAgents/com.apple.RemoteUI
# Turn off Screen Sharing services.
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.RFBEventHelper.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.RFBRegisterMDNS_RemoteManagement.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.RFBRegisterMDNS_ScreenSharing.plist
launchctl unload -w /System/Library/LaunchAgents/\
com.apple.ScreenSharing.plist
# Turn off Remote Management service using the following commands:
sudo launchctl unload -w /System/Library/LaunchAgents/\
com.apple.RemoteDesktop.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.RemoteDesktop.PrivilegeProxy.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.RFBEventHelper.plist
# Turn off Bluetooth service using the following command:
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.blued.plist
# Available Settings:
# Disabled (unload)
# Enabled (load)
Actions can be successfully performed only when the user has acquired the rights to
do so.
The following is an extract from the policy database installed on your system.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC ...>
<plist version="1.0">
<dict>
...
225
<key>rights</key>
<dict>
<key></key>
<dict>
<key>class</key>
<string>rule</string>
<key>comment</key>
<string>Matches otherwise unmatched rights (i.e., is a default).</
string>
<key>rule</key>
<string>default</string>
</dict>
<key>system.device.dvd.setregion.initial</key>
<dict>
<key>class</key>
<string>user</string>
<key>comment</key>
<string>Used by the DVD player to set the region code the first
time. Changing the region code after it is set requires a different
right (system.device.dvd.setregion.change).</string>
<key>group</key>
<string>admin</string>
<key>shared</key>
<true/>
</dict>
...
<key>config.add.</key>
<dict>
<key>class</key>
<string>allow</string>
<key>comment</key>
<string>Wildcard right for adding rights. Anyone is allowed to add
any (non-wildcard) rights.</string>
</dict>
...
In this extract from the policy database, there are three rights:
 The right specification with an empty key string is known as the default right
specification. To obtain this right a user must satisfy the default rule which, by default
on current versions of Mac OS X, is to prove that they are an administrator.
 system.device.dvd.setregion.initial controls whether the user can set the initial
region code for the DVD drive. By default, a user must prove that they are an
administrator (in group admin) to set the DVD region.
After it has found the relevant right specification, Authorization Services evaluates the
specification to decide whether to grant the right.
In some cases this is easy. For example, in the extract from the policy database above,
config.add. is always granted.
In other cases it can be more complex. For example, setting the DVD region requires
that you enter an administrator password.
There are specific rules in the policy database for Snow Leopard applications. There is
also a generic rule in the policy database that the Security Server uses for any right that
doesn’t have a specific rule.
The right always matches the generic rule unless a rule is added to the policy database.
To lock out all privileged operations not explicitly allowed, change the generic rule by
setting the timeout attribute to 0.
To allow all privileged operations after the user is authorized, remove the timeout
attribute from the generic rule.
To prevent applications from sharing rights, set the shared attribute to false.
To require users to authenticate as a member of the staff group instead of the admin
group, set the group attribute to staff.
If no wildcard key matches, the Security Server uses the generic rule.
The Security Server requests authentication from the user. The user provides a user
name and password to authenticate as a member of the group admin. The Security
Server creates a credential based on the user authentication and the right requested.
The credential specifies that other applications can use it, and the Security Server sets
the expiration to five minutes.
Three minutes later, a child process of the application starts. The child process requests
the right com.myOrganization.myProduct.transcripts.create.
The Security Server finds the credential, sees that it allows sharing, and uses the right.
Two and a half minutes later, the same child process requests the right
com.myOrganization.myProduct.transcripts.create again, but the right has expired.
The Security Server begins the process of creating a credential by consulting the policy
database and requesting user authentication.
The default setting creates a possible point of attack, because the more users you have
in the admin group the more you depend on those users to protect their user names
and passwords.
The authenticate-session-owner rule (shown below) permits only the session owner to
authenticate and unlock the screen saver.
<key>authenticate-session-owner</key>
<dict>
<key>class</key>
<string>user</string>
<key>comment</key>
<string>authenticate session owner</string>
<key>session-owner</key>
<true/>
</dict>
By reviewing audits and logs, you can stop login attempts from unauthorized users or
computers and further protect your configuration settings.
Validating a file’s integrity is also important because when downloading files over an
insecure network the files are vulnerable to attack. Your files can be intercepted and
modified by an attacker who is monitoring the insecure website activity.
For example, if you are downloading a file or program from a website that is not using
SSL, your files can be intercepted and modified to become a security threat to your
computer.
To prevent this, compare the checksum (MD5, SHA-1, or SHA-256/512 hash) value of the
file you download with the original checksum value of the file, which is usually posted
on the website you are downloading from.
The checksum value is a 128-bit value generated from the file you are downloading,
which is like a fingerprint of the file. This value is unique to the file, and as long as the
file is not modified, it always generates the same checksum value. The checksum value
is generally posted on the website to use as a comparison. Only trust checksum values
that are on a website that is accessed over SSL.
After you download the file, run one of the following commands on the file to generate
the checksum value. The source of the file will specify which type of checksum it is:
$ md5 file_name
$ /usr/bin/openssl sha1 file_name
Then compare the checksum value you generated with the published checksum value.
If the values are the same, the file has not been modified and is safe to use. If the
values differ, the file has been modified or corrupted and should not be trusted. Delete
the file and try downloading it again.
Snow Leopard provides the checksum tools necessary for checking file validity;
however, other third-party tools are available for verifying file integrity.
Depending on the file integrity tool you choose, you can use advanced features such as
the ability to reverse file system changes or to receive detailed logs in various formats.
File integrity tools are generally hosted on a server that can be securely accessed. The
server retrieves logs from clients and stores baseline configuration databases and
configuration data.
For more information about checksums and file hashing, see “Verifying the Integrity of
Software” on page 40.
However, digital signatures go beyond traditional signatures because they can also
ensure that the data itself has not been altered. This is like designing a check in such
a way that if someone alters the amount of the sum written on the check, an “Invalid”
watermark becomes visible on the face of the check.
To create a digital signature, the signer generates a message digest of the data
and then uses a private key to sign the digest. The signer must have a valid digital
certificate containing the public key that corresponds to the private key. The
combination of a certificate and related private key is called an identity.
The signature includes the signed digest and information about the signer’s digital
certificate. The certificate includes the public key and the algorithm needed to verify
the signature.
To verify that the signed document has not been altered, the recipient uses the
algorithm to create a message digest and applies the public key to the signed digest.
If the two digests prove identical, the message was not altered and was sent by the
owner of the public key.
To ensure that the person who provided the signature is not only the same person
who provided the data but is also who they say they are, the certificate is also signed
—in this case by the certification authority (CA) who issued the certificate.
This command verifies that the code binaries at code-path are signed, that the
signature is valid, that sealed components are unaltered, and that the bundle passes
basic consistency checks. It does not by default verify that the code satisfies any
requirements except its own designated requirement.
To inspect a specific requirement, use the -R option. For example, to verify that
the Apple Mail application is identified as Mail, signed by Apple, and secured with
Apple’s root signing certificate, use the following command:
$ codesign -v -R="identifier com.apple.mail and anchor apple"
/Applications/Mail.app
If all codes verify properly as requested, codesign exits. Unlike the -r option, the -R
option takes only a single requirement rather than a requirements collection (no =>
tags). Add additional -v options to get details on the validation process.
For more information about signing and verifying application bundle signatures, see
the Code Signing Guide at developer.apple.com/documentation/Security/Conceptual/
CodeSigningGuide. For more information about the codesign command, see its man
page.
If you pass a number rather than a path to the verify option, codesign takes the
number to be the process ID (pid) of a running process, and performs dynamic
validation instead.
Depending on tool configurations and your computer’s activity, running these tools
can use large amounts of disk space. Additionally, these tools are only effective when
other users don’t have administrator access. Users with administrator access can edit
logs generated by the tool and circumvent the tool.
If your computer contains sensitive data, consider using auditing and logging tools. By
using both types of tools, you can properly research and analyze intrusion attempts
and changes in your computer’s behavior.
You configure these tools to meet your organization’s needs, and then change their
logging settings to create relevant information for review or archiving.
If an unexpected error occurs, you can analyze logs to help determine the cause of the
error. For example, logs might explain why a software update can’t be installed, or why
you can’t authenticate.
Logging tools can be useful if you have multiple users who can access the sudo
command. You can view logs to see what users did using the sudo command.
Because some sudo commands perform additional actions that are not logged, limit
the sudo commands that users can use. For more information, see “Securing the System
Administrator Account” on page 125.
Use Console to view and maintain log files. Console is located in the /Applications/
Utilities/ folder. Upon starting, the Console window shows the console.log file. Click
Logs to display a pane that shows other log files on the system in a tree view. The tree
includes folders for services such as web and mail server software.
Mac OS X log files are handled by the BSD subsystem or by a specific application. The
BSD subsystem handles most important system logging, while some applications
handle their own logging.
Like other BSD systems, Mac OS X uses a background process called syslogd to handle
logging. A fundamental decision to make when configuring syslogd is whether to use
local or remote logging. In local logging, log messages are stored on the hard disk. In
remote logging, log messages are stored on a dedicated log server.
Configuring syslogd
The configuration file for the system logging process syslogd is /etc/syslog.conf. For
information about configuring this file, issue the command man syslog.conf in a
Terminal window.
Each line of /etc/syslog.conf consists of text containing the following types of data.
 Facilities are categories of log messages. Standard facilities include mail, news, user,
and kern (kernel).
 Priorities deal with the urgency of the message. In order from least to most critical,
they are as follows: debug, info, notice, warning, err, crit, alert, and emerg. The
priority of the log message is set by the application sending it, not syslogd.
 An action specifies what to do with the log message of a facility and priority.
Messages can be sent to files, named pipes, devices, or remote hosts.
The following sample line specifies that for any log messages in the category “mail”
with a priority of “emerg” or higher, the message is written to the /var/log/mail.log file:
mail.emerg /var/log/mail.log
The facility and priority are separated by a period, and these are separated from the
action by tabs. You can use wildcards (“*”) in the configuration file. The following
sample line logs messages of any facility or priority to the file /var/log/all.log:
*.* /var/log/all.log
Rotation entails compressing the current log file, incrementing the integer in the
filename of compressed log files, and creating a log file for new messages.
The following table describes the rotation process after two rotations.
Files before rotation Files after first rotation File after second rotation
system.log system.log system.log
mail.log mail.log mail.log
mail.log.1.gz mail.log.1.gz
system.log.1.gz system.log.1.gz
Log files are rotated by a launchd job, and the rotation occurs if the computer is on
when the job is scheduled. By default, log rotation tasks are scheduled between
midnight and 1 in the morning, to be as unobtrusive as possible to users. If the system
will not be powered on at this time, adjust the settings in /etc/newsyslog.conf.
For information about editing the /etc/newsyslog.conf file, issue the man 5
newsyslog.conf command in a Terminal window.
When deciding whether to use remote logging, consider the following issues. If these
issues outweigh the benefits of remote logging, don’t use remote logging.
 The syslog process sends log messages in the clear, which could expose sensitive
information.
 Too many log messages will fill storage space on the logging system, rendering
further logging impossible.
 Log files can indicate suspicious activity only if a baseline of normal activity is
established and if the logs are monitored for such activity.
The following instructions assume a remote log server exists on the network.
Security Auditing
The audit subsystem allows authorized administrators to create, read, and delete audit
information. The audit subsystem creates a log of auditable events and allows the
administrator to read audit information from the records in a manner suitable for
interpretation.
The default location for these files is the /var/audit/ folder. The audit subsystem is
controlled by the audit utility located in the /usr/sbin/ folder. This utility transitions the
system in and out of audit operation.
This log was created on March 22, 2004 at 18:31:33 and was terminated on March 22,
2004 at 18:44:43.
The audit subsystem appends records to only one audit log file at a time. The active file
has a suffix “.not_terminated” instead of a date and time.
Audit log files are stored in the folders specified in the audit_control file. The audit
subsystem creates an audit log file in the first folder specified.
By using praudit -l option, each record prints on its own line. For example:
praudit -l /var/audit/20040322183133.20040322184443
For more information about other options, see the praudit man page.
The auditreduce command provides the ability to search audit records for specific
events, users, or times. The following command selects records associated with the
effective user root:
auditreduce -e root /var/audit/20040322183133.20040322184443
For more examples and information, see the auditreduce man page.
When less than the minfree amount of disk space is available on the volume containing
the audit log file, the audit subsystem:
1 Issues an audit_warn soft warning.
2 Terminates the current audit log file.
3 Creates a new audit log file in the next specified folder.
After all specified folders have exceeded this minfree limit, auditing resumes in the first
folder again. However, if that folder is full, an auditing subsystem failure can occur.
You can terminate the current audit log file and create one manually using the audit
utility. This action is commonly referred to as “rotating the audit logs.”
Use audit -n to rotate the current log file. Use audit -s to force the audit subsystem to
reload its settings from the audit_control file (which also rotates the current log file).
The full list of possible audit event classes can be found in /etc/security/audit_class
and the full list of events and their mappings to system calls and other actions can be
found in /etc/security/audit_event. For more information, see the man pages for
audit_control and audit_event.
To add events for a user, edit /etc/security/audit_user instead and use the following
format:
username:eventclass1,eventclass2
In addition to using antivirus tools, follow computer usage habits that avoid virus
infection. For example, don’t download or open content you didn’t request, and never
open a file sent to you by someone you don’t know. For more information about
securely using mail, see “Setting Mail Security” on page 165.
When you use antivirus tools, make sure you have the latest virus definition files. The
protection provided by antivirus tool depends on the quality of your virus definition
files. If your antivirus program supports it, enable automatic downloading of virus
definitions.
For a list of antivirus tools, see the Macintosh Products Guide at guide.apple.com.
You can customize these checklists to suit your needs. For example, you can mark the
completion status of action items in the “Completed?” column. If you deviate from the
suggested action item, use the “Notes” column to justify or clarify your deviation.
240
Action Item Completed? Notes
Turn off Auto-login
Use an internal Software Update
server
Update system software using
verified packages
Repair disk permissions after
installing software or software
updates
# Suggested Settings:
# Specify the software update server to use.
sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL
http://swupdate.apple.com:8088/index-leopard-snowleopard.merged-
1.sucatalog
# Available Settings:
# Replace swupdate.apple.com with the fully qualified domain name (FQDN)
# or IP address of your software update server.
# Suggested Settings:
# Download and install software updates.
sudo softwareupdate --download --all --install
247
# Available Settings:
# Use the following commands to view softwareupdate options:
# $ softwareupdate -h
# or
# $ man softwareupdate
# Suggested Settings:
# Download software updates.
sudo softwareupdate --download --all
# Install software updates.
sudo installer -pkg $Package_Path -target /Volumes/$Target_Volume
# Available Settings:
# Use the following commands to view installer options:
# $ installer -h
# or
# $ man installer
# Suggested Settings:
# Use the sha1 command to display a file’s SHA-1 digest.
# Replace $full_path_filename with the full path filename of the update
# package or image that SHA-1 digest is being checked for.
sudo /usr/bin/openssl sha1 $full_path_filename
# Available Settings:
# Use the following command to view the version of OpenSSl installed on
# your computer:
# $ openssl version
# Use the following command to view openssl options:
# $ man openssl
# Suggested Setting:
# Verify disk permissions
sudo diskutil verify Permissions /Volumes/$Target_Boot_Drive
# If permission discrepancies exist that were not set by your
# organizations, use the following Repair disk permissions command:
sudo diskutil repairPermissions /Volumes/$Target_Boot_Drive
# Available Setting:
# Use the following command to view diskutil options:
# $ diskutil
# -------------------------------------------------------------------
# Securing System Hardware
# -------------------------------------------------------------------
# Removing Wi-Fi Support Software
# -------------------------
# Default setting:
# kext files are installed and loaded.
# Suggested Setting:
# Remove Apple AirPort kernel extensions.
sudo srm -rf /System/Library/Extensions/IO80211Family.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
# Removing BlueTooth Support Software
# -----------------------------
# Default setting:
# kext files are installed and loaded.
# Suggested Setting:
# Remove Bluetooth kernel extensions.
sudo srm -rf /System/Library/Extensions/IOBluetoothFamily.kext
sudo srm -rf /System/Library/Extensions/IOBluetoothHIDDriver.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
# Suggested Setting:
# Remove IR kernel extensions.
sudo srm -rf /System/Library/Extensions/AppleIRController.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
# Suggested Setting:
# Remove Audio Recording kernel extensions.
sudo srm -rf /System/Library/Extensions/AppleUSBAudio.kext
sudo srm -rf /System/Library/Extensions/IOAudioFamily.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
# Suggested Setting:
# Remove Video Recording kernel extensions.
# Remove external iSight camera.
sudo srm -rf /System/Library/Extensions/Apple_iSight.kext
# Remove internal iSight camera.
sudo srm -rf /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/\
AppleUSBVideoSupport.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
# Suggested Setting:
sudo srm -rf /System/Library/Extensions/IOUSBMassStorageClass.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
# Securing FireWire Support Software
# -----------------------------
# Default setting:
# kext files are installed and loaded.
# Suggested Setting:
# Remove FireWire kernel extensions.
sudo srm -rf /System/Library/Extensions/\
IOFireWireSerialBusProtocolTransport.kext
# Remove Extensions cache files.
sudo touch /System/Library/Extensions
# Available Settings:
# None
# Suggested Setting:
# Secure startup by setting security-mode. Replace $mode-value with
# “command” or “full.”
sudo nvram security-mode=”$mode-value”
# Verify security-mode setting.
sudo nvram -x -p
# -------------------------------------------------------------------
# Securing System Preferences
# -------------------------------------------------------------------
# Securing MobileMe Preferences
# -------------------------
# Default Setting:
# If a MobileMe account is entered during setup, MobileMe is configured
# for that account.
# Use the following command to display current MobileMe settings:
# $ defaults -currentHost read com.apple.<Preferenceidentifier>
# Use the following command to view all current settings for currenHost:
# $ defaults -currentHost read
# Suggested Setting:
#Disable Sync options.
sudo defaults -currentHost write com.apple.DotMacSync ShouldSyncWithServer 1
# Disable iDisk Syncing.
sudo defaults -currentHost write com.apple.idisk $USER_MirrorEnabled -bool
no
# Available Settings:
# None
# Suggested Setting:
# Disable display of recent applications.
sudo defaults write com.apple.recentitems Applications -dict MaxAmount 0
# Available Settings:
# MaxAmount 0,5,10,15,20,30,50
# Suggested Setting:
# Turn Bluetooth off.
sudo defaults write /Library/Preferences/com.apple.Bluetooth\
ControllerPowerState -int 0
# Available Settings:
# 0 (OFF) or 1 (On)
# Suggested Setting:
# Disable blank CD automatic action.
sudo defaults write /Library/Preferences/com.apple.digihub
com.apple.digihub.blank.cd.appeared -dict action 1
# Disable music CD automatic action.
sudo defaults write /Library/Preferences/com.apple.digihub
com.apple.digihub.cd.music.appeared -dict action 1
# Disable picture CD automatic action.
sudo defaults write /Library/Preferences/com.apple.digihub
com.apple.digihub.cd.picture.appeared -dict action 1
# Disable blank DVD automatic action.
sudo defaults write /Library/Preferences/com.apple.digihub
com.apple.digihub.blank.dvd.appeared -dict action 1
# Disable video DVD automatic action.
sudo defaults write /Library/Preferences/com.apple.digihub
com.apple.digihub.dvd.video.appeared -dict action 1
# Available Settings:
# action 1 = "Ignore"
# action 2 = "Ask what to do"
# action 5 = "Open other application"
# action 6 = "Run script"
# action 100 = "Open Finder"
# action 101 = "Open itunes"
# action 102 = "Open Disk Utility"
# action 105 = "Open DVD Player"
# action 106 = "Open iDVD"
# action 107 = "Open iPhoto"
# action 109 = "Open Front Row"
# Suggested Setting:
# Set the NTP server.
sudo cat >> /etc/ntp.conf << END server time.apple.com END
# Set the date and time.
sudo systemsetup -settimezone $Time_Zone
# Available Settings:
# NTP Server: Any valid NTP server
# Time Zone: /usr/share/zoneinfo
# Suggested Setting:
# Set idle time for screen saver. Replace XX with the idle time in seconds.
sudo defaults -currentHost write com.apple.screensaver idleTime -int XX
# Set host corner to activate screen saver.
sudo defaults write /Library/Preferences/com.apple.dock.wvous-corner_code-
corner -int 5
# Set modifier key to 0 wvous-corner_code-modifier
sudo defaults write /Library/Preferences/com.apple.dock.wvous-corner_code-
modifier -int 0
# Available Settings:
# Corner options:
# wvous-bl-corner (bottom-left)
# wvous-br-corner(bottom-right)
# wvous-tl-corner (top-left)
# wvous-tr-corner (top-right)
# Suggested Setting:
# Automatically hide and show Dock.
sudo defaults write /Library/Preferences/com.apple.dock autohide -bool YES
# Available Settings:
# autohide -bool YES
# autohide -bool NO
# Suggested Setting:
# Disable computer sleep.
sudo pmset -a sleep 0
# Enable hard disk sleep.
sudo pmset -a disksleep 1
# Disable Wake for Ethernet network administrator access.
sudo pmset -a womp 0
# Disable Restart automatically after power failure.
sudo pmset -a autorestart 0
# Available Settings:
# 0 (OFF) or 1 (ON)
# Suggested Setting:
# Disable dashboard.
sudo launchctl unload -w /System/Library/LaunchDaemons/
com.apple.dashboard.advisory.fetch.plist
# Available Settings:
# Enabled or Disabled
# Suggested Setting:
# Disable IPv6.
sudo networksetup -setv6off $interface
# Available Settings:
# The interface value can be AirPort, Bluetooth, Ethernet, or FireWire.
# Suggested Setting:
# Disable the receiving of faxes.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.efax.plist
# Disable printer sharing.
sudo cp /etc/cups/cupsd.conf $TEMP_FILE
if /usr/bin/grep "Port 631" /etc/cups/cupsd.conf
then
usr/bin/sed "/^Port 631.*/s//Listen localhost:631/g" $TEMP_FILE > /etc/
cups/cupsd.conf
else
echo "Printer Sharing not on"
fi
# Available Settings:
# Enabled or Disabled
# Suggested Setting:
# Enable secure virtual memory.
sudo defaults write /Library/Preferences/com.apple.virtualMemory\
UseEncryptedSwap -bool YES
# Suggested Setting:
# Change computer name where $host_name is the name of the computer.
sudo systemsetup -setcomputername $host_name
# Change computer Bonjour host name.
sudo scutil --set LocalHostName $host_name
# Available Setting:
# The host name cannot contain spaces or other non-DNS characters.
# Securing Software Updates Preferences
# -----------------------------
# Default Setting:
# Check for Updates: Enabled
# Check Updates: Weekly
# Suggested Setting:
# Disable check for updates and Download important updates automatically.
sudo softwareupdate --schedule off
# Available Setting:
# Check for Updates: Enabled or Disabled
# Check Updates: Daily, Weekly, Monthly
# Suggested Setting:
# Disable internal microphone or line-in.
# This command does not change the input volume for input devices. It
# only sets the default input device volume to zero.
sudo osascript -e "set volume input volume 0"
# Available Setting:
# Internal microphone or line-in: Enabled or Disabled
# Suggested Setting:
# Disable Speech Recognition.
sudo defaults write
"com.apple.speech.recognition.AppleSpeechRecognition.prefs"
StartSpeakableItems -bool false
# Disable Text to Speech settings.
sudo defaults write "com.apple.speech.synthesis.general.prefs"
TalkingAlertsSpeakTextFlag -bool false
sudo defaults write "com.apple.speech.synthesis.general.prefs"
SpokenNotificationAppActivationFlag -bool false
sudo defaults write "com.apple.speech.synthesis.general.prefs"
SpokenUIUseSpeakingHotKeyFlag -bool false
sudo defaults delete "com.apple.speech.synthesis.general.prefs"
TimeAnnouncementPrefs
# Available Setting:
# Each item can be set to ON or OFF:
# OFF: -bool false
# ON: -bool true
# Suggested Setting:
# Disable Spotlight for a volume and erase its current meta data, where
# $volumename is the name of the volume.
sudo mdutil -E -i off $volumename
# Available Setting:
# Spotlight can be turned ON or OFF for each volume.
# Suggested Setting:
# Set startup disk.
sudo systemsetup -setstartupdisk $path
# Suggested Setting:
# Enable Time Machine.
sudo defaults write /Library/Preferences/com.apple.TimeMachine AutoBackup 1
# Available Setting:
# 0 (OFF) or 1 (ON)
# Suggested Setting:
# Disable VoiceOver service.
launchctl unload -w /System/Library/LaunchAgents/com.apple.VoiceOver.plist
launchctl unload -w /System/Library/LaunchAgents/\
com.apple.ScreenReaderUIServer.plist
launchctl unload -w /System/Library/LaunchAgents/com.apple.scrod.plist
# Available Setting:
# None
# -------------------------------------------------------------------
# Securing Applications
# -------------------------------------------------------------------
# Disabling iSync
# -----------------------------
# Default Setting:
# OFF
# Suggested Setting:
# Disable iSync.
launchctl unload -w /System/Library/LaunchAgents/\
com.apple.syncservices.SyncServer.plist
launchctl unload -w /System/Library/LaunchAgents/\
com.apple.syncservices.uihandler.plist
# Available Setting:
# None
# Suggested Setting:
# If a VPN is not used, disable the IKE VPN key management service.
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.racoon.plist
# Available Setting:
# None
# Suggested Setting:
# Reload the firewall rules.
sudo /sbin/ipfw flush
# Available Settings:
# Disable firewall and allow Bonjour.
# Enable firewall and block port 5353.
# Suggested Setting:
# Remove the following line from /etc/ipfw.conf.
add 00001 deny udp from any to me dst-port 5353
# Reload the firewall rules
sudo /sbin/ipfw flush
# Available Settings:
# Disable Firewall and allow Bonjour
# Enable Firewall and block port 5353
# Suggested Setting:
# Disable DVD or CD Sharing.
sudo launchctl unload -w /System/Library/LaunchDaemons\
com.apple.ODSAgent.plist
# Available Settings:
# Disabled (unload)
# Enabled (load)
# Suggested Setting:
# Disable Screen Sharing.
sudo srm /private/etc/ScreenSharing.launchd
# Available Settings:
# Enabled:
# "All Users"
# "Only these users"
# Available Settings:
# Disabled (unload)
# Enabled (load)
# Web Sharing
# -----------------------------
# Default Setting:
# Web Services: Disabled
# Suggested Setting:
# Disable Web Sharing.
sudo launchctl unload -w /System/Library/LaunchDaemons/
org.apache.httpd.plist
# Suggested Setting:
# Disable Remote Login.
sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist
# Available Settings:
# Remote Login (SSH):
# Disabled
# Enabled
# Suggested Setting:
# Disable Remote Management.
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/\
Resources/kickstart -deactivate -stop
# Available Settings:
# Remote Management:
# Disabled
# Enabled
# Suggested Setting:
# Disable Remote Apple Events.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.eppc.plist
# Xgrid Sharing
# -----------------------------
# Default Setting:
# Xgrid Sharing: Disabled
# Suggested Setting:
# Disable Xgrid Sharing.
sudo launchctl unload -w /System/Library/Daemons/com.apple.xgridagentd
sudo launchctl unload -w /System/Library/Daemons/com.apple.xgridcontrollerd
# Available Settings:
# Xgrid Sharing:
# Disabled
# Enabled
# Internet Sharing
# -----------------------------
# Default Setting:
# Internet Sharing: Disabled
# Suggested Setting:
# Disable Internet Sharing.
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat
NAT -dict Enabled -int 0
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.InternetSharing.plist
# Available Settings:
# Internet Sharing:
# Disabled
# Enabled
# Bluetooth Sharing
# -----------------------------
# Default Setting:
# Bluetooth Sharing: Disabled
# Suggested Setting:
# Disable Bluetooth Sharing.
sudo defaults -currentHost write com.apple.bluetooth PrefKeyServicesEnabled
0
# Suggested Setting:
# Turn off AirPort Services using the following commands. Run the last
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.airportPrefsUpdater.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.AirPort.wps.plist
launchctl unload -w /System/Library/LaunchAgents/com.apple.airportd.plist
# Turn off remote control service using the following command:
launchctl unload -w /System/Library/LaunchAgents/com.apple.RemoteUI
# Turn off Screen Sharing services.
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.RFBEventHelper.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.RFBRegisterMDNS_RemoteManagement.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.RFBRegisterMDNS_ScreenSharing.plist
launchctl unload -w /System/Library/LaunchAgents/\
com.apple.ScreenSharing.plist
# Turn off Remote Management service using the following commands:
sudo launchctl unload -w /System/Library/LaunchAgents/\
com.apple.RemoteDesktop.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.RemoteDesktop.PrivilegeProxy.plist
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.RFBEventHelper.plist
# Turn off Bluetooth service using the following command:
sudo launchctl unload -w /System/Library/LaunchDaemons/\
com.apple.blued.plist
# Available Settings:
# Disabled (unload)
# Enabled (load)
Index
A key-based SSH 213–215
access control entries. See ACEs See also keychain services; passwords
access rights. See permissions server- vs. client-side 170
access warnings 57–60 strengthening methods 130–133
See also permissions system preferences 63
accounts user
administrator 33–34, 118–119, 124–127 authorization 225
authentication setup 62, 130 See also authentication
checklists 243–244 authorization rights 228–230
creating secure 121–127 AutoFill options 170, 175
credential storage 134–139 automatic actions, disabling 73
directory domains 127–129
initial setup 34 B
mobile 127 Back to My Mac. See BTMM
nonadministrator user 118–119 backups 163–164
preferences 67–69 BannerSample file, modifying 59
types 118 Berkeley Software Distribution. See BSD
ACEs (access control entries) 41, 147 Bill of Materials file 41
ACLs (access control lists) 41, 135, 143, 147–148, 163 biometrics-based authentication 133
Active Directory 129 Bluetooth preferences 72–73, 220
activity analysis tools 233–236 Bonjour browsing service 194
Address Book 128, 181 bookmarks, synchronizing 174
administrator account 33–34, 118–119, 124–127 Boot Camp 163
Advanced Encryption Standard (AES-128) 99 browsers
AFP (Apple Filing Protocol) 201–202 preferences 174
antivirus tools. See virus screening security 170
appearance preferences 70–71 BSD (Berkeley Software Distribution) 18, 234
Apple Filing Protocol. See AFP BTMM (Back to My Mac) 197–198
Apple Remote Desktop. See ARD
Apple Software Restore. See ASR C
Application firewall 184–186 CA. See Certificate Authority
applications cache, browser 170
access control 23, 24, 186 CDs, preferences 73, 199
securing 165–170, 232–233 CDSA (Common Data Security Architecture) 18
ARD (Apple Remote Desktop) 215–216 CERT (Computer Emergency Response Team) 18
ASR (Apple Software Restore) 33 Certificate Assistant 171–172
assistive devices 117 Certificate Authority 171–172
attributes, rules 227 Certificate Revocation List. See CRL
auditing tools 236–238 certificates 21, 27, 155, 165–169, 178–180
authentication checksum tool 231
accurate time settings 35 CIFS (Common Internet File System). See SMB
Active Directory 129 Click 93
Directory Access 128–129 client-side authentication 170
268
codesign command 233 Enabling 60
command-line interface encryption
access warnings 60 disk images 157–159
erasing files 161 FileVault 29, 153–156
ssh access 205–215 Mail service 165–169
startup security setup 56 secure virtual memory 104
command-line tools, Firewall service 187 Time Machine 163–164
Common Criteria Tools 236 Energy Saver preferences 80–81
Common Data Security Architecture. See CDSA erasing data permanently 159–162
Common Security Service Manager. See CSSM Everyone permission level 144
Computer Emergency Response Team. See CERT Exposé & Spaces preferences 83–84
computers, host name 106 Extensible Firmware Interface. See EFI
configuration files 212
Console tool 234 F
contacts search policy 128–129 fax preferences 96–98
cookies 170, 177 files
credential storage 134–139 backup of 163–164
CRL (Certificate Revocation List) 171 Bill of Materials 41
CSSM (Common Security Service Manager) 21 downloading safely 173
encryption 153–159
D erasing 159–162
Dashboard preferences 83–84 integrity checking tools 232
data security 104, 143–162, 163–164 managing log 234
Date & Time preferences 75–76 package 41
Desktop preferences 77–78 permissions 143–146, 148–149
dictionaries security 104, 177
rights 225–227 file services
rules 227 See also FTP; share points
digital signature 165–169, 232–233 file sharing 201–202
directories. See directory services; domains, directory; file systems, erasing data 159
folders File Transfer Protocol. See FTP
Directory Access 128–129 FileVault 29, 43, 99, 153–156, 157, 207
directory services FileVault master keychain 154
Active Directory 129 fingerprints, server 206, 214–215
directory domains 127–129 Firewall service 26, 106, 183–186
Open Directory 129 FireWire 114
discovery, service 128 FireWire Bridge Chip GUID 114
disk images Firmware interface 55
encrypting 28, 157–159, 182 firmware password 55, 114–115
read/write 157 flags for files and folders 146–147
restoring from 33 folders
disks flags for 146–147
permissions for 40–42 home 127, 152–156
startup 114–115 permissions for 152–153
Disk Utility 28, 41, 160, 162 shared 182
display mirroring 79 free disk space, erasing 162
Displays preferences 79 FTP (File Transfer Protocol) 201–202
Dock preferences 79
domains, directory 127–129 G
Download Inspector 25 global file permissions 148–149
DVDs, preferences 73, 199 grids, server 217–218
groups, permissions 144
E guest accounts, permissions 144
EFI (Extensible Firmware Interface) 54, 115 guest operating systems 163
email. See Mail service
Index 269
H remote 205–215, 217
hard drive 43 security measures 67–69, 239
hardware, protection of 43, 241, 245 logs
HIDS (host-based intrusion detection systems) 239 audit 237–238
HISEC (Highly Secure) templates 129 security 234–236
home folders 127, 152–156
host name 106 M
hosts. See servers Mach 18
HTML (Hypertext Markup Language) email 166 Mail service 165–169
managed preferences
I Dashboard 83–84
iChat service 178, 178–180, 181 Date & Time 75–76
iDisk 182 Desktop 77–78
images. See disk images Displays 79
installation 31–42, 107, 240–241 Dock 79
installer packages 107 Energy Saver 80–81
Intel-based Macintosh 54, 163 Exposé & Spaces 83–84
International preferences 84 International 84
Internet-based Software Update 36 Keyboard 84
Internet security MobileMe 64–66
browsers 170, 176 Mouse 84
email 165–169 Network 85–86, 87
instant messaging 178–180 Parental Controls 93–95
MobileMe preferences 64–66 Print & Fax 96–98
sharing 105–106, 181, 197–198, 217–220 Security 99–101, 184
intrusion detection system (IDS) monitors 239 Sharing 105–106, 184, 206, 216–220
IP addresses 85 Software Update 36–39, 107
IPFW2 software 187 Sound 109
iPhoto 181 Spotlight 111–113
IPv6 addressing 85 Startup Disk 114–115
iTunes 181 Time Machine 115–116, 163–164
Universal Access 117
K managed user accounts 118
Kerberos 129, 131–132, 165 mandatory access controls 23–25
key-based SSH connection 207–210, 213–215 Microsoft Windows compatibilities 147
Keyboard preferences 84 mobile accounts 127
Keychain Access 134, 169, 171–172 MobileMe preferences 64–66, 178–180
keychain services 21, 23, 134–139, 154 Mouse preferences 84
L N
NetBoot service 33
L2TP/IPSec (Layer Two Tunneling Protocol, Secure
network-based directory domains 127–129
Internet Protocol) 192–194
network-based intrusion detection systems. See NIDS
Launch Services 25
network-based keychains 139
layered security architecture 20
network install image 114
LDAP (Lightweight Directory Access Protocol)
Network preferences 87
service 129
network services
LDAPv3 access
access control 87
Lightweight Directory Access Protocol. See LDAP
FileVault limitations 153, 157
local system logging 235
installation 32
locking folders 146
keychains 139
logging tools 234–236
logs 234–236
login
managed users 121
access warnings 57–60
preferences 85–86
automatic 99
security methods 27, 165, 183–186
keychain 135–136
270 Index
sharing 105–106, 199, 217–220 accounts 67–69
sleep mode security 80 appearance 70–71
Software Update cautions 36 Bluetooth wireless 72–73, 220
wireless preferences 72–73 CDs 73, 199
newsyslog command 236 cookies 177
NIDS (network-based intrusion detection DVDs 73, 199
systems) 239 fax 96–98
nonadministrator user accounts 118–119 overview 62, 63
NTP (network time protocol) 35 screen saver 77–78
nvram tool 56 See also managed preferences
speech recognition 110
O time 75–76
Open Directory 129 Print & Fax preferences 96–98
open source software 18–20 Printer Sharing 204
owner permission 144 privacy option, iChat service 179
private browsing 170
P private key 207
packages, file 41 privileges vs. permissions 40
Parental Controls 24, 93–95, 121–124 protocols. See specific protocols
Password Assistant 68, 130–131 proxy settings 177
passwords public key cryptography 232–233
authentication setup 130–131, 166–167 public key infrastructure. See PKI
changing 67–69 pwpolicy command 133
command-line tools 56
firmware 55, 114–115 Q
keychain 135 Quarantine 25
master FileVault 154–156
Startup Disk preferences 114–115 R
tokens 133 read/write disk images 157
vs. key-based authentication 207 recent items list 70–71
PDFs, encrypted 159 Remote Apple Events 216
permissions remote images in email 166
access 18 Remote Login 205–215
disk 40–42 remote server login 217
folders 152–153 remote system logging 236
manipulating 146 removable media
overview 143–149 FileVault limitations 153, 157
user 202 rights dictionary 225–227
viewing 144 right specifications 225–227
physical access, securing 43 root permissions 54, 125–126
physical computers rules dictionary 227
hardware security 44
PKI (public key infrastructure) 21, 165, 179, 207 S
See also certificates Safari preferences 170, 173–177
plug-ins 176 sandboxing 24
policy database 225–228 Scanner Sharing 204
portable computers screen saver preferences 77–78, 99
FileVault 153 Screen Sharing 200
keychains 139 searching preferences 111–113
mobile accounts 127 Secure Empty Trash command 162
portable files, encrypting 157–159 Secure iChat certificate 179
portable keychains 139 secure notes 134
POSIX (Portable Operating System Interface) 41, Secure Sockets Layer. See SSL
144–149 Secure Transport 20
preferences security 104, 181
Index 271
security architecture overview 18–21 ticket-based authentication 129
security-mode environment variable 56 Time Machine 115–116, 163–164
security-password environment variable 56 time settings 35, 75–76
Security preferences 99–101, 184 TLS (Transport Layer Security) protocol
Server Message Block/Common Internet File System. tokens, digital 133
See SMB Transport Layer Security protocol. See TLS
servers transport services 20
authentication 171–172 tunneling protocols
fingerprints 206, 214–215 SSH 211
securing connections 210 VPN 192–194
server-side authentication 170 two-factor authentication 29
Setup Assistant 33–34
SHA-1 digest 40 U
shared resources UIDs (user IDs) 119–120
printers 96, 98 Universal Access preferences 117
user accounts 119 UNIX and security 18
share points 201–202 updating software 35–39, 107
Sharing preferences 105–106, 184, 206, 216–220 user accounts 118–127
Simple Finder 122 user ID. See UID
single sign-on (SSO) authentication 131–132 users
See also Kerberos access control 24, 121–124, 202, 228–230
single-user mode 54 automatic actions control 73
sleep mode, securing 80–81, 99 home folders 127, 152–156
smart cards 29, 132 keychain management 137–138
SMB (Server Message block) 201–202 mobile 127
software, networking 165, 186 permissions 41, 144
Software Update service 35, 36–39, 107 preferences control 78, 83
Sound preferences 109 root 54
sparse images 157 See also user accounts
speech recognition preferences 110
Spotlight preferences 111–113 V
srm command 161 validation, system integrity 231–232, 246
SSH (secure shell host) 205–215 virtual memory 100, 104
ssh command 205–215 Virtual Network Communication. See VNC
SSL (Secure Sockets Layer) 20, 165, 179 virus screening 239
standard user accounts 118 VNC (Virtual Network Communication) 200
startup, securing 54–55 volumes, erasing data 159
Startup Disk preferences 114–115 VPN (Virtual Private Network)
stealth mode 185 clients 27
sudo tool 125–127 security 192–194
su tool 126
swap file 100 W
synchronization 64–66, 174 web browsers. See browsers
syslogd configuration file 235 web forms, completing 175
system administrator (root) account 125–127 Web Sharing 204
system preferences. See preferences websites, sharing 204
system setup 33–35 wireless preferences 72–73
T X
target disk mode 115 Xgrid 217–218
third-party applications 83
272 Index