Linux / OS Hardening Articles

Production-ready Linux hardening guides covering kernel parameters, systemd, SELinux, AppArmor, SSH, firewalls, Ansible automation, and more.

Linux Hardening Guides

advanced 14 min read

dm-verity and dm-integrity: Tamper-Evident Block-Level Roots for Production Linux

dm-verity gives you a read-only root that fails to mount if a single block is tampered with. dm-integrity adds runtime checksumming. Together: immutable, evidence-bearing systems.

advanced 14 min read

eBPF-LSM (lsm_bpf): Kernel Security Policy as Hot-Loadable BPF Programs

lsm_bpf attaches eBPF programs to LSM hooks. Define security policy in code, push without reboot, audit at the syscall boundary. AppArmor for cloud-native systems.

intermediate 14 min read

Linux Capability Hardening: Dropping Privileges from Daemons and Services

Ambient capabilities, CapDrop in systemd units, auditing capability use with auditd and bpftrace. Least-privilege for services that run as root by legacy necessity.

intermediate 13 min read

USBGuard: USB Device Authorization on Production Linux Hosts

USB devices are a peripheral attack surface most servers ignore. USBGuard provides allowlist-based authorization, blocking BadUSB and malicious-cable threats.

intermediate 13 min read

FIDO2 SSH with sk-* Keys: Hardware-Backed Authentication for Production Hosts

ed25519-sk and ecdsa-sk bind SSH keys to a hardware token. Phishing-resistant, exfiltration-proof, increasingly the default. Two short commands to switch.

intermediate 14 min read

Kernel Lockdown Mode: Blocking Root from Modifying the Running Kernel

Lockdown mode separates root from kernel. integrity blocks code modification; confidentiality also blocks reads. Cheap, broad, underused.

advanced 16 min read

Landlock LSM: Unprivileged Kernel Sandboxing for Production Linux Applications

Landlock lets an unprivileged process restrict its own filesystem and network access at the kernel level. AppArmor without root, seccomp with semantics.

advanced 16 min read

io_uring Security and Hardening: Disabling, Restricting, and Auditing a Bypass-Prone Syscall Interface

io_uring gives userspace a submission queue that sidesteps the normal syscall path. It has produced a steady stream of kernel CVEs and routinely bypasses seccomp.

intermediate 24 min read

Secure Cloud VM Access: SSH Key Authentication, Two-Factor Login, VPN, and Audit Logging

Cloud VMs exposed to the internet with password-only SSH are compromised within hours. This article covers the complete secure access stack: SSH key authentication, TOTP two-factor login, WireGuard VPN as a network-layer gate, and audit logging to track who did what and when.

intermediate 20 min read

SSH Hardening Beyond the Basics: Certificate Authentication, Jump Hosts, and Logging

Every SSH hardening guide starts and ends with the same three changes: disable root login, require key-based authentication, change the default port.

intermediate 15 min read

Hardening DNS Resolution on Linux: systemd-resolved, Unbound, and DNS-over-TLS

Most Linux hosts resolve DNS in plaintext over UDP port 53. On a stock Ubuntu 24.04 or RHEL 9 system:

intermediate 18 min read

Hardening the Linux Kernel Attack Surface with sysctl and Boot Parameters

Linux kernels ship with defaults optimised for compatibility, not security. On a stock Ubuntu 24.04 or RHEL 9 installation.

advanced 14 min read

Hardening GRUB and the Boot Process: Secure Boot, Boot Passwords, and Tamper Detection

Without boot security, an attacker with physical access or console access (BMC, IPMI, cloud serial console) to a Linux system can.

intermediate 13 min read

Hardening /proc and /sys: Restricting Kernel Information Disclosure

/proc and /sys are virtual filesystems that expose kernel internals, hardware details, and process information to userspace.

intermediate 16 min read

Linux Audit Framework Deep Dive: auditd Rules, auditctl, and ausearch for Security Monitoring

auditd is the kernel-level audit system on Linux, it captures syscalls, file access, user commands, and privilege changes that no userspace tool can...

intermediate 16 min read

Linux Firewall Hardening with nftables: Replacing iptables in Production

iptables is deprecated. nftables is the replacement in every modern Linux kernel (5.0+).

intermediate 15 min read

Cgroup v2 Resource Isolation: Preventing Resource Exhaustion Attacks on Shared Systems

Without resource limits, a single service, container, or compromised process can consume all available CPU, memory, I/O bandwidth, or PIDs on a host.

advanced 18 min read

SELinux in Production: Writing Custom Policies Without Losing Your Mind

SELinux is the most powerful mandatory access control system on Linux, and the most disabled. The result: services have no MAC confinement.

intermediate 14 min read

Time Synchronization Security: Hardening NTP and Chrony Against Manipulation

Accurate time is a silent dependency of almost every security control on a Linux system.

intermediate 22 min read

Automated OS Hardening with Ansible: A Production-Ready Playbook Collection

Manual OS hardening does not scale. The sysctl settings from Hardening the Linux Kernel Attack Surface with sysctl and Boot...

intermediate 14 min read

PAM Configuration Hardening: Password Policies, Login Controls, and MFA Integration

PAM (Pluggable Authentication Modules) is the authentication foundation on Linux.

intermediate 13 min read

Kernel Module Hardening: Blacklisting, Signing, and Preventing Runtime Loading

The Linux kernel loads modules on demand. When a process requests a capability that is not built into the running kernel (a filesystem type, a...

intermediate 16 min read

Hardening Container Base Images: From ubuntu:latest to a Minimal, Signed, Scannable Image

ubuntu:latest ships with over 200 packages. At any given point, a vulnerability scan with Trivy will report 50 or more CVEs, most of which are in...

intermediate 14 min read

AppArmor Profiles for Custom Applications: From Complain Mode to Enforce

AppArmor is the default mandatory access control system on Ubuntu and Debian. It restricts applications to specific file paths, capabilities, and...

intermediate 20 min read

systemd Unit Hardening: ProtectSystem, PrivateTmp, and the Full Sandbox Toolkit

systemd provides over 30 security-relevant directives for sandboxing services, yet the vast majority of unit files (including those shipped by...

intermediate 14 min read

Filesystem Mount Options That Matter: noexec, nosuid, nodev, and Beyond

Default Linux installations mount most filesystems with permissive options. On a stock Ubuntu 24.04 or RHEL 9 system: