Securing Linux Step-by-Step
From ChekMate Security Group
[edit]
BEFORE INSTALLATION
[edit]
DETERMINE THE SECURITY NEEDS
[edit]
Define security policies
[edit]
PHYSICALLY SECURE THE COMPUTER
[edit]
BIOS SECURITY : PASSWORD PROTECTION,LIMITING REBOOTS
[edit]
Disable “AUTO” settings
[edit]
Disable booting from removable media
[edit]
Set a BIOS password
[edit]
SCSI BIOS setups
[edit]
Document BIOS settings
[edit]
INSTALL LINUX
[edit]
DISCONNECT THE MACHINE FROM THE NETWORK
[edit]
SELECT INSTALLATION CLASS : WORKSTATION, SERVER, OR CUSTOM
[edit]
DEFINE PARTITIONS
[edit]
Define Workstation partitions
[edit]
Define Server partitions
[edit]
Document the partition scheme
[edit]
SELECT PACKAGES TO INSTALL
[edit]
Workstation packages
[edit]
Server packages
[edit]
Let the installation proceed
[edit]
CONFIGURE THE SYSTEM SECURITY AND ACCOUNT POLICIES
[edit]
Shadow Passwords with MD5 hashing
[edit]
Set passwords for root and all user accounts
[edit]
FINAL LINUX INSTALLATION RECOMMENDATIONS
[edit]
Create a boot diskette
[edit]
Tighten up settings in /etc/inittab
[edit]
Password protect LILO boots
[edit]
SET SYSTEM ACCESS SECURITY POLICIES
[edit]
Check that remote root logins are disabled for TELNET
[edit]
Check that remote root logins are disabled for FTP
[edit]
Configure the system accounts that can/cannot log into the system
[edit]
Configure the system groups that can/cannot use specific resources
[edit]
CONFIGURE LOGGING
[edit]
Optimize SYSLOG settings
[edit]
Configure real-time logging to VTYs
[edit]
Configure log rotation
[edit]
Configure remote logging
[edit]
Synchronize system clock with log server
[edit]
STEP 3 SECURING WORKSTATION NETWORK CONFIGURATIONS
[edit]
DISABLE INTERNET DAEMON SERVICES
[edit]
Edit /etc/inetd.conf and comment out all services
[edit]
Turn off inetd if there are no services
[edit]
USE TCP WRAPPERS TO CONTROL ACCESS TO REMAINING INETD SERVICES
[edit]
Set the default access rule to deny all
[edit]
Allow access to only specific hosts for specific services
[edit]
Check the syntax of the access lists with tcpdchk
[edit]
Set up banners for TCP wrapped services
[edit]
DISABLE RUN-TIME NETWORK SERVICES
[edit]
Determine which network services are running
[edit]
Eliminate unnecessary services
[edit]
Check for any remaining services
[edit]
GET THE LATEST VERSIONS OF SOFTWARE
[edit]
Find security-related updates
[edit]
Download updates
[edit]
Install updates
[edit]
Automate the process
[edit]
Use AutoRPM to automate updates
[edit]
Subscribe to security-related mailing lists
[edit]
CACHING-ONLY DOMAIN NAME SERVICE (DNS)
[edit]
Disable and remove DNS server software
[edit]
Set primary and secondary name servers
[edit]
ELECTRONIC MAIL
[edit]
Turn off sendmail daemon mode
[edit]
Define SMTP server for mail clients
[edit]
Set out-bound SMTP server for sendmail
[edit]
Set out-bound SMTP server for other mail clients
[edit]
NFS CLIENT-SIDE SECURITY
[edit]
Turn off NFS exports and remove NFS daemons
[edit]
Configure local NFS mounts
[edit]
LIMIT WORLD WIDE WEB SERVICES TO THE LOCAL HOST
[edit]
Turn off HTTP and remove the server software
[edit]
Limit HTTP access to localhost only
[edit]
REMOVE ANONYMOUS FTP SERVICE
[edit]
SECURING SERVER NETWORK CONFIGURATIONS
[edit]
SERVERS: SEE STEPS3.1, 3.2, 3.3, AND 3.4 FOR DISABLING ALL UNNECESSARY SERVICES, SETTING WRAPPERS, AND UPDATING SOFTWARE
[edit]
INSTALL SECURE SHELL FOR REMOTE ACCESS
[edit]
Download, compile, and install SSH
[edit]
Start the SSH daemon
[edit]
Set up /etc/hosts.allow for SSH access
[edit]
Generate SSH keys
[edit]
Use SSH and SCP for remote access
[edit]
Replace ‘r’ programs with SSH
[edit]
DOMAIN NAME SERVICE AND BIND VERSION 8
[edit]
Restrict zone transfers
[edit]
Restrict queries
[edit]
Run named in a chroot jail
[edit]
Create the new user and group
[edit]
Prepare the chroot directory
[edit]
Copy configuration files and programs
[edit]
Copy shared libraries
[edit]
Set syslogd to listen to named logging
[edit]
Edit the named init script
[edit]
Specify a new control channel for ndc
[edit]
ELECTRONIC MAIL
[edit]
Turn off SMTP vrfy and expn commands in /etc/sendmail.cf
[edit]
Define hosts allowed to relay mail
[edit]
Check that the access database is active
[edit]
Set access for domains allowed to relay
[edit]
Set domain name masquerading
[edit]
Install an alternative MTA
[edit]
Secure the POP and IMAP daemons
[edit]
Get the latest version of POP and IMAP daemons
[edit]
Control access to POP and IMAP with TCP wrappers
[edit]
Install an alternative POP or IMAP daemon
[edit]
Install an SSL wrapper for secure POP/IMAP connections
[edit]
PRINTING SERVICES
[edit]
List allowed remote hosts in /etc/hosts.lpd
[edit]
Replace Berkeley lpr/lpd with LPRng
[edit]
Download and install LPRng
[edit]
Set remote hosts and/or networks that are allowed access
[edit]
NETWORK FILE SYSTEM
[edit]
Set access to RPC services in /etc/hosts.allow
[edit]
Limit exports to specific machines with specific permissions
[edit]
SERVER MESSAGE BLOCK (SMB) SAMBA SERVER
[edit]
Get the latest version of Samba
[edit]
Limit access to specific hosts
[edit]
Use encrypted passwords
[edit]
Remove “guest” or anonymous shares
[edit]
Set default file creation masks
[edit]
CENTRAL SYSLOG HOST
[edit]
Configure syslogd to accept remote log messages
[edit]
Configure log rotation
[edit]
FILE TRANSFER PROTOCOL (FTP)
[edit]
Limit access with TCP wrappers
[edit]
Limit permitted operations in /etc/ftpaccess
[edit]
Protect incoming directory
[edit]
HYPER TEXT TRANSFER PROTOCOL (HTTP) SERVER
[edit]
Set basic access to default deny
[edit]
Selectively open access to specific directories
[edit]
Selectively allow options on specific directories
[edit]
Selectively use .htaccess to override access control
[edit]
Use password protection for sensitive data
[edit]
Use SSL for secure HTTP communications
[edit]
Download OpenSSL and mod_ssl
[edit]
Build OpenSSL
[edit]
Build Apache with mod_ssl module
[edit]
Start Apache with mod_ssl and test
[edit]
Read the mod_ssl documentation
[edit]
TUNING AND PACKET FIREWALLS
[edit]
KERNELS : THOUGHTS ABOUT CONFIGURATION, RECOMPILING, AND INSTALLING A NEW KERNEL
[edit]
System optimizations
[edit]
TCP/IP Receive Window size
[edit]
PACKET FIREWALLS AND LINUX IP MASQUERADING
[edit]
Getting more from your external connection with IP Masquerade
[edit]
A strong /etc/rc.d/rc.firewall ruleset
[edit]
Double check, install, and test the firewall
[edit]
Make the ruleset executable
[edit]
Load the ruleset while at the console of the Linux server
[edit]
Test the firewall ruleset
[edit]
Analyze a typical IPCHAINS firewall ruleset hit
[edit]
Running the firewall ruleset upon every reboot
[edit]
TOOLS
[edit]
HOST-BASED MONITORING AND INTRUSION DETECTION
[edit]
Swatch, the Simple WATCHer
[edit]
Psionic Logcheck
[edit]
Tripwire
[edit]
Tripwire databases
[edit]
Running Tripwire
[edit]
Use rpm to verify package files
[edit]
Psionic PortSentry
[edit]
HOST-BASED VULNERABILITY ANALYSIS: LOOKING FROM THE INSIDE OUT
[edit]
Tiger, the Texas A&M system checker
[edit]
Install and configure Tiger
[edit]
Running Tiger
[edit]
Changing Tiger checks
[edit]
TARA, an updated version of Tiger
[edit]
NETWORK-BASED VULNERABILITY ANALYSIS: LOOKING FROM THE OUTSIDE IN
[edit]
SATAN derivatives: SARA and SAINT
[edit]
Nessus
[edit]
Nmap port scanner
[edit]




