Unix Security Checklist
This document shows system administrators how to secure their systems better. There are no guarantees of its completeness. In addition, the author takes no responsibility if a person misuses this information. There are many versions of Unix. This paper gives examples for HP-UX.
For a longer version, please see UNIX Computer Security
Physical Security
-
Console security
- Locked room (with limited number of keys)
- No alternate way into room (raised floors/ceilings)
-
Data Security
- Backups stored in safe place & offsite data recovery scheme in place
- Computers on a UPS to guarantee stable power
- Secure network cables from exposure
- Lock cabinets with sensitive information
- Destroy sensitive printouts/tapes
-
Users practice secure measures
- Lock screen (or logout) when away from desk
- No written passwds/passwd hints on desk
- Careful use of xauth/xhost so others can not read screen
-
NO welcome banner on site (Only authorized access allowed)
Network Security
-
Filtering
- Do not enable services you are not using (inetd.conf)
- Create access control lists /var/adm/inetd.sec to say what hosts can connect
- Filter out unnecessary services at router - only allow services you want
- TCP wrappers for logging as needed
- If you are on the Internet, build a firewall
-
Prevent spoofing
- Router Mods
- Turn off source routing
- Apply a filter that guarantees that packets coming in from the outside network do not have a source IP address that matches the inside network
- Qualified hostnames only in any system file (NFS, hosts.equiv ....)
- No hosts.equiv or .rhosts if possible (cron job remove non-agreed upon ones)
- .rhost and .netrc files (if allowed), permissions must be 600
-
Telnet Security
- Use ssh instead.
- Limit telnet to specific IPs (if you MUST use it)
- Turn off permissions for root to login directly (except console).
-
FTP Security
- Make sure you have /etc/ftpusers w/ all system accounts (uucp, bin. root ..)
- Minimal permissions/minimal accounts
- Always use FTP logging and look at logs
- Make directories unwriteable if possible
-
Modem Security
- All modems should have additional dial-up passwd
- make sure /etc/d_passwd passwds are non-guessable using CRACK
- One passwd per user; disable when user no longer needs access
- All dial-up modems should log users out upon disconnect (hupcl in /etc/gettydefs)
- SATAN will find many of these problems
- SNORT will monitor to see if you are being attacked (freeware IDS)
Account Security
-
Password Security
- All accounts MUST have passwd field filled
- Only root should have UID 0
- Password not guessable (crack on regular basis)
- Password not written down
- No pictures on desk that are password
- Password aging
- One-time use passwords
- HP can use trusted system package (via SAM) - if NOT using NIS or NIS+
- No .netrc files
- Accounts should be disabled when there are several bad logins in a row
-
Root Accounts
- Root can only log into console (/etc/securetty)
- Check root dot files; NEVER have "." in path
- Limited number of users
- Use strong passwd
- ALWAYS logout of root shells; never leave root shells unattended
- Change root passwd every 3 months & whenever someone leaves company
- Login as normal user & use "su"
- Sensible umasks (077 if possible) [though many times it is more practical to have it be 022]
- Always use full path when not at console
- Never allow non-root write access to ANY directories in root's path
- No tmp files in publically writable directories (if possible)
-
Guest Accounts
- Limited time, only when needed
- Use non-standard names - not guest
- Use strong passwd
- Use a restricted shell
- Sensible umasks (077 if possible)
-
User Accounts
- Remove accounts upon termination
- Accounts should NOT be shared
- Disable login for well known accounts (bin,sys,uucp)
- Sensible umasks (077 if possible)
- Use a restricted shell when possible
File System Security
-
NFS Security
- Only run NFS as needed, apply latest patches
- Careful use of /etc/exports (or /etc/dfs/dfstab for SUN)
- Read-only if possible
- No suid if possible
- Fully qualified hostnames
-
Device Security
- Device files /dev/null, /dev/tty & /dev/console should be world writeable but NEVER executable
- Most other device files should be unreadable and unwriteable by regular users
-
Script Security
- Never write setuid/setgid shell scripts (can break out); write C programs instead
- Scripts should ALWAYS have full pathnames
- Minimal writable filesystems (esp. system files/directories!)
- Use setuid/setgid only where necessary
- Make sure that important files are only accessible by authorized personnel
- COPS will find many of these problems
Security Testing
- Always have latest security OS patches installed
- Subscribe to security mailing lists/newsgroups
- If you do NOT use NIS or NIS+, make your system a HP-UX trusted system for easier system security
- Test w/ SATAN (network security)
- Test w/ COPS (Various system checks)
- Test w/ TIGER (ways for root to be compromised)
- Test w/ CRACK (passwd checker)
- Tripwire (detects changes to files)
- Check btmp, wtmp, syslog, sulog etc. regularly
- Set up automatic email or paging to warn system administrators of any suspicious behavior.
Security Books
|