Linux / OS Hardening Articles
Production-ready Linux hardening guides covering kernel parameters, systemd, SELinux, AppArmor, SSH, firewalls, Ansible automation, and more.
Linux Hardening Guides
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
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.
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...
Linux Firewall Hardening with nftables: Replacing iptables in Production
iptables is deprecated. nftables is the replacement in every modern Linux kernel (5.0+).
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.
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.
Time Synchronization Security: Hardening NTP and Chrony Against Manipulation
Accurate time is a silent dependency of almost every security control on a Linux system.
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...
PAM Configuration Hardening: Password Policies, Login Controls, and MFA Integration
PAM (Pluggable Authentication Modules) is the authentication foundation on Linux.
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...
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...
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...
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...
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: