The idea
Abebe looks after the computers at Wrenfield Veterinary Clinic. The contractor who set up the clinic's booking server, appHost, has moved on, and the clinic's insurer wants proof by Friday that its servers meet a security baseline. Abebe has never looked closely at this machine.
Vulnerability management is a loop: scan a host against a security baseline, fix the worst findings first, and rescan until it is clean. Abebe scans appHost with OpenSCAP, watches its files with AIDE, and checks from the admin workstation that the booking page stays up throughout.
Steps
-
Scan: a credentialed scan of the host you run
You cannot fix what you have not found, so the loop starts with a scan. Abebe runs
oscapon appHost itself, with full access to its realsshd_configand file permissions: a credentialed scan. It checks the host against a small baseline and prints pass or fail for each rule.appHost:~# oscap xccdf eval --profile xccdf_org.netlab_profile_baseline --results /root/scan1.xml /root/baseline.xccdf.xml
-
Assess: read each finding's severity and fix the worst first
A list of findings is not a plan. Each rule carries a severity, and the regreSSHion rule also carries a real CVE and its CVSS base score, a 0 to 10 rating of how bad a flaw is. Severity is how you prioritise: the high-severity item goes first.
appHost:~# grep -E "Rule id|severity|CVE-2024|CVSS" /root/baseline.xccdf.xml
-
Remediate and rescan
Two halves close the loop: remediate (apply the fixes) and rescan (prove they worked).
The SSH fixes go in
sshd_config.PermitRootLogin nostops anyone logging in as root directly, so an attacker has to get past an ordinary account first.LoginGraceTime 0is the published mitigation for regreSSHion: the flaw sits in what sshd does when a login takes too long, and0turns that timeout off.The third fix is the backup credentials file. It holds a password that every user on the box can read, so
chmod 600makes it readable by its owner only.Then Abebe runs the same scan again. A fix you never rescan is a fix you only hope worked, and the insurer wants the rescan, not the promise.
appHost:~# chmod 600 /etc/backup.env appHost:~# oscap xccdf eval --profile xccdf_org.netlab_profile_baseline /root/baseline.xccdf.xml
-
Baseline the host's files with AIDE
Scanning finds weak settings. File-integrity monitoring catches a trusted file being changed behind your back. With the host clean, Abebe takes an AIDE baseline, then checks against it right away.
appHost:~# aide --config=/root/aide.conf --init appHost:~# aide --config=/root/aide.conf --check
-
Detect tampering, then restore
On Thursday night someone edits
sshd_configto re-open direct root login. Nobody approved it, and the next settings scan might not run for days, so the integrity check is what catches it. Abebe then restores the file, confirms the baseline holds, and checks the booking page never went down.appHost:~# aide --config=/root/aide.conf --check appHost:~# aide --config=/root/aide.conf --check appHost:~# oscap xccdf eval --profile xccdf_org.netlab_profile_baseline /root/baseline.xccdf.xml admin:~# curl -sS -m3 http://10.0.1.10/