Skip to the content.

System Hardening

Hardening

Hardening is the process of applying secure configurations (to reduce the attack surface) and locking down various hardware, communications systems and software, including the operating system, web server, application server and applications, etc.

Reducing system elements

Reducing the number of system elements is a system hardening technique that removes unnecessary software and services to reduce the attack surface.

Configurations

Changing Default Configurations

When setting up new systems or devices, default configurations are often used to simplify the initial setup process. However, these default settings can pose significant security risks if not properly managed. Below are some common default configurations that should be addressed to enhance security.

Configuration management

Configuration management ensures that authorized and validated changes are the only ones made to a system. It involves decision-making and control procedures, focusing on aspects like identification, establishing baselines, and applying updates and patches.

Restricting Applications

Least Functionality

Ensuring systems and devices operate with the least functionality necessary reduces the attack surface and minimizes security risks. This principle involves disabling or removing all non-essential features, services, and applications.

Secure Baseline Image

In large networks, the best solution is to prevent excessive installations. To achieve this, we can use a secure baseline image for all workstations. This image will have:

Noncompliant to Security Baselines

Whenever a device is found not compliant with the security baseline, it may be disabled or isolated into a quarantine area until it can be checked and updated

Filtering Applications

Whitelisting/Allowlisting

Blacklisting/Blocklisting

Graylisting

Trusted Operating Systems (TOS)

Trusted Operating Systems (TOS) are designed with enhanced security features to ensure a higher level of protection and integrity for the system. These systems are particularly suitable for environments where security is a critical concern.

Features

Trusted Operating Systems (TOS) incorporate advanced security features to ensure a high level of protection and integrity. Key features include:

Using Microkernels

Trusted OS enhances security with microkernels by minimizing the trusted base. The trusted computing base includes all the parts of the system that are critical to security and must be trusted to operate correctly.

Integrity 178B

Integrity 178B is a high-assurance, POSIX-based real-time operating system (RTOS) designed for systems requiring stringent security and reliability standards, often used in aerospace, defense, and critical infrastructure.

This operating system is used in numerous aircrafts like the B2-Bimber, F-16, and F-22. This specific operating system is also rated as EAL6.

Common Criteria (CC) Standards

The Common Criteria (CC) standards evaluate the security controls in an operating system to assess their effectiveness. The evaluation is categorized into seven Evaluation Assurance Levels (EALs), each with increasing rigor and assurance.

SELinux

Security-Enhanced Linux (SELinux) is a set of controls that are installed on top of another Linux distribution like CentOS or Red Hat Linux.

Please see Security-Enhanced Linux.

Trusted Solaris

Trusted Solaris is a highly secure version of the Solaris operating system developed by Sun Microsystems (now Oracle). It provides enhanced security features and mechanisms designed to meet the stringent requirements of high-security environments.

Updates and Patches

Patch Management

Patch Management involves updating software to address vulnerabilities and improve security.

Challenges and Best Practices

Terms

Software Patch

Hotfix

Updates

Service Pack

Recommendations

  1. Designate a team to monitor vendor security patches.
  2. Implement automated system-wide patching for OS and apps.
  3. Extend patch management to cover cloud resources.
  4. Prioritize patches as urgent, important, or non-critical.
  5. Validate critical patches in test environments before deployment.
  6. Keep detailed patching logs for evaluation and monitoring.
  7. Define a process for assessing, testing, and applying firmware updates.
  8. Establish a technical procedure for deploying urgent patches.
  9. Regularly review non-critical patches for combined deployment.

Security-Enhanced Linux (SELinux)

Features

Security-Enhanced Linux (SELinux) is a powerful security module for Linux that implements Mandatory Access Control (MAC) policies. Developed by the NSA, it enhances the security of Linux systems through the following features:

Context-based Permission Schemes

SELinux

AppArmor

SELinux Contexts

SELinux defines security contexts for various system entities, helping to enforce access controls and policies.

Common User contexts:

User Context Description
unconfined_u Unrestricted access to resources.
user_u Regular user without admin privileges.
sysadmin_u Access to system administration tasks.
root Superuser with full access to system resources.

Common Role contexts:

Role Context Description
object_r Role assigned to objects such as files and directories.
system_r Role assigned to system-related processes and services.
user_r Role assigned to regular user processes.

Common Type contexts:

Type Context Description
file_t Type assigned to regular files.
dir_t Type assigned to directories.
process_t Type assigned to processes.

To view the SELinux contexts for running processes:

$ ps -eZ 

system_u:system_r:dhcpc_t:s0             1869 ?  00:00:00 dhclient
system_u:system_r:sshd_t:s0-s0:c0.c1023  1882 ?  00:00:00 sshd
system_u:system_r:gpm_t:s0               1964 ?  00:00:00 gpm
system_u:system_r:crond_t:s0-s0:c0.c1023 1973 ?  00:00:00 crond
system_u:system_r:kerneloops_t:s0        1983 ?  00:00:05 kerneloops
system_u:system_r:crond_t:s0-s0:c0.c1023 1991 ?  00:00:00 atd

Multi-level Security Context

SELinux provides support for multi-level security contexts through a fourth context which indicates the sensitivity levels.

Sensitivity Level Description
s0 Lowest sensitivity level
s1 Intermediate sensitivity level
s2 Higher sensitivity level
s3 Highest sensitivity level

SELinux Modes

SELinux operates in three modes:

These modes allow administrators to control SELinux behavior based on their security requirements and system configurations. To show the current mode:

sestatus

To change the mode:

sudo setenforce enforcing   # Switch to enforcing mode
sudo setenforce permissive  # Switch to permissive mode

To completely disable SELinux (switch to disabled mode), change the value of SELINUX to disabled.

sudo nano /etc/selinux/config 

SELinux Policies

SELinux supports various policies, including:

Group Policies

A group policy is a set of rules or policies that can be applied to a set of users or computer accounts within an operating system.

Baselining

The process of measuring changes in the network, hardware, or software environment.


Back to main page