Linux Security Hardening
Linux security hardening is the process of reducing a Linux system's exposed attack surface and enforcing the access, update, logging, and recovery controls its real workload needs.
itLinux | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: Linux Security Hardening
Linux security hardening is the discipline of making a machine do only the work it was built to do, then retaining enough evidence to notice when it wanders off. This is less glamorous than a heroic wall of firewall rules, but considerably more useful. A database server, build runner, laptop, and Kubernetes node need different services, identities, data paths, and recovery arrangements. One universal settings file would therefore be a fine way to break all of them at once.
Start with the host's purpose. Its attack surface is every service, socket, package source, privileged helper, and administrative path that can be reached or misused. Inventory those things before changing them. Then choose a baseline, which is the documented target configuration used to compare later changes. The baseline is not a certificate of virtue. It is the answer to the otherwise awkward question: was this new service meant to be here?
Linux has several overlapping controls. Ownership and permissions decide ordinary file access. Capabilities split parts of traditional root authority. Mandatory access control can add another kernel-enforced decision. A request must survive every applicable layer. That is the surprising bit: making one setting more permissive does not necessarily make the action possible, and making one setting stricter can strand a service that depended on it. The machine is not being difficult. It is being very literal.
Assessment tools such as OpenSCAP help compare the running host with selected security content and profiles. They produce findings, which are evidence for review, not permission slips for mass remediation. Read the profile, rule rationale, exceptions, and service impact. Test changes in small groups, retain a separate management or recovery path, and verify the effective state after each change. A configuration file can look impressively secure while the running service has other opinions.
Hardening also refuses to stay finished. Packages change, accounts accumulate, and configuration drift, the gap between intended and actual state, quietly returns. The Intro explains the control layers and change process. The Slides show the relationships between them. The Cheatsheet is the compact reference for inventory, access controls, sysctl, and assessment. The Quiz tests the judgement calls. Start there, then take the reference path into your distribution's current hardening guide.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://csrc.nist.gov/pubs/sp/800/123/final
Supports
- Server-security control selection, implementation, maintenance, and lifecycle framing
- Access control, audit, configuration management, identification, authentication, maintenance, planning, and system protection as server-security control families
- https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/10/html-single/security_hardening/index
Supports
- System-wide cryptographic policy coverage and explicit override model
- SCAP Security Guide content, profiles, rules, remediation data, and compliance-scan limitation
- Application allowlisting and permissive-to-enforcing rollout example
- https://docs.kernel.org/admin-guide/sysctl/index.html
Supports
- Sysctl as a run-time kernel configuration interface through `/proc/sys/`
- Kernel subsystems exposed through sysctl documentation
- https://docs.kernel.org/security/self-protection.html
Supports
- Kernel self-protection purpose, threat framing, and attack-surface reduction
- https://static.open-scap.org/openscap-1.4.1/oscap_user_manual.html
Supports
- OpenSCAP assessment using a scanner and SCAP content
- SCAP specifications, profiles, and common OpenSCAP operations
- Distribution package examples and remote assessment behavior
- https://www.ssgproject.org/
Supports
- Maintained security-policy content for automated configuration assessment
- https://github.com/decalage2/awesome-security-hardening
Supports
- Discovery of Lynis, OpenSCAP, and Fail2Ban as relevant hardening ecosystem tools
- https://cisofy.com/lynis/
Supports
- Lynis as an auditing tool for Linux and Unix system hardening
- https://www.open-scap.org/
Supports
- OpenSCAP project and toolset destination
- https://www.fail2ban.org/
Supports
- Fail2Ban project destination for log-based response tooling
- https://www.cisecurity.org/cybersecurity-tools/cis-cat-pro
Supports
- CIS-CAT Pro Assessor as a CIS Benchmark assessment product for system configuration
- https://docs.tenable.com/nessus/Content/Compliance.htm
Supports
- Nessus vulnerability scans and compliance audits
- https://www.qualys.com/apps/policy-compliance/
Supports
- Qualys Policy Compliance as a product for policy assessment and reporting
- https://documentation.wazuh.com/current/user-manual/capabilities/sec-config-assessment/index.html
Supports
- Wazuh security configuration assessment policies for endpoint hardening checks
