So we begin with a fresh install of the system with the Linux distribution of your choice, and in that installation process we'll choose the security settings for "High" or whatever the equivalent is if the option is available. This should enable package filtering, regulating what is and isn't allowed to connect to your system.
Now whether the Linux system that you are working to secure is a home based ultimate desktop workstation or a firewall that is intended to protect an internal LAN from the outside world, one of the the most important concerns is making sure the system is brought up to date and kept up to date with the current errata, preferably an a freshly installed system so that it can be guaranteed that the system wasn't previously compromised. The errata is basically a list of items containing significant information discovered after the release of the current version of the operation system. This information includes security advisories as well as as other software that could effect the smooth operations or security of the system in question.The errata can be downloaded from the website that maintains the distribution.
After you have determined what the systems purpose is going to be and the system has been installed with errata updates are in place, attention can be turned to tightening the system up.
Connectivity is the first thing I check for. After setting up the network settings, try pinging the system.
You should see results like this:
64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.446 ms
64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=0.155 ms
After I have confirmed that the system is online, the very first thing I do is run nmap. This is one of the most common scanners and there is a fair chance that if someone is running a port scan on the system, they are using nmap.
With my security setting having been set for "High" in the installation process, below is my first scan with nmap using the
Starting nmap 3.20 ( www.insecure.org/nmap/ ) at 2003-03-19 08:41 PST
All 1611 scanned ports on system.foobar.com (192.168.1.10) are: filtered
That's pretty good. It shows that the security settings that you chose are working. But let's double check. We'll run nmap again with an argument that passes through package filters, just like someone who may be looking at getting into your system.
#nmap -sF 192.168.1.10
Starting nmap 3.20 ( www.insecure.org/nmap/ ) at 2003-03-19 09:07 PST
Interesting ports on system.foobar.com (192.168.1.10):
(The 1608 ports scanned but not shown below are in state: closed)
Port State Service
22/tcp open ssh
111/tcp open sunrpc
6000/tcp open X11
nmap run completed -- 1 IP address (1 host up) scanned in 3.147 seconds
It reports that there are three ports open on your system.
Now we come to the utility to harden the system so that we don't have to go through and change all of the config files by hand. For this we will use Bastille Linux.