Web Server audit fixes
Identification & Patching: fixing all 5 checks
Identification and patching inventories the web servers on the host, what their Server header gives away, which user the workers run as, and how far behind nginx, Apache and OpenSSL are on patches.
Two of the skips describe the run rather than the host: Config Syntax skips whenever the audit cannot become root, because nginx -t and apachectl configtest need it, and Web Server Updates skips when no apt, dnf, yum, zypper or apk is present. Worker Process User skips separately when the server is installed but stopped and the nginx config names no user, since there is then no process to read a uid from.
Transcribed from the web-server-security-identification-patching audit script.
Find your finding
Listed in the order the audit runs them. Take the check name from the third field of the result line and open its page.
Web Server Inventory
SoonDetects which web servers are installed and running, and reports their versions
LowNo root2 resultsVersion Disclosure
SoonChecks whether the Server header leaks an exact version and whether server_tokens/ServerTokens suppression is set
LowNo root3 resultsWorker Process User
SoonChecks whether web server worker processes run as root or as a dedicated unprivileged user
HighNo root3 resultsWeb Server Updates
SoonChecks for pending package and security updates across the web stack, including OpenSSL
HighNo root4 resultsWeb Server Config Syntax
SoonRuns the web server config test to confirm the config on disk will reload cleanly
MediumNeeds root3 results
How the Identification & Patching audit reads your server
Every check in this audit runs after the same preamble, and several of its results only make sense once you know what that preamble could and could not see.
All web-server scripts share one preamble. It detects nginx, Apache (apache2/httpd, APROOT = /etc/apache2 or /etc/httpd), Caddy and lighttpd. NGT is nginx -T output (effective config with every include expanded) when root, otherwise a concatenation of nginx.conf, conf.d/*.conf, sites-enabled/*. APC is the concatenated Apache config tree (main file, ports.conf, conf.d, conf-enabled, sites-enabled, mods-enabled, conf.modules.d), comments stripped; APM is apachectl -M (root) or the mods-enabled/*.load names. WROOTS are all root/DocumentRoot values. A live probe curls https://127.0.0.1/, http://127.0.0.1/, http://127.0.0.1:8080/ with the first real server_name/ServerName as Host:. hdr NAME reads a response header; code URL returns the HTTP status. Caddy and lighttpd are detected but their configs are not parsed, so most checks on those hosts rely on the live probe only. Messages ending in "(no live response, config only)" or "(default vhost only - no server_name found to probe)" mean the probe could not be used.
A SKIP is never a pass
A skipped check verified nothing at all. The most common cause is privilege: 1 of the 5 checks in this audit need root for a complete result. Before every run, each script works out which of four privilege modes it is in.
| Mode | How it is reached | What it means for your results |
|---|---|---|
root | The audit runs as UID 0. | Every privileged branch runs directly. No check skips for lack of permission. |
nopass | sudo -n true succeeds, so the account has passwordless sudo. | Privileged commands run through sudo -n. |
pass | A sudo password was supplied in the CtrlOps audit settings and accepted. | Privileged commands run through sudo -S. |
none | None of the above worked. | CAN_ROOT=0. Every privileged branch returns SKIP with a "Need root" message rather than guessing. |
If many checks skip with a “need root” message, run the audit as root, grant the audit account sudo (with or without NOPASSWD), or supply the sudo password in the CtrlOps audit settings.
Identification & Patching questions
Run all 5 Identification & Patching checks, in one click
CtrlOps runs this audit over your existing SSH connection - no agents, no scripts to manage. $7/user/month after a 1 month free trial - no credit card required.
✓ Start instantly·✓ No credit card·✓ No sneaky autorenewals