Evaluating UNIX Security Previous Screen Allen B
Total Page:16
File Type:pdf, Size:1020Kb
84-01-15.1 Evaluating UNIX Security Previous screen Allen B. Lum Payoff The UNIX operating system's basic security features include password protection, access permission, user profiles, shell scripts, and file ownership. Because new and enhanced UNIX security features are continually being added to these features in response to the demands of an increasingly competitive user community, information security professionals must begin with an understanding of the basic UNIX security environment. This article covers the fundamental security features that can be found in most of the currently available versions of the UNIX operating system. Several checklists are included at the end of the article to assist administrators in ensuring the security of UNIX systems. Problems Addressed The UNIX operating system was originally developed for use by programmers within an open systems environment. The adoption of UNIX as a common operating system across several different platforms has increased the need for security beyond its original purpose. As a result, many UNIX installations have less than optimal security. In addition, there are several versions of UNIX on the market today with differing security features. This article discusses basic access controls (e.g., passwords) and directory and file permissions within the UNIX system. The concepts discussed are applicable to all versions of UNIX unless specifically noted otherwise. UNIX History As the majority of UNIX users know, UNIX was developed at AT Bell Laboratories in the late 1960s by Thompson and Ritchie; the name UNIXis a contraction of uni and multics. The original UNIX system software was written in the assembler language to run on the digital PDP-7 computer. In the early 1970s, UNIX was ported over to the PDP-11 and rewritten in the C programming language. Rewriting UNIX in C enabled the UNIX operating system to be used on other hardware platforms that supported a C compiler. By this time, Bell Labs distributed the UNIX operating system free to universities and the federal government. The rapid decrease in the cost of computer hardware specifically the Reduced Instruction Set Computing processor, which supports the UNIX operating system resulted in wide acceptance of UNIX by the business sector. In 1983, AT announced support of the UNIX operating system under the product name System III. The current version as of this writing is System V Release 4. Other manufacturers have licensed the source code from AT and implemented their own versions with additional features not found in AT's version. Examples of different implementations include SunOS (Sun Microsystems, Inc., Mountain View CA) and the ULTRIX systems (Digital Equipment Corp., Maynard MA). Until recently, UNIX vendors did not place security features as a top priority because customers had not demanded them. In light of recent network intrusions, however, security needs have come into focus, and vendors are responding accordingly. Each vendor's version of UNIX differs in terms of security features, because the vendors obtain the source code of the UNIX operating system and implement various features depending on their particular target market. It is important to examine the vendor documentation for all possible security features. Basic UNIX Architecture Previous screen The UNIX operating system can be divided into three components. The first component is called the UNIX operating system kernel, or simply the kernel. The kernel is the core of the UNIX system and resides in main memory; it must be considered the heart of the UNIX operating system. The second component may be defined as the shell, which serves as the user interface to the kernel. Users communicate to the UNIX kernel by issuing commands through the shell. Common UNIX shells include C and Bourne. The shell typically is executed at log-in time. The third component consists of utilities that reside on disk and are called into main memory only when requested. Examples of UNIX utilities include sendmail andrestore, which send mail and restore backup files respectively. Log-In Procedures From a security perspective, the log-in procedures provide entry to the UNIX system. When a user logs in to the system, a UNIX program called init automatically starts the getty program. The getty program, which is executed on each user terminal, determines the terminal speed and displays the log-in message at the terminal. After thegetty program has been executed, the system waits for the entry of the user's log-in ID. The getty program is then replaced by the loginprogram. Before being replaced, getty transmits the characters entered by the user (i.e., the log-in ID) tologin. When login begins executing, it prompts the user to enter a password. After the password has been entered, login checks the password file (/etc/passwd) and verifies that the password entered is the correct one for that user ID. (The /etc/passwdfile also contains information that defines the user's operating environment.) Start-up files are then executed, as described in the next section. Start-Up Files When a user logs in to the UNIX system, several start-up files are executed. These start-up files are used to determine the system and operating environment for that particular user. They may define a user's terminal and home directory. Depending on the version of UNIX and the type of shell used, several start-up files can be executed. Exhibit 1 lists the most common shells and associated start-up files. Common UNIX Start-Up Files File Name Description Previous screen _________ _____________ .cshrc Defines such items as paths and directories that are searched when programs are executed. This start-up file is executed each time a shell or subprocess is created. It is used in UNIX systems written in the C language. .login Executes specific files that define a user's environment (e.g. a user's terminal characteristics). This command file is executed only after the .cshrc file has been executed. /etc/prof Contains commands that are executed at log-in time for each user (e.g., user-defined menus and default file security). This sys- temwide command fiel is used with UNIX systems that have a Bourne shell. It enables administrators to define security for users (e.g., file protection defaults). .profile Contains commands that further define a user's environment and can start user applications. This start-up file is located in the user's home directory and is executed each time a user logs in. /rsh Limits a user's capabilities by disallowing the ability to change directories, change the PATH variable, using a command containing a slash, or redirect output. A user's default start-up shell is specified into the/etc/passwd file, which will be discussed in greater detail later in this article. In most UNIX systems, start-up files and their associated shells are as follows: · C shell (csh) · —.cscrc · —.login · —.logout · Bourne (sh) and Korn (ksh) shell · —.profile A different set of start-up files will be executed depending upon the user's default shell. If no shell is defined for the user, in most UNIX systems the Bourne shell will be executed. Exhibit 2 illustrates the UNIX log-in process. UNIX Log-in Process There are two schools of thought on the use of the restricted(.rsh) shell. The group that advocates its use claims that the restricted shell offers an excellent security feature as long as the following precautions are taken: · All users are placed in a menu with appropriate traps so users cannot exit or escape into the UNIX environment. · The restricted environment requires a password at log-in. Previous screen · Users are restricted from access to commands that let them escape to the shell (e.g., the use of the mail utilities or vi editor). The biggest drawback to use of the .rsh shell is the ability of users to break out of the shell and access a UNIX prompt. The second group believes that the restricted shell should not be used because of the limitations it places on the user environment. This group suggests alternative procedures that can be set up by the security or systems administrator to perform the same functions as.rsh. These procedures include: · Using secure C programs to limit the user's ability to perform certain functions. · Using restricted menus. · Refusing to give the user access to the shell. The user's menu should be called directly from the log-in routine instead of the shell. The statement calling the menu can be added to the /etc/passwd file. · Placing users in their own subsystem. For security to be effective, it is important to restrict the user's ability to update the start-up files, because they control the user's operating environment. Only the systems administrator should have the ability to change or update these files. (The permissions that control user access to files and directories are discussed later.) Another option that has been used successfully by many companies is to specify an executable program that will be executed instead of a user's shell (i.e., C, Bourne, or K shell) at start-up. This program is typically written in the C language and presents a menulike structure to the user. A user selects an item from the menu, and that item executes an associated program. The advantage of this method is that a user is kept captive to a particular menu. The Root Account Most UNIX systems have an ID called the root account or root ID, which is used by the system administrator. It is designated with a group ID of 0. The root account has access to all system files and utilities and the ability to change system operating characteristics.