Home / Blog / Cheat Sheets

Beginner Cheat Sheets

System Hardening Basics: What Analysts Should Check First

A beginner guide to system hardening: baselines, CIS Benchmarks, least functionality, quick Windows and Linux checks, and the log events that show a system drifting from its secure state.

A brand new server is built to be easy to use, not to be safe. System hardening is the job of closing that gap, and as a SOC (Security Operations Centre) analyst you will meet it every time an alert says a machine is "misconfigured". This guide explains the ideas, the standards behind them, and a few quick checks you can run yourself.

TopicSystem hardening and secure baselines
You will meet it inVulnerability reports, audits, alert triage
You will learnBaselines, least functionality, drift checks
>

Scenario: A vulnerability scan flags a new file server, FS-OPS-07 (10.0.4.22). It still has the old SMBv1 file sharing protocol switched on, an unused service listening on a high port, and a default local account nobody remembers creating. Nothing has been attacked yet. Your task is to understand why these three findings matter and what to ask the server owner.

What system hardening means

System hardening means reducing the ways a system can be attacked by changing it from its default state to a safer one. You switch off what is not needed, tighten what is left, and keep it that way over time.

Another name for the "ways in" is the attack surface. Every running service, open port, spare account and old protocol adds to it. A hardened system simply has less of each.

The key habit is that hardening is never finished. A system can be perfect on build day and drift away from that state a month later, so the work is a loop: set, check, fix, repeat.

Baselines, benchmarks and the standards behind them

A secure baseline is the approved configuration for one type of system, for example "Windows Server file server" or "Ubuntu web server". Without a baseline nobody can say whether a machine is right or wrong, because there is nothing to compare it with.

Most teams do not invent baselines from scratch. They start from published guidance and adjust it. Three names come up again and again.

NameWhat it isHow you will use it
CIS Controls v8A list of 18 security controls from the Center for Internet Security. Control 4 is Secure Configuration of Enterprise Assets and Software.Tells you what a good process looks like, such as managing default accounts (4.7) and removing unneeded services (4.8).
CIS BenchmarksDetailed settings lists for one product, such as one Windows or Linux version. Most have Level 1 and Level 2 profiles.Gives the exact setting values to check a system against.
NIST SP 800-53A catalogue of security controls. Its configuration management family includes CM-2 (baseline configuration), CM-6 (configuration settings) and CM-7 (least functionality).Appears in audit reports and policies, so it helps to recognise the names.
+

Tip: Level 1 in a CIS Benchmark is the safe starting set that rarely breaks applications. Level 2 is stricter defence in depth that needs testing first. Do not mix this up with the Controls, which use Implementation Groups (IG1, IG2, IG3) instead of levels.

Five areas every hardening checklist covers

Checklists for different systems look long, but they keep returning to the same five themes. Learn these and any benchmark becomes easier to read.

Least functionalityRemove or disable software, services, ports and protocols the system does not need for its job.
PatchingApply operating system and application updates so known flaws are closed.
AccountsRename, disable or remove default accounts, give users only the access they need, and use strong authentication.
Remote accessLimit RDP (Remote Desktop Protocol) and SSH (Secure Shell) to approved sources, and turn off password logins where keys are used.
LoggingTurn on the audit settings that let you investigate later, and send the logs to your SIEM (Security Information and Event Management) tool.

Notice that the last one is about you. A system that is hardened but silent is still a problem, because if it is attacked you will have nothing to read.

Quick checks you can run

You do not need to change anything to look. These read-only commands show what a system is exposing. Always run them only on systems you are allowed to check, and ask before changing a setting on a live server.

On Windows

WindowsPowerShell
Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol

Get-Service | Where-Object { $_.Status -eq 'Running' } |
    Select-Object Name, DisplayName, StartType

Get-NetTCPConnection -State Listen |
    Select-Object LocalAddress, LocalPort, OwningProcess
  • Line 1 shows whether the SMBv1 server component is enabled. Microsoft strongly encourages not using SMBv1 because of its security weaknesses.
  • Lines 3 and 4 list running services and how they start, so you can spot ones that should not be there.
  • Lines 6 and 7 list ports the machine is listening on. OwningProcess is the process ID, which you can match to a program.

On Linux

LinuxBash
ss -tulpn
systemctl list-unit-files --state=enabled
sudo sshd -T | grep -Ei 'permitrootlogin|passwordauthentication'
  • Line 1 lists listening TCP and UDP ports and the program behind each one (the p option needs sudo to show everything).
  • Line 2 lists services set to start at boot.
  • Line 3 prints the live SSH server settings and keeps only two lines, so you can see whether root login and password login are allowed.
!

Watch out: A listening port is not automatically bad. Many servers need dozens. The question to ask is "does this system need this for its job?", and the owner or the build documentation usually knows the answer.

Common leftovers that raise risk

Old protocols such as SMBv1

High
Why it matters

It has well known security weaknesses and is rarely needed on modern systems.

What to ask

Which device or program still needs it, and can that be replaced or upgraded?

Default or shared accounts

High
Why it matters

Known account names are an easy target for password guessing, and shared accounts hide who did what.

What to ask

Who owns the account, and can it be disabled, renamed or replaced with named accounts?

Unneeded services and open ports

Medium
Why it matters

Every extra listener is something an attacker can probe for a weakness.

What to ask

Is this service in the build document, and is it reachable from networks that should not see it?

Spotting drift in your logs

Configuration drift means a system slowly moves away from its baseline, either by accident or on purpose. As an analyst you rarely fix drift yourself, but you can notice the moment it happens. These Windows events are a good start.

  • Event 7045 in the System log: a new service was installed (source: Service Control Manager).
  • Event 4697 in the Security log: a service was installed. It needs the Security System Extension audit setting to be switched on.
  • Event 4719 in the Security log: the system audit policy was changed. Someone reducing logging deserves a closer look.
  • Event 1102 in the Security log: the audit log was cleared.

Here is a short Splunk search to see which hosts are installing services. The index name is a placeholder, so use the one your team has.

SplunkSPL
index=wineventlog sourcetype="WinEventLog:System" EventCode=7045
| stats count by host
| sort - count
  • Line 1 finds service installation events in the Windows System log.
  • Line 2 counts them for each host.
  • Line 3 puts the busiest host first.

Expect false positives. Software installs, patches and new agents all create services. Before you escalate, check the service name, the file path it runs from, and whether there is an approved change ticket for that server and time. Odd names and paths in user folders are worth a second look.

How this appears in a real SOC shift

You will usually meet hardening through someone else's output: a vulnerability scan, an audit finding, or an alert about a risky setting. Your job is to read it, judge how exposed the system is, and pass clear facts to the team that owns it.

It also helps with incident work. When you investigate a compromised machine, knowing the baseline tells you what normal looked like, so the odd service or open port stands out. MITRE ATT&CK lists Operating System Configuration (M1028) as a mitigation, which is another way of saying that good hardening makes many attack techniques harder.

For study, hardening and secure baselines are part of the Security Operations material in CompTIA Security+ (SY0-701), and configuration themes also support the CySA+ syllabus. Check the official CompTIA objectives page for the current wording before you rely on any list.

i

Note: Hardening changes can break applications. Real teams test changes, record them in a change ticket, and keep a way back. Treat any "just switch it off" advice with care.

What to study next

  1. Read the free overview of CIS Controls v8, Control 4, and note safeguards 4.1, 4.7 and 4.8.
  2. Look at the table of contents of one CIS Benchmark for an operating system you use, and spot how it is organised.
  3. In a home lab, run the read-only commands above on a test machine and write down what surprises you.
  4. Next in this series, look for the guide on network segmentation and Zero Trust, which hardens the space around the system.

Key takeaways

  1. Hardening means reducing the attack surface by removing what is not needed and tightening what remains.
  2. A baseline is the approved configuration. Without one you cannot tell right from wrong.
  3. CIS Benchmarks give exact settings, CIS Controls give the process, and NIST CM controls appear in audits.
  4. Level 1 is the safe starting point. Level 2 is stricter and needs testing.
  5. Services, patching, accounts, remote access and logging cover most checklists.
  6. Watch for drift: new services (7045, 4697), audit changes (4719) and cleared logs (1102).

Hardening can feel like a long list of settings, but the idea underneath is simple: less running, fewer doors, better logs. Start by learning what a normal system in your own environment looks like, and the odd ones will begin to stand out.

Written by Ben, Cybersecurity Student

Keep going

More in Cheat Sheets