Junior Cybersecurity Analyst

Security Controls & System Hardening

Turn principles into practice: the control categories (preventive/detective/corrective), least privilege, patching, logging, and a practical hardening baseline.

25 min

1. Executive Summary & Objective

Principles (CIA, Zero Trust) become real through controls and hardening. This capstone lesson organizes controls by type and gives you a practical baseline to shrink a system’s attack surface.

Objective: Classify controls as preventive/detective/corrective, apply least privilege and patching, and build a hardening baseline you can defend.

2. Core Concept & Theory (The β€œWhy”)

Controls are commonly categorized by when they act relative to an incident:

They’re also grouped as technical (firewall, encryption), administrative (policies, training), and physical (locks, badges). A healthy program has all three, across all three timings.

3. A Practical Hardening Baseline

  1. Least privilege β€” remove local admin, scope service accounts, use role-based access.
  2. Patch β€” prioritize internet-facing and known-exploited CVEs; automate where safe.
  3. Reduce surface β€” disable unused services/ports; remove default accounts and sample apps.
  4. Harden auth β€” MFA everywhere, strong password policy, lockouts.
  5. Log centrally β€” forward to a SIEM so logs survive the host and feed detection.
  6. Baseline + benchmark β€” apply a CIS Benchmark / STIG and measure drift.

4. Command Execution (Linux hardening snippets)

# Who has a login shell / is privileged?
getent passwd | awk -F: '$7 !~ /nologin|false/ {print $1}'
sudo grep -E '^sudo|^wheel' /etc/group

# Remove an unneeded service and close its surface
sudo systemctl disable --now telnet.socket 2>/dev/null

# Ship logs off-box (survives attacker log wiping)
echo '*.* @10.0.0.60:514' | sudo tee /etc/rsyslog.d/90-forward.conf
sudo systemctl restart rsyslog

5. Hands-on Lab

Apply three core hardening steps on a Linux host.

Lab: Linux hardening baseline

Audit privileged users, disable an unused service, and forward logs to the SIEM.

Objectives

  • List who has sudo (privileged) rights.
  • Disable an insecure/unused service to cut attack surface.
  • Forward logs off-box to the SIEM.
  • Apply the logging change.
Console - host
Practice terminal: it checks the commands you type and shows example output. It is not connected to a real device.
Work through the objectives on the left.
Stuck? Type "?" to see the current objective, or "hint" to reveal the command.
host#

Hands-on: enforce a password policy in code

Security controls aren’t abstract β€” a password policy is just a function that returns pass or fail. Implement it in real Python.

Password Policy Checker β€” Python 3
YOUR CODE (edit here, then press Run)
Ctrl/⌘ + Enter
OUTPUT

That function is exactly what an identity provider or PAM module runs on every password change β€” β€œhardening” is policy, enforced automatically.

6. Key Takeaways

  • Classify controls by timing: preventive β†’ detective β†’ corrective, across technical/admin/physical.
  • Least privilege shrinks blast radius; patching closes known exploits.
  • Reduce attack surface β€” disable what you don’t need.
  • Central logging makes you able to detect, investigate, and prove incidents.

πŸ§ͺ Want to practise this on your own computer? See how to set up your lab →

πŸ€–

Need clarification? Ask GT

Hi, I'm GT β€” your AI tutor for Security Controls & System Hardening. What would you like to know?
πŸ“

Knowledge Check

1 of 4

An IPS that blocks an exploit inline is which type of control?

Report a problem

About: /lessons/security-controls-and-hardening