HP-UX System Administrator's Guide: Security Management HP-UX 11i v3 (B3921-90020, September 2010)

Table Of Contents
to a program, thereby causing the program to execute arbitrary code from its program
stack.
The executable_stack kernel tunable parameter globally enables or disables stack
buffer overflow protection. A setting of 0 (zero) causes stacks to be nonexecutable and
is preferred for security reasons. By default, for backward compatibility,
executable_stack is set to 1, which allows stack execution and therefore no
protection. Use HP SMH or the kmtune command to change the value of
executable_stack.
An additional way to manage stack buffer overflow protection is to use the +es option
of the chatr command. For example, if executable_stack is set to zero but a
program does need to execute its stack, use the following chatr command to allow
stack execution for that program:
# chatr -es enable program
For more information, see chatr(1), kmtune(1M), and executable_stack(5).
2.8 Protecting Unattended Terminals and Workstations
Unattended workstations and terminals are extremely vulnerable to unauthorized
users. Like a front door left unlocked, they are open to anyone. This section explains
the following ways to reduce that risk:
Control access using /etc/inittab and run levels. Edit /etc/inittab to
identify which devices should run at different run levels.
Protect terminal device files by denying world access to user terminal sessions.
Configure the screen lock.
2.8.1 Controlling Access Using /etc/inittab and Run Levels
A run level is a system state in which a specific set of processes is permitted to run.
The processes and default run levels are defined in /etc/inittab. Run levels are 0
through 6, s, or S. If a process is not at the same run level as the system, it is terminated.
If a process is at the same run level, it is started or it continues to execute.
Following is an example to enable terminals and modems to be run at selected run
levels. Both ttp1 and ttp2 are at run levels 2 and 3.
ttp1:23:respawn:/usr/sbin/getty -h tty0p1 9600
ttp2:23:respawn:/usr/sbin/uugetty -h ttypd0p2 9600
Following is an example of changing run levels after normal work hours to disable
terminals and modems using a cron job. During the day, the run level is 3 and the
ttp1 and ttp2 terminals can be used because they are at run levels 2 and 3. At 8:00
a.m. from Monday through Friday, the system run level is set to 3:
# crontab -e
0 8 * * 1-5 /sbin/init 3
2.8 Protecting Unattended Terminals and Workstations 53