Pcornel
Security

Hardening

Cheat sheet · https://pcornel.dk/topic.php?topic=408

Back to the Topic

Answer

Hardening reduces attack surface and abuse opportunities by applying role-specific secure configuration, least functionality, secure defaults, baseline governance and continuous verification while preserving required service, manageability and recovery.

Remember

  • Hardening ≠ maximizing disabled features without a threat and service model.
  • Compliance percentage ≠ effective security or acceptable residual risk.
  • Desired baseline ≠ deployed, effective and persistent runtime state.
  • Compliant score ≠ secure workload, correct recovery or acceptable residual risk.

First checks

  • CIS/STIG scan results — compliance
  • systemctl list-unit-files --state=enabled — enabled services
  • Config management drift report — deviations

Commands

show running-config
Local state

Verify in this order

baseline → applied → verified → drift detected

Where it usually breaks

First mismatch in asset inventory → applicable baseline/finding → risk/exception decision → remediation → verification → compliance/reporting; preserve identity/policy/pre-state before mutation.

Hardening proof map

BoundaryEstablishDoes not establish
ScopeExact platform/version, role, threat model, required functions and approved profileGeneric benchmark selection does not prove suitability
Effective stateDesired source, deployment, precedence and loaded/runtime valueFile, policy or compliance result alone does not prove enforcement
BehaviorCorrelated allowed/denied test, events and protected workload resultOne blocked action does not prove the intended control caused it
AssurancePersistence, drift monitoring, exception state, recovery and regressionOne-time hardening does not prove maintained secure state

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=408

Confirmation

Confirm action

Continue?