This document describes the process of installing an Ultra Secure Ubuntu Server.
The information provided is biased towards the Ubuntu Trusty Tahr (Ubuntu 14.04 LTS) Server version, but should work with other versions too - perhaps with a few tweaks.
Additional steps should then be taken to harden the server to ensure compatibility with PCI-DSS Compliance standards.
Ubuntu server is well designed, regularly updated and relatively secure. The Ubuntu Security Team manifests an ongoing effort to keep Ubuntu secure. Regular security updates are available and easy to implement.
By default, Ubuntu Servers are secured as follows:
Securing Ubuntu is not very different from securing any other system; In order to do it properly, you must first decide what you intend to do with it. After this, you will have to consider that the following tasks need to be taken care of if you want a really secure system.
The tasks can also be thought of as:
Hardening is a process which aims at securing a system; absolute security is impossible to reach but reducing the surface attack and reaching an equilibrium between security and cost (where with cost we refer to implementation, maintenance and usability costs) is possible.
Hardening a server means, at the practical level, reducing as much as possible the attack surface, and monitoring what is exposed to detect intrusion.
Hardening a system is much easier if you start from a minimalistic system and then add only the needed services. Hardening a complex system is possible but has a higher cost and is much more complicated, since it is easy to forget some (apparently) harmfulness piece of software somewhere in the machine. Even with modern packet managers, handling installed packages isn't an easy task.
To achieve a state of security:
The system will include: system analysis, changing settings for additional hardening against attack, installing a firewall maintenance system, scanning for rootkits, and offering a regular maintenance regimen.
The Ubuntu 14.04 LTS server CD, available here:
A hard disk with a minimum of 20G capacity.
A fast Internet connection.
A server with at least two ethernet cards.
Note that these instructions can still be used if the server only has a single network card. Notes will indicate where minor changes needs to be made to accomodate this.
Having only a single network card will result in a slightly weaker system, but it should still be very secure, so not a major concern.
Items in RED should be changed to meet your requirements.
|This is the username of the primary administrator.
|Recommended to use a strong password.
|This is the group that all administrators will belong to.
IMPORTANT: Do not use the user name admin for the Admin ID as it is a reserved name on Ubuntu 12.04.
|IP Subnet Mask
The IP Address, Subnet Mask and Gateway will probably be provided by your ISP if you have a static IP Address.
If the IP address is returned by your router's DHCP server, then use those settings instead.
|IP Subnet Mask
IMPORTANT: If the system only has one network card, then use eth0:0 as the Interface in place of the eth1 throughout this document unless specifically indicated otherwise.
Do not include a Gateway option onto the internal interface. With it in there, and being the 2nd default gateway that gets configured, it will likely replace or override the 1st gateway on eth0 when the system is initialized, and that path won't work through the router.
|External DNS Server1
|External DNS Server2
220.127.116.11 and 18.104.22.168 are Google's DNS servers. If you wish to use your ISP's DNS servers, use them here instead of Googles servers.
22.214.171.124 and 126.96.36.199 could also be used. They are the OpenDNS DNS servers.
|Internal DNS Server1
|Internal DNS Server2
Multiple DNS servers are recommended to support if one goes down.
These settings are only required if a network bonding / network teaming will also be used.
Network bonding allows multiple network interface cards (NICS) to appear to be the same physical device and also to have the same MAC address. Linux uses a special kernel module called bonding to allow users to bond multiple network interfaces into a single channel.
Bonding effectively aggregates the bandwidth of multiple interfaces into a single connection.
Bonding is used primarily to provide network load balancing and fault tolerance; and is also a way to increase available bandwidth.
Network Bonding may also be called Network Teaming or occasionally Port Trunking.
The bond-primaries should include all interfaces connected to the WAN.
In order to use network bonding with this setup, at least 3 network interface cards need to exist. 2 to connect to the WAN, and at least 1 to the LAN.
Note that you cannot bond the WAN (eth0) and LAN (eth1).
These settings are only required if specific applications are installed.
|Primary Domain Controller
|If using a Domain Controller this will point to the primary DC.
|Secondary Domain Controller
|If using a Domain Controller this will point to the secondary DC.
|HTTP Proxy Server
|If a proxy server is used for HTTP.
|NTP Server IP Address
|If using a NTP server to get standard date/time for the system.
|Remote Email Server
|If using a remote server to deliver emails.
|Admin Email Address
|Email address of the System Administrator.
|MySQL Root Password
|If using MySQL or Maria SQL.
|Windows Share ID
|The ID to use to access the Windows share.
|Windows Share Password
|The password to access the Windows Share.
Use a design that allows for dynamic growth and fine-tuning.
This prevents volumes becoming completely full, which is a definate no!
The Logical Volume Manager (LVM) is used, which lets you add disks, replace disks, copy and share contents from one disk to another without disrupting service (hot swapping).
The following volume will remain outside the LVM.
|boot volume - This will remain static in size. It is also the only space residing outside the Logical Volume Manager (LVM)
The following volume will be within the LVM.
|swap volume - Set to twice the amount of memory in the system. This should remain static in size, however, if the amount of RAM is adjusted, this should be adjusted as well.
|root volume - Operating system and everything else which should remain fairly static.
|usr volume - Contains by far the largest share of data in the system.
|var volume - This is the database/log storage area and will continue to grow over time.
|tmp volume - This location will be used for temporary storage. Adjust size as required.
|srv volume - This will contain the files stored in the Samba share.
|opt volume - This location is occasionally used for specific software.
|home volume - This is where personal user files will be stored.
|backup volume - This will contain a local backup of any databases and other important data, so space needs to be around double /var.
|sharewiz volume - This will contain scripts used to administor the system, and should remain fairly static.
Even though the above sizes will fill most of a 20GB hard drive, it it recommended to still use the same sizes even if you have a far bigger drive.
The system will auto grow the necessary partitions as required.
The exception to this is for the /var partition, which could be made much bigger if you know for instance that a large database will be installed into it.
If you do increase the size of the /var partition then remember to also increase the size of the /backup partition accordingly.
See Disk Security for further information.