Skip to main content
  1. Security Insights & Advisories/

Linux Infrastructure Hardening for APAC Systems

·5 mins

Most production Linux systems run closer to their default configuration than anyone wants to admit. The hardening documents exist, often written for an audit years ago, but the servers do not match them. The gap between “documented baseline” and “actual configuration” is where attackers reliably live.

Linux hardening is the discipline of closing that gap, and doing it in a way that survives the next deployment.

Defaults are a starting point, not a posture #

A default Linux install prioritises compatibility, not security. It ships with services you do not use, kernel features you do not need, and logging that is adequate for a desktop but not for a compromised production host. Hardening is the process of turning that general-purpose machine into a purpose-built one.

The heavy lifting falls into a few categories:

  • Kernel and sysctl tuning: network protections (e.g. ignoring ICMP redirects, enabling source-route filtering), filesystem restrictions, and memory protections like address space layout randomisation.
  • Service minimisation: disabling and removing what the host does not run, so there is nothing to exploit that is not in use.
  • Mandatory access control: SELinux or AppArmor to constrain what a process may do, even if it is compromised.
  • Systemd and container hardening: dropping capabilities, blocking raw socket access, and restricting syscalls with seccomp profiles.
  • Audit and logging: capturing the events that matter, shipped off-host so an attacker cannot erase their own tracks.

The CIS Benchmarks remain the most practical, widely recognised codification of these controls, and OpenSCAP automates both applying and auditing them.

Config as code, or it does not exist #

A hardening guide that lives in a wiki is a wish-list. Hardening that lives in code (an Ansible role, a Packer image, a Kubernetes admission policy) is a fact. When the baseline is code, three things change:

  1. It is reproducible. Every new host inherits the baseline, not just the ones someone remembered to configure.
  2. It is testable. A compliance scan in CI fails the build when a setting drifts.
  3. It is reviewable. A change to the baseline is a pull request, with the same review discipline as application code.

This is the difference between hardening as an annual event and hardening as a property of the platform.

Immutability as the end state #

The logical conclusion is immutable infrastructure: hosts and containers are never patched in place, only replaced. A new image is built, scanned, and deployed; the old one is destroyed. Configuration drift becomes impossible because there is nothing to drift: the running system is a build artifact.

Immutable infrastructure pairs naturally with hardening-as-code. You are not maintaining a baseline; you are compiling security into the image. And when a vulnerability appears, the fix is a rebuild, not a midnight SSH session.

flowchart LR A[CIS benchmark baseline as code] --> B[Build hardened image in CI] B --> C[Compliance scan in pipeline] C -- pass --> D[Deploy and rotate instances] C -- fail --> B style C stroke:#0EA5E9,stroke-width:2px style D stroke:#10B981,stroke-width:2px

Beyond the host #

Hardening does not stop at the operating system. The same discipline extends outward in several directions, each with its own failure modes.

Containers inherit everything, then add their own risks. A container image built from an unhardened base layer carries every host-level weakness into every pod that runs it. The fix is upstream: minimal base images, scanned in CI, run as non-root with read-only filesystems, dropped capabilities, and seccomp profiles restricting the syscalls the workload actually needs. The default seccomp profile blocks plenty; a tailored profile tuned to observed syscall behaviour blocks what remains. Kubernetes admission policies enforce all of it fleet-wide, so a non-compliant deployment never schedules at all.

OT environments raise the stakes. In industrial and operational technology settings, hardening collides with availability in ways office IT never sees. A misapplied CIS control on a building management system, a production line PLC network, or a hospital device segment does not produce a finding: it produces downtime, sometimes with safety consequences. OT hardening therefore inverts the usual sequence: passive monitoring and inventory come first, changes happen in maintenance windows with rollback plans, and controls are piloted on mirrors of production before touching anything real. Where IT asks “is this system secure?”, OT must ask “can we secure this without stopping it?”

Drift detection closes the loop. Baselines decay through routine change: an engineer opens a port to debug, an installer re-enables a service, a hotfix never makes it back into code. Without detection, today’s hardened host is next year’s soft one. The pattern that works: configuration scanning on a daily schedule comparing live hosts and images against the coded baseline, with findings routed as alerts to owners rather than filed into a quarterly report nobody reads. Drift detected within a day is a ticket; drift detected within a year is an incident investigation.

A hardened host behind an over-permissive cloud IAM role, or inside an unscanned container pipeline, is still exposed. The durable posture treats the host baseline, the container build chain, the cloud configuration, and the identity boundaries as one continuous surface, monitored as such.

Not sure whether your servers actually match your hardening documents? Reach out for a straightforward, sanity check. Contact me on LINE (@PureSecurity) or email (hello@puresecurity.com).

Our Linux & Infrastructure Hardening delivers baselines as code and automated drift detection, and our Configuration & Architecture Assessment reviews the cloud and identity layer around the host. For a full picture, schedule an Engineering & Scoping Session.