Your chain is only as strong as its weakest link
Sunday, April 9th, 2006In an effort to spare others the pain that I’ve gone through in the past week, here are some helpful pointers for avoiding giving an attacker an “easy” way in to your systems.
Don’t assume that because you lock down your network traffic at the firewall that you can avoid any of these issues.
-
I originally thought I didn’t have to mention this, but you’re already not allowing any unencrypted login access to the system, right? No telnet, no rsh/rexec/rlogin, no unsecured IMAP/POP3? You’re sure? You’d better be sure.
-
Whatever you do, block X11 traffic everywhere you can. At the border. On the individual hosts. At any intermediary routers. If you’re running a thin-client lab and the host server is on a different subnet, make an exception. Otherwise, shut it the hell down. When a remote X app is needed, it can be tunneled by SSH.
-
Don’t automatically enable
ForwardX11orForwardX11Trustedin SSH. If you connect to a compromised host, you could very well be doomed. It’s not that hard to toss an -X or -Y onto the command line when you really _do_ need to fire up a remote X app. -
Never, ever, under any circumstances, allow root logins via ssh.
PermitRootLogin nois your sshd friend. If you absolutely must allow root to log in, choose betweenwithout-password(only public key authentication) orforced-commands-only(which will only allow you to run commands and not get an actual shell, again by public-key authentication only.) -
Never, ever, under any circumstances, use the same administrator/root password on more than one machine. If you’re using LDAP or NIS, exclude all privileged users from your directory. This does mean you need to keep a store of these passwords somewhere, if you have a lot of them. I’d suggest gpg-encrypting them onto a USB stick on a trusted host. We’re looking at PDAs that will allow us to lock/encrypt data on them, too (more useful). Change the root passwords periodically. A tool like apg (A Password Generator) is your bestest friend. I run it like:
apg -n 10 -m 8 -x 8 -t -a0 -MNClThis will generate ten pronounceable eight-character passwords that will include at least one numeric, one capital letter and lowercase letters. Some people really want to have non-alpha-numeric characters in passwords, too. For that, just change the
-MNClto-MNClSand be happy with symbols. -
On any machine that’s not meant for general use, disallow all but the absolute necessary logins (i.e., only admin staff). On top of that, disallow SSH password authentication, and force all your staff to use public-key authentication. Ensure that staff have workstations that have workstation-local home directories, to prevent the private keys from leaking out to insecure hosts. This way, even if a password gets cracked, an attacker still can’t easily log in to these locked-down hosts without brute-forcing an SSH DSA private key.
-
Consider a career other than Systems Administration.
