Contained WithinFind More DocumentationFeatured Support Resources | PDF로 이 문서 다운로드 (359 KB)
Chapter 4 Device AllocationThe Trusted Computer System Evaluation Criteria's (TCSEC) object-reuse requirement for computing systems at C2 level and above is fulfilled by the device-allocation mechanism. This chapter describes what you need to know about managing devices. You must decide whether any devices should be allocatable, and if so, which devices should be allocatable, if the defaults are not appropriate for your site's security policy. Risks Associated With Device UseFor one example of the security risks associated with the use of various I/O devices, consider how cartridge devices are typically used. Often several users share a single tape drive, which may be located in an office or lab away from where an individual user's own machine is located. This means that, after the user loads a tape into the tape drive, some length of time may elapse before the user can return to the machine to invoke the command that reads or writes data to or from the tape. Then another time lapse occurs before the user is able to take the tape out of the drive. Because tape devices are typically accessible to all users, during the time when the tape is unattended an unauthorized user can access or overwrite data on the tape. The device-allocation mechanism makes it possible to assign certain devices to one user at a time, so that the device can only be accessed by that user while it is assigned to that user's name. The device-allocation mechanism ensures the following for tape devices and provides related security services for other allocatable devices:
Components of the Device-Allocation MechanismThe components of the allocation mechanism that you must understand in order to manage device allocation are:
How any user invokes the allocate, deallocate, dminfo, and list_devices commands is described in "Using the Device-Allocation Utilities". All of the options and other descriptions are defined in the man pages. The device_allocate file, the device_map file, and the lock files are specific to each machine. The configuration files are not administered as NIS databases because tape drives, diskette drives, and the printers are all connected to specific machines. Using the Device-Allocation UtilitiesThis section describes what the administrator can do with the options to allocate, deallocate, and list_devices that are usable only by root. The commands are detailed on their respective man pages.
The Allocate Error StateThe allocate error state is mentioned in the man pages for the allocate components. An allocatable device is in the allocate error state if it is owned by user bin and group bin with a device-special file mode of 0100. If a user wants to allocate a device that is in the allocate error state, you should try to force the deallocation of the device, using the deallocate command with the -F option, or use allocate -U to assign it to the user, then investigate any error messages that display. When the problems with the device are corrected, you must rerun the deallocate -F or allocate -F commands to clear the allocate error state from the device. The device_maps FileYou can look at the /etc/security/device_maps file to determine the device names, device types, and device-special files that are associated with each allocatable device. See the device_maps(4) man page. Device maps are created by the system administrator when setting up device allocation. A rudimentary file is created by bsmconv when the BSM is enabled. This initial map file should be used only as a starting point. The system administrator is expected to augment and customize device_maps for the individual site. This file defines the device-special file mappings for each device, which in many cases is not intuitive. This file allows various programs to discover which device-special files map to which devices. You can use the dminfo command, for example, to get the device name, the device type, and the device-special files to specify when setting up an allocatable device; dminfo uses the device_maps file. Each device is represented by a one-line entry of the form: device-name:device-type:device-list Lines in the file can end with a \ to continue an entry on the next line. Comments may also be included. A # makes a comment of all further text until the next newline not immediately preceded by a \. Leading and trailing blanks are allowed in any of the fields.
For an example of entries for SCSI tape st0 and diskette fd0 in a device_maps file, see the following screen.
The device_allocate FileModify the device_allocate file to change devices from allocatable to non-allocatable or to add new devices. Table 4-1 shows a sample device_allocate file. Table 4-1 Sample device_allocate File
The administrator defines which devices should be allocatable during initial configuration of the Basic Security Module. You may decide to accept the default devices and their defined characteristics, as shown in Table 4-1. Whenever you add a device to any machine after the system is up and running, you must decide whether to make the new device allocatable. The entries for devices in the device_allocate file may be modified by the administrator after installation. Any device that needs to be allocated before use must be defined in the device_allocate file on each machine. Currently, cartridge tape drives, diskette drives, CD-ROM devices, and audio chips are considered allocatable and have device-clean scripts. Note - If you add a Xylogics tape drive or an Archive tape drive, they can also use the st_clean script supplied for SCSI devices. Other devices that you can make allocatable are modems, terminals, graphics tablets, and the like, but you need to create your own device-clean scripts for such devices, and the script must fulfill object-reuse requirements for that type of device. An entry in the device_allocate file does not mean the device is allocatable, unless the entry specifically states the device is allocatable. Notice in Table 4-1 an asterisk (*) in the fifth field of the audio device entry. An asterisk in the fifth field indicates to the system that the device is not allocatable; that is, the system administrator does not require a user to allocate the device before it is used nor to deallocate it afterward. Any other string placed in this field indicates that the device is allocatable. In the device_allocate file, represent each device by a one-line entry of the form
For example, the following line shows the entry for device name st0:
Lines in device_allocate can end with a \ to continue an entry on the next line. Comments may also be included. A # makes a comment of all further text until the next newline not immediately preceded by a \. Leading and trailing blanks are allowed in any of the fields. The following paragraphs describe each field in the device_allocate file in detail.
Device-Clean ScriptsThe device-clean scripts address the security requirement that all usable data is purged from a physical device before reuse. By default, cartridge tape drives, diskette drives, CD-ROM devices, and audio devices require device-clean scripts, which are provided. This section describes what the device-clean scripts do. Object ReuseDevice allocation satisfies part of the object-reuse requirement. The device-clean scripts make sure that data left on a device by one user is cleared before the device is allocatable by another user. Device-Clean Script for TapesThe three supported tape devices and the device-clean script for each are shown in Table 4-2. Table 4-2 Device-Clean Script for the Three Supported Tape Devices
The script uses the rewoffl option to mt to affect the device cleanup. See the mt(1) man page. If the script runs during system boot, it queries the device to see if the device is online and has media in it. The 1/4-inch tape devices that have media remaining are placed in the allocate error state to force the administrator to clean up the device manually. During the normal system operation, when allocate or deallocate is executed in the interactive mode, the user is prompted to remove the media from the device being deallocated. The script pauses until the media is removed from the device. Device-Clean Scripts for Diskettes and CD-ROMThe device-clean scripts for the diskettes and CD-ROM devices are shown in Table 4-3. Table 4-3 Device-Clean Scripts for the Diskette and CD-ROM Device
The scripts use the eject command to remove the media from the drive. See the eject(1) man page. If eject fails, the device is placed in the allocate error state. Device-Clean Script for AudioThe audio device is cleaned up with an audio-clean script. The script performs an AUDIO_DRAIN ioctl system call to flush the device, then an AUDIO_SETINFO ioctl system call to reset the device configuration to default. In addition, the script retrieves the audio chip registers using the AUDIOGETREG ioctl system call. Any registers deviating from default are reset using the AUDIOSETREG ioctl system call. Writing New Device-Clean ScriptsIf you add more allocatable devices to the system, you might need to create your own device-clean scripts. The deallocate command passes a parameter to the device-clean scripts. The parameter, shown here, is a string that contains the device name (see the device_allocate(4) man page):
Device-clean scripts must return 0 for success and greater than 0 for failure. The options -I, -F, and -S help the script determine its running mode. -I is needed during system boot only. All output must go to the system console. Failure or inability to forcibly eject the media must put the device in the allocate error state. -F is for forced cleanup. This option is interactive and assumes that the user is there to respond to prompts. A script with this option must attempt to complete the cleanup if one part of the cleanup fails. -S is for standard cleanup. This option is interactive and assumes that the user is there to respond to prompts. Setting Up Lock FilesThe lock files are zero-length files created in /etc/security/dev -- one for each allocatable device. If no lock file exists for an allocatable device, the device cannot be allocated, and no one can access the device. How to Set Up Lock Files for a Device to Be Made Allocatable
How the Allocate Mechanism WorksThis section shows an example of how the allocate mechanism works. The allocate command first checks for the presence of a lock file under the device name for the specified device in the /etc/security/dev directory. If the file is owned by allocate, then the ownership of the lock file is changed to the name of the user entering the allocate command. The allocate command then checks for an entry for the device in the device_allocate file, and checks whether the entry shows the device as allocatable. The first listing in the screen example below shows that a lock file exists with owner bin, group bin, and mode 600 for the st0 device in /etc/security/dev. The second listing shows that the associated device-special files are set up properly, with owner bin, group bin, and mode 000:
In this screen, user vanessa allocates device st0.
When the user vanessa enters the allocate command to allocate the tape st0, allocate first checks for the existence of an /etc/security/dev/st0 file. If no lock file existed or if the lock file were owned by a user other than allocate, then the device would not be allocatable by vanessa. If it finds the lock file for the device with the correct ownership and permissions, the allocate command then checks to make sure the device has an entry in the device_allocate file and that the entry specifies that the device is allocatable. In this example, the default device_allocate entry for the st0 device specifies that the device is allocatable. Because the allocate command finds that all the above conditions are met, the device is allocated to vanessa. The allocate command changes the ownership and permissions of the device-special files associated with the device in the /dev directory. To allocate the st0 device to vanessa, the mode on its associated device-special files is changed to 600 and the owner is changed to vanessa. The allocate command also changes the ownership of the lock file associated with the device in the /etc/security/dev directory. To allocate the st0 device to vanessa, the owner of /etc/security/dev/st0 is changed to vanessa. After the user vanessa executes the allocate command using the device name st0, the following screen example shows that the owner of /etc/security/dev is changed to vanessa and that the owner of the associated device-special files is now vanessa as well, and that vanessa now has permission to read and write the files. Managing and Adding DevicesThe procedures in this section show how to manage devices and how to add devices. How to Manage Devices
How to Add a New Allocatable Device
Using Device AllocationsThe procedures and commands in this section show how to manage devices and how to add devices. The device-allocation and device-deallocation commands are entered from the command line in a Command Tool or Shell Tool window:
How to Allocate a DeviceUse the allocate command with a device specified by name, as in the example, or by type, with -g switch.
If the command cannot allocate the device, an error message displays in the console window. A list of all error messages appears in the allocate(1M) man page. How to Deallocate a Device
Deallocation allows other users to allocate the device when you are finished. |
||||||||||||||||||||||||||||||||||||||