Security in UNIX & Windows
Security in UNIX & Windows
Windows
Security in UNIX Operating Systems
Objectives
• Brief history of UNIX systems
• Description of protection systems of UNIX
• Comparison of requirements of a secure operating
system with UNIX
• Why ordinary operating systems are inherently
insecure.
• Examination of common vulnerabilities
• Types of threats that they will have to overcome.
• Windows Security as compared to UNIX
2
History of UNIX systems
• UNIX is a multiuser operating system developed
by Dennis Ritchie and Ken Thompson at AT&T
Bell Labs
• Ken Thompson adapted some of the ideas of
Multics and constructed new system that was
named as a pun on the Multics system, UNICS
(UNIplexed Information and Computing Service),
later it was renamed as UNIX.
• UNIX remains a significant operating system
today, embodied in many systems, such as Linux,
Sun Solaris, IBM AIX, the various BSD systems,
etc.
3
History of UNIX systems (contd..)
• While UNIX adopted many Multics principles, such
as hierarchical file systems, virtual memory, and
encrypted passwords, UNIX was far simpler.
• UNIX adopted several of the Multics security features,
such as password storage, protection ring usage, access
control lists, etc., but most were streamlined as well.
• As we will discuss later, the ordinary UNIX security
mechanisms are not capable of enforcing the
requirements of a secure operating system.
• A variety of efforts have aimed to extend or replace the
insecure mechanisms for ordinary UNIX systems with
mechanisms that may achieve the requirements of a
secure operating system
4
UNIX SECURITY: Overview
• A running UNIX system consists of an operating system
kernel and many processes each running a program.
• A protection ring boundary isolates the UNIX kernel
from the processes.
• Each process has its own address space that defines the
memory addresses that it can access.
• Modern UNIX systems define address spaces primarily
in terms of the set of memory pages that they can access.
• UNIX uses the concept of a file for all persistent system
objects, such as secondary storage, I/O devices, network,
and inter process communication
5
UNIX SECURITY: Overview (contd..)
• UNIX process is associated with an identity, based on the
user associated with the process, and access to files is limited
by the process’s identity.
• UNIX security aims to protect users from each other and the
system’s trusted computing base (TCB) from all users.
• Informally, the UNIX TCB consists of the kernel and several
processes that run with the identity of the privileged user,
root or super user.
• These root processes provide a variety of services, including
system boot, user authentication, administration, network
services, etc.
• Both the kernel and root processes have full system access.
• All other processes have limited access based on their
associated user’s identity.
6
UNIX PROTECTION SYSTEM
• UNIX is a discretionary access control (DAC)
system
• The UNIX protection system defines a
transition state that describes how processes
change between protection domains.
• The labeling state is largely ad hoc.
• All UNIX resources are represented as files
• While directories are not files, they are
represented as files in the UNIX protection
state 7
UNIX PROTECTION SYSTEM (contd..)
• The protection state specifies that subjects may
perform read, write, and execute operations on files
• Files are also associated with an owner UID and an
owner GID
• The limited set of objects and operations enabled
UNIX designers to use a compressed access control
list format called UNIX mode bits, to specify the
access rights of identities to files.
• Mode bits define the rights of three types of subjects:
(1) the file owner UID
(2) the file group GID
(3) all other subjects
8
UNIX PROTECTION SYSTEM (contd..)
• First, the UNIX authorization mechanism checks
whether the process identity’s UID corresponds to the
owner UID of the file, and if so, uses the mode bits
for the owner to authorize access.
• If the process identity’s GID or supplementary groups
correspond to the file’s group GID, then the mode bits
for the group permissions are used. Otherwise, the
permissions assigned to all others are used.
• Example: UNIX mode bits are of the form (owner
bits, group bits, others bits) where each element in the
tuple consists of a read bit, a write bit, and an execute
bit. The mode bits:
• rwxr--r--
9
UNIX PROTECTION SYSTEM (contd..)
• UNIX permits users to change their files owner UID,
group GID and even mode bits, so its discretionary.
• File labeling is also discretionary.
• UNIX processes are labelled by trusted services from
a set of labels (i.e., user UIDs and group GIDs)
defined by trusted administrators, and child processes
inherit their process identity from their parent. This is
mandatory approach, so its secure, but inflexible.
• Setuid bit which is used for protection domain
transitions is a mode bit, it can be set by the file’s
owner, so it is also managed in a discretionary manner
10
UNIX AUTHORIZATION
• The UNIX authorization mechanism controls each
process’s access to files and implements protection
domain transitions that enable a process to change its
identity.
20
UNIX SECURITY ANALYSIS (contd..)
• Finally, user-level processes have a variety of
interfaces to access and modify the kernel itself above
and beyond system calls. Ensuring that these
interfaces can only be accessed by trusted code has
become impractical.
21
UNIX SECURITY ANALYSIS (contd..)
6. Verifiable: What is basis for the correctness of the
system’s TCB?
Any basis for correctness in a UNIX system is informal.
The effectively unbounded size of the TCB prevents any
effective formal verification. Further, the size and
extensible nature of the kernel, makes it impractical to
verify its correctness.
23
UNIX VULNERABILITIES (contd..)
Rootkits:
Modern UNIX systems support extension via kernel
modules that may be loaded dynamically into the
kernel. However, a malicious or buggy module may
enable an attacker to execute code in the kernel, with
full system privileges.
A variety of malware packages, called rootkits, have
been created for taking advantage of kernel module
loading or other interfaces to the kernel available to
root processes.
24
UNIX VULNERABILITIES (contd..)
Environment Variables
UNIX systems support environment variables, system
variables that are available to processes to convey state
across applications. One such variable is LIBPATH
whose value determines the search order for dynamic
libraries.
A common vulnerability is that an attacker can change
LIBPATH to load an attacker-provided file as a dynamic
library. Since environment variables are inherited when
a child process is created, an untrusted process can
invoke a TCB program under an untrusted environment
25
UNIX VULNERABILITIES (contd..)
Shared Resources
• If TCB processes share resources with untrusted processes,
then they may be vulnerable to attack.
• A common problem is the sharing of the/tmp directory.
Since any process can create files in this directory, an
untrusted process is able to create files in this directory and
grant other processes, in particular a TCB process, access to
such files as well.
• If the untrusted process can guess the name of TCB
process’s /tmp file, it can create this file in advance, grant
access to the TCB process, and then have access itself to a
TCB file.
26
UNIX VULNERABILITIES (contd..)
Time-of-Check-to-Time-of-Use (TOCTTOU)
• Finally, UNIX has been prone to a variety of
attacks where untrusted processes may change the
state of the system between the time an operation
is authorized and the time that the operation is
performed.
• The UNIX file system remains susceptible to
TOCTTOU attacks because the mapping between
file names and actual file objects (inodes) can be
manipulated by the untrusted processes.
27
WINDOWS SECURITY
• Windows operating systems also fail to meet the
requirements of a secure operating system.
28
WINDOWS PROTECTION SYSTEM
• The Windows 2000 protection system ,like the
UNIX protection system, provides a discretionary
access control model for managing protection state,
object labeling, and protection domain transitions.
• Subjects in Windows are similar to subjects in
UNIX. In Windows , each process is assigned a
token that describes the process’s identity.
• Unlike UNIX, Windows objects can belong to a
number of different data types besides files.
• Infact, applications may define new datatypes, and
add them to the active directory, the hierarchical
name space for all objects known to the system.29
WINDOWS PROTECTION SYSTEM (contd..)
• From an access control perspective, object types are
defined by their set of operations.
• The SRM uses the object SID to retrieve its ACL from
which it determines the query result.
33
WINDOWS SECURITY ANALYSIS (contd..)
3. Complete Mediation: How do we verify that the reference
monitor interface provides complete mediation?
• As for UNIX, no specific approach has been used to verify
complete mediation.
38
WINDOWS VULNERABILITIES (contd..)
Enabled By Default:
• Like users and software vendors, Windows
deployments also came with full permissions and
functionality enabled. This resulted in the famous
Code Red worms which attacked the SQL server
component of the Microsoft IIS webserver.