Guide to the Secure Configuration of Ubuntu 1604
https://www.open-scap.org/security-policies/scap-security-guide
Providing system administrators with such guidance informs them how to securely configure systems under their control in a variety of network roles. Policy makers and baseline creators can use this catalog of settings, with its associated references to higher-level security control catalogs, in order to assist them in security baseline creation. This guide is a italics="catalog, not a checklist," and satisfaction of every item is not likely to be possible or sensible in many operational scenarios. However, the XCCDF format enables granular selection and adjustment of settings, and their association with OVAL and OCIL content provides an automated checking capability. Transformations of this document, and its associated automated checking content, are capable of providing baselines that meet a diverse set of policy objectives. Some example XCCDF italics="Profiles", which are selections of items that form checklists and can be used as baselines, are available with this guide. They can be processed, in an automated fashion, with tools that support the Security Content Automation Protocol (SCAP). The DISA STIG for Ubuntu 1604, which provides required settings for US Department of Defense systems, is one example of a baseline created from this guidance.
Profile Information
Profile ID | (default) |
---|
CPE Platforms
- cpe:/o:canonical:ubuntu_linux:16.04
Revision History
Current version: 0.1.39
- draft (as of 2023-11-09)
Table of Contents
Checklist
Group Guide to the Secure Configuration of Ubuntu 1604 | |
Group Remediation functions used by the SCAP Security Guide Project | |
[ref] XCCDF form of the various remediation functions as used by remediation scripts from the SCAP Security Guide Project. | |
Group Services | |
[ref]
The best protection against vulnerable software is running less software. This section describes how to review
the software which Ubuntu 1604 installs on a system and disable software which is not needed. It
then enumerates the software packages installed on a default Ubuntu 1604 system and provides guidance about which
ones can be safely disabled.
| |
Group Deprecated services | |
[ref] Some deprecated software services impact the overall system security due to their behavior (leak of confidentiality in network exchange, usage as uncontrolled communication channel, risk associated with the service due to its old age, etc. | |
Group Generic required services | |
[ref] Some services need to be deployed in order to ensure basic verifications and reporting on GNU/Linux operating systems. Each of these service take part in the administrability of the system. | |
Group SSH Server | |
[ref]
The SSH protocol is recommended for remote access (remote login and secure remote file transfer).
SSH provides both confidentiality and integrity for exchanged data but needs to be configured properly in term of: | |
Group Configure OpenSSH Server if deployed | |
[ref]
If the system needs to act as an SSH server, then
certain changes should be made to the OpenSSH daemon configuration
file | |
Group APT service configuration | |
[ref] The apt service manage the package management and update of the whole system. Its configuration need to be properly defined to ensure efficient security updates, packages and repository authentication and proper lifecycle management. | |
Group System Settings | |
[ref] Contains rules that check correct system settings. | |
Group Hardening the hardware usage | |
[ref] Hardware dependent, but efficient against various risks. | |
Group Configure Syslog | |
[ref]
The syslog service has been the default Unix logging mechanism for
many years. It has a number of downsides, including inconsistent log format,
lack of authentication for received messages, and lack of authentication,
encryption, or reliable transport for messages sent over a network. However,
due to its long history, syslog is a de facto standard which is supported by
almost all Unix applications.
| |
Group Rsyslog Logs Sent To Remote Host | |
Group Ensure Proper Configuration of Log Files | |
[ref]
The file auth,authpriv.* /var/log/auth.log *.*;auth,authpriv.none -/var/log/syslog daemon.* -/var/log/daemon.log kern.* -/var/log/kern.log lpr.* -/var/log/lpr.log mail.* -/var/log/mail.log user.* -/var/log/user.log mail.info -/var/log/mail.info mail.warn -/var/log/mail.warn mail.err /var/log/mail.err news.crit /var/log/news/news.crit news.err /var/log/news/news.err news.notice -/var/log/news/news.noticeSee the man page rsyslog.conf(5) for more information.
Note that the rsyslog daemon is configured to use traditional timestamping
to be understood by any log processing program. For high precision timestamping,
comment the following line in /etc/rsyslog.conf :
$ ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat | |
Group Configure <tt>rsyslogd</tt> to Accept Remote Messages If Acting as a Log Server | |
Group Ensure All Logs are Rotated by <tt>logrotate</tt> | |
[ref]
Edit the file /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler \ /var/log/boot.log /var/log/cron {Edit this line so that it contains a one-space-separated listing of each log file referenced in /etc/rsyslog.conf .
All logs in use on a system must be rotated regularly, or the log files will consume disk space over time, eventually interfering with system operation. The file /etc/logrotate.d/syslog is the
configuration file used by the logrotate program to maintain all
log files written by syslog . By default, it rotates logs weekly and
stores four archival copies of each log. These settings can be
modified by editing /etc/logrotate.conf , but the defaults are
sufficient for purposes of this guide.
Note that logrotate is run nightly by the cron job
/etc/cron.daily/logrotate . If particularly active logs need to be
rotated more often than once a day, some other mechanism must be
used. | |
Group Access Control using sudo | |
[ref]
| |
Group Hardening the filesystem | |
[ref] Hardening the filesystem and its usage is an efficient way to ensure an efficient separation of services, data and configurations while ensuring a more precise management of filesystem level access rights, enabling deactivation of some specific rights at the filesystem level. Moreover, the Linux Virtual file system support various hardening mechanisms that can be set using sysctl. | |
Group Partitioning | |
[ref] Separating various locations of the file systems in different partitions allows a more restrictive segregation, distinctly from one location to another. Moreover, some native restrictions can be made by partitioning, such as no hard link between different filesystems, and reduce the corruption impact to the affected filesystem instead of the entire system. The last gain is to allow a differenciated usage of storage media, depending on the operational needs (speed, resilience, etc.). | |
Group filesystem rights management | |
[ref] Adding filesystem specific hardening seriously limits various exploitation vectors based on filesystem invalid usage, such as invalid file types in invalid places (devices or setuid root files in external media, executable file in insecure filesystems, etc.). Some of these hardening require an efficient system partitioning. | |
Group File Permissions and Masks | |
[ref]
Traditional Unix security relies heavily on file and
directory permissions to prevent unauthorized users from reading or
modifying files to which they should not have access.
$ mount -t xfs | awk '{print $3}'For any systems that use a different local filesystem type, modify this command as appropriate. | |
Group Verify Permissions on Important Files and Directories | |
[ref] Permissions for many files on a system must be set restrictively to ensure sensitive information is properly protected. This section discusses important permission restrictions which can be verified to ensure that no harmful discrepancies have arisen. | |
Group Verify Permissions on Files with Local Account Information and Credentials | |
[ref]
The default restrictive permissions for files which act as
important security databases such as | |
Group Verify permissions on files containing sensitive informations about the system | |
[ref] Various files contains sensitive informations that can leads to specific weaknesses or give structural informations for local exploits. | |
Group Restrict Programs from Dangerous Execution Patterns | |
[ref] The recommendations in this section are designed to ensure that the system's features to protect against potentially dangerous program execution are activated. These protections are applied at the system initialization or kernel level, and defend against certain types of badly-configured or compromised programs. | |
Group Disable Core Dumps | |
[ref]
A core dump file is the memory image of an executable
program when it was terminated by the operating system due to
errant behavior. In most cases, only software developers
legitimately need to access these files. The core dump files may
also contain sensitive information, or unnecessarily occupy large
amounts of disk space.
| |
Group Enable ExecShield | |
[ref]
ExecShield describes kernel features that provide
protection against exploitation of memory corruption errors such as buffer
overflows. These features include random placement of the stack and other
memory regions, prevention of execution in memory that should only hold data,
and special handling of text buffers. These protections are enabled by default
on 32-bit systems and controlled through |