Home

Awesome

<p align="center"> <a href="https://github.com/trimstray/linux-hardening-checklist"> <img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/linux-hardening-checklist_preview.png" alt="Master"> </a> </p> <br> <p align="center"> <a href="https://github.com/trimstray/linux-hardening-checklist/pulls"> <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?longCache=true" alt="Pull Requests"> </a> <a href="LICENSE.md"> <img src="https://img.shields.io/badge/License-MIT-lightgrey.svg?longCache=true" alt="MIT License"> </a> </p> <br>

Table of Contents

Introduction

In computing, hardening is usually the process of securing a system by reducing its surface of vulnerability, which is larger when a system performs more functions; in principle a single-function system is more secure than a multipurpose one. The main goal of systems hardening is to reduce security risk by eliminating potential attack vectors and condensing the system’s attack surface.

This list contains the most important hardening rules for GNU/Linux systems.

Status

Still work in progress... :construction_worker:

I also created another repository (in a more detailed way): the-practical-linux-hardening-guide.

Todo

Prologue

I'm not advocating throwing your existing hardening and deployment best practices out the door but I recommend is to always turn a feature from this checklist on in pre-production environments instead of jumping directly into production.

Levels of priority

All items in this checklist contains three levels of priority:

OpenSCAP

<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/openscap_logo.png" alt="OpenSCAP" align="left"> <p align="left"><b>SCAP</b> (<i>Security Content Automation Protocol</i>) provides a mechanism to check configurations, vulnerability management and evaluate policy compliance for a variety of systems. One of the most popular implementations of SCAP is <b>OpenSCAP</b> and it is very helpful for vulnerability assessment and also as hardening helper.

Some of the external audit tools use this standard. For example Nessus has functionality for authenticated SCAP scans.</p>

I tried to make this list compatible with OpenSCAP standard and rules. However, there may be differences.

Partitioning

Separate partitions

Restrict mount options

Polyinstantiated directories

Shared memory

Encrypt partitions

:ballot_box_with_check: Summary checklist

<b>Rule</b><b>Priority</b><b>Checkbox</b>
Separate /boot<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Separate /home<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Separate /usr<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Separate /var<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Separate /var/log and /var/log/audit<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/high.png" alt="high">:black_square_button:
Separate /tmp and /var/tmp<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/high.png" alt="high">:black_square_button:
Restrict /usr mount options<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Restrict /var mount options<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Restrict /var/log and /var/log/audit mount options<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Restrict /proc mount options<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Restrict /boot mount options<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Restrict /home mount options<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Restrict /tmp/ and /var/tmp mount options<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Restrict /dev/shm mount options<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Polyinstantiated /tmp and /var/tmp<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Set group for /dev/shm<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Encrypt swap<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:

Physical Access

Password for Single User Mode

:ballot_box_with_check: Summary checklist

<b>Rule</b><b>Priority</b><b>Checkbox</b>
Protect Single User Mode.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:

Bootloader

Protect bootloader config files

:ballot_box_with_check: Summary checklist

<b>Rule</b><b>Priority</b><b>Checkbox</b>
Protect bootloader config files<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:

Linux Kernel

Kernel logs

Kernel pointers

ExecShield

Memory protections

:ballot_box_with_check: Summary checklist

<b>Rule</b><b>Priority</b><b>Checkbox</b>
Restricting access to kernel logs<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Restricting access to kernel pointers<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
ExecShield protection<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Randomise memory space.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:

Logging

Syslog

:ballot_box_with_check: Summary checklist

<b>Rule</b><b>Priority</b><b>Checkbox</b>
Ensure syslog service is enabled and running.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Ensure syslog service is enabled and running.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:

Users and Groups

Passwords

Logon Access

:ballot_box_with_check: Summary checklist

<b>Rule</b><b>Priority</b><b>Checkbox</b>
Update password policy<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Limit password reuse<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Secure /etc/login.defs password policy<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Set auto logout inactive users.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Set last logon/access notification<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Lock out accounts after a number of incorrect login<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:

Filesystem

Hardlinks & Symlinks

Dynamic Mounting and Unmounting

:ballot_box_with_check: Summary checklist

<b>Rule</b><b>Priority</b><b>Checkbox</b>
Enable hard/soft link protection.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/low.png" alt="low">:black_square_button:
Disable uncommon filesystems.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:

Permissions

SELinux & Auditd

SELinux Enforcing

:ballot_box_with_check: Summary checklist

<b>Rule</b><b>Priority</b><b>Checkbox</b>
Set SELinux Enforcing mode.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/high.png" alt="high">:black_square_button:

System Updates

Network

TCP/SYN

Routing

ICMP Protocol

Broadcast

:ballot_box_with_check: Summary checklist

<b>Rule</b><b>Priority</b><b>Checkbox</b>
Enable TCP SYN Cookie protection.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Disable IP source routing.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Disable ICMP redirect acceptance.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Enable ignoring to ICMP requests.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:
Enable ignoring broadcasts request.<img src="https://github.com/trimstray/linux-hardening-checklist/blob/master/static/img/medium.png" alt="medium">:black_square_button:

Services

Tools