Nine Principles of Security Architecture
Nine Principles of Security Architecture
If you learn these basic principles, you can not only make more informed
choices when installing and configuring software, but also learn more about
your operating system. As a side benefit, you’ll also understand the reasoning
behind claims that OpenBSD is more secure than GNU/Linux, or that both are
more secure than Windows.
Architectural security starts with a strong security policy and detailed knowledge
of what is on your system. Without this first principle, you’re faced with making
decisions about security unsystematically and without an understanding of what
needs to be secured. This principle requires avoiding the default policies and
choices of installation programs, and drilling down into the preferences and
configuration files where you have more control over questions such as whether
ordinary users can mount CDs and where you can choose individual packages.
It may also mean checking the default packages in a preconfigured group, and
removing programs that conflict with security policy. On Debian, for example, if
you select the Desktop Environment profile for your installation, you can see
exactly what is installed by referring to the Packages.gz file on the install CD.
This may be time-consuming, but unless you make the effort, your goal of a
secure system is defeated at the start.
Reverse the principle, and it becomes a strong argument for the free and open
source development model. Because source code is available, users who know
the programming language can confirm that actions are the result of a
particular block of code, and that no unexpected actions are carried out at the
same time. Users who can’t read the code, of course, have to rely on an
expert’s opinion, but the point is that the potential for verification is available.
The principle of least privilege suggests that all processes, users, and programs
should be given only the access to system resources that they need, and no
more. If a process does not need to run as root, then it shouldn’t. If particular
users don’t need to read or write to a particular partition, such as /boot, then
they shouldn’t have the permissions to do so. When users require greater
privileges or access, they should get it for as brief a time as possible.
Least privilege is one of the reasons why, ideally, users should be added to
groups only as necessary, rather than being automatically added to a number of
common ones. Similarly, while ordinary users can use the sudo command to run
programs as root, they shouldn’t all be able to use it for any command. Instead,
specific users should be limited to specific commands that they can run using
sudo.
Least privilege is also the design philosophy behind the multiple system
accounts found in operating systems like Solaris. Instead of having a single root
account that gives complete access to the system, multiple system accounts
divide root privileges, each with limited powers. When you use multiple system
accounts, a cracker may gain one password, but still be unable to control the
system fully.
Average users often think they’re safe if their systems are behind a firewall.
Often, they’re right. The trouble is, if the only security precaution on the system
is a firewall, then breaching the firewall exposes the entire system. The principle
of defense in depth suggests that a more secure solution is to have a variety of
security features operating at a variety of different levels.
To keep a system secure, you need a record of changes made to the system,
either by its own utilities or by intrusion detection systems such as Snort and
Tripwire. While you can keep some records of changes by hand, on Unix-like
systems, logs of changes or errors are traditionally saved in /var/log by system
applications. This system is not ideal, since altering logs to hide an intrusion is
one of the first steps that an expert cracker makes.
This principle is one of the main reasons for the division between root and
normal user accounts used for everyday activities. In most cases, if a exploit
succeeds against a non-privileged account, a cracker still doesn’t have access to
the system’s configuration files or utilities. The individual user may lose files,
but damage to the system as a whole is limited, unless security is reduced by a
step such as adding non-privileged accounts to all available groups. On a more
advanced level, containment is the principle behind using a chroot jail to run an
untested or dangerous program in isolation.
This principal reinforces the need for defense-in-depth. The more defenses a
system has, the less likely that the weakest one will leave it vulnerable. Since
the weakest link is often users rather than the system itself, it may mean that
you need to educate users about basic security practices, and check periodically
that they are following them.
No matter how well-designed and implemented a security policy is, your efforts
are wasted if users tape their passwords to the bottom of their keyboards
or give their passwords to random interviewers on the subway.
Security measures taken after the fact leave you uncertain how secure a system
is. An antivirus program may remove a worm or trojan, but you can never be
sure whether the system is secure again.
From an architectural security viewpoint, the only way you can be reliably
certain that your system is secure after being successfully attacked is to
reinstall the BIOS, reformat the hard drive, and restore files from a backup
taken before the system was compromised. Since these steps are time-
consuming, and result in a system being off-line much longer than is you’d like,
you are better off applying the other security principles so you won’t need to
restore the system in the first place.
Conclusions
In the end, thinking about these principles can help shift the odds in security in
your favor, and help you recover more efficiently from attacks. And, if nothing
else, they can save you from the false sense of security that comes from
thinking that reactive measures are enough.