SYLS101: Securing Your Linux System 101

    Sections:

  1. Physical Security

  2. System Security

  3. User Security

  4. Network Security

  5. Mental Security

Instructor: John E. Jasen
E-mail: jjasen1@umbc.edu
Class URL: http://www.gl.umbc.edu/~jjasen1/unix/linux.html
Class Schedule: Available Here
Previous Version of Syllabus: Old Linux Security Guide

Before we begin, let me make perfectly clear that no level of security is guaranteed to keep a determined hacker out, except for grinding the computer into a micro-fine dust, mixing it into bricks and scattering them to the four corners of the planet. However, there are those who claim that this method affects useability and that we must compromise. Seriously, systems security involves trying to determine the level of risk and trying to determine what to expend countering, controlling and eliminating that risk. This cannot be done remotely, nor by some BogoMatic mathematical formula. It is determined on a case by case basic by the systems administrator.

That said, consider the following aspects of security.


Physical Security

Physical security is the most important aspect of of securing your system. Once "the bad guy (TBG)" sits down in front of it, only time and TBG's mind limit what he can do. This cannot be emphasized enough. TBG could boot from CD or floppy, accessing the filesystem through that method. TBG could possibly wipe BIOS settings, eliminating any obstacles presented by a boot password. TBG could remove the hard drive and mount it on another system, circumventing the BIOS and the root password. Or, at last resort, TBG could remove whatever he wants from your system [ram, hard drive, cd-rom, network card, etc] and go home.

So, make sure you have some way of controlling access to your machine. At home, make sure your doors and windows are secure. [duh!] At work, make sure that the offices are locked tight at night, hopefully there are guards or security equipment present, and hopefully strangers wandering about during the day are stopped and questioned. Security doors, keyvards, locking office doors and other such things are always a good measure, as well.

If for some reason, these methods cannot be used, consider using such things as cable locks, locking screws and bolts for the computer cases, BIOS passwords to prevent access, denying floppy or cd-rom booting, etc. However, such measures are 'delaying tactics', much like The Club [tm] is to a car thief -- it either deters TBG from attacking the system in that manner, or it delays him, so that hopefully a "good guy" will be able to catch him and intervene.


Systems Security

Installation
Examining inetd.conf
Examining /etc/rc.d/
Examining ps aux
Installing Patches
You should be thinking about your systems security even before you put in your Linux floppies or CD, meaning that you should have a grasp of what packages will need to be installed, what daemons you will be running, what kind of network connections you will have, what services you will require from other machines, whether or not you need a firewall, and so forth.

Installation:
I prefer installing from CD and/or floppies, without an initial network connection. Could be paranoia, but that's in the job description. I believe that this offers protection to a machine, while it is still in a fragile state [without patches applied, without TCP_wrappers installed, without a root password].

Before I begin the installation, I record any network information I will need, namely: IP address, hostname, gateway, DNS servers, NFS server and directories required, NIS/YP server, as well as a list of packages to install/not to install. From there, I boot the machine and begin the installation process.

During the installation process, I always weed out such things as: NFS server, NIS server, mail server, http server, Samba, Netatalk, ftp server, foo server or any other server I won't use or have no idea what it does. WARNING: I, purportedly, know what I am doing and can do this without fear and trepidation. For the average user, I recommend not installing anything that you know you won't be using, such as: