System and Endpoint Hardening Questions
Making operating systems, hosts, and endpoints resistant to compromise. Covers secure baseline configuration (CIS Benchmarks, Microsoft security baselines) and drift against the baseline, including detecting drift and deciding what to report versus auto-correct, OS and application hardening for Linux and Windows (SSH, host firewalls, service minimization, SELinux and AppArmor, file permissions, least privilege, application allow-listing, local administrator accounts), patch management and rollout (asset inventory, prioritisation, patch cadence, deployment rings and canaries, maintenance windows, emergency and out-of-cycle patching, post-patch verification, rollback, patch compliance metrics, immutable images, Windows and Linux update tooling such as Windows Update for Business, Intune, WSUS, Configuration Manager and Azure Update Manager), scripted audits and enforcement of host settings (Ansible, PowerShell, shell), and the host-side conditions that protect an endpoint (device posture checks, disk encryption, protection agent status). The host-level preventive layer. Detecting and investigating attacks, vulnerability scanning and scoring, network device and perimeter security, identity and key management, Active Directory attack hardening, operating WSUS or ConfigMgr as server roles, and container platform security are covered elsewhere.
Write a script that compares a security baseline for a Linux host (SSH settings, sysctl values, file modes, enabled services) against the host's current state and reports drift as a short human-readable summary plus machine-readable JSON. The baseline can have missing keys and per-setting defaults. How do you structure the comparison so that adding a new kind of check is easy?
Sample Answer
Direct answer
Read a JSON baseline, run one small check function per kind of setting (SSH, sysctl, file mode, service), compare each observed value with the expected one, and give every check one of four statuses: ok, drift, not_applicable or error (could not be evaluated). Print a short summary of the problems and write the full result as JSON. Adding a new kind of check means writing one function and registering it with a decorator: the loader, comparison engine, summary and JSON writer do not change. The script only reads (it opens files, calls os.stat, and runs the query systemctl is-enabled), so it never repairs anything.
Plain meanings of the terms. sshd is the SSH server and sshd_config its settings file. A sysctl value is a kernel setting, readable as a file under /proc/sys where the dots in the name become slashes (net.ipv4.ip_forward is /proc/sys/net/ipv4/ip_forward). A file mode such as 0640 means owner read and write, group read, others nothing. systemctl is the command line of the systemd service manager. A Match line in sshd_config starts a conditional block whose settings apply only to connections that match it.
Design decisions
| Decision | Choice | Reason |
|---|---|---|
| Baseline format | JSON with a defaults block and a checks list; every check has an id, a type and an expected value (or max_mode for file modes) | Defaults for severity and on_missing are stated once; any check can override them |
| Missing setting | Three outcomes: the check supplies a default (the daemon's documented default is then compared), or on_missing is not_applicable, or the setting counts as drift | A missing key is only drift when the baseline says the absence matters. For example PermitEmptyPasswords defaults to no in sshd_config(5), so an absent line is compliant when the baseline expects no |
| Expecting absence | "expected": "absent" | For something that should not exist (a telnet socket), a Missing result is the compliant outcome and is reported ok; if the thing exists, its state (for example enabled) is compared with absent and reported as drift |
| Extensibility | @check("kind") registry: a check function returns the observed value or raises Missing or CannotEvaluate | The engine never needs to know what a kind does |
| File modes | max_mode means "no more permissive than this", so 0600 passes a 0640 limit; exact expected is also supported | A file that is stricter than the baseline is not drift in most baselines |
| JSON schema | schema_version, host, summary counts, results list with fixed keys and a fixed status vocabulary, sorted keys, no timestamp | Stable output diffs cleanly and downstream tooling can rely on it; the collector adds the timestamp |
| Exit codes | 0 clean, 1 drift found, 2 nothing drifted but some checks could not run | A scheduler can alert on non-zero and tell the cases apart |
| Read-only | No writes except the report file the caller names | Detect only; remediation is a separate, reviewed step |
The script
Two Python constructs carry the design. CHECKS is a dictionary from a kind name to a function, and @check("sshd") above a function is a decorator: it runs CHECKS["sshd"] = check_sshd when the file loads, so registering a new kind is one line above its function. class Missing(Exception) and CannotEvaluate are custom error types: a check function signals "the thing is not there" or "I could not look" by raising one, and evaluate catches them in one place and turns them into statuses, so no check function needs to know about statuses.
#!/usr/bin/env python3
"""Read-only drift check of a Linux host against a JSON security baseline."""
import argparse
import json
import os
import socket
import subprocess
import sys
CHECKS = {}
def check(kind):
"""Register a check type. Adding a new kind of check means adding one function."""
def register(fn):
CHECKS[kind] = fn
return fn
return register
class Missing(Exception):
"""The thing being checked does not exist on this host."""
class CannotEvaluate(Exception):
"""The check could not run (tool absent, permission denied)."""
def norm(value):
return " ".join(str(value).split()).lower()
@check("sshd")
def check_sshd(spec, ctx):
path = ctx["root"] + spec.get("file", "/etc/ssh/sshd_config")
try:
with open(path, encoding="utf-8") as fh:
lines = fh.read().splitlines()
except FileNotFoundError:
raise Missing(path)
except PermissionError as exc:
raise CannotEvaluate(str(exc))
wanted = spec["key"].lower()
for line in lines:
parts = line.split(None, 1)
if not parts or parts[0].startswith("#"):
continue
word = parts[0].lower()
if word == "match":
break # keywords after Match are conditional, not global
if word == wanted and len(parts) == 2:
return parts[1].strip() # first value wins, as in sshd_config(5)
raise Missing(spec["key"])
@check("sysctl")
def check_sysctl(spec, ctx):
path = ctx["root"] + "/proc/sys/" + spec["key"].replace(".", "/")
try:
with open(path, encoding="utf-8") as fh:
return fh.read().strip()
except FileNotFoundError:
raise Missing(spec["key"])
except PermissionError as exc:
raise CannotEvaluate(str(exc))
@check("file_mode")
def check_file_mode(spec, ctx):
path = ctx["root"] + spec["path"]
try:
return format(os.stat(path).st_mode & 0o7777, "04o")
except FileNotFoundError:
raise Missing(path)
except PermissionError as exc:
raise CannotEvaluate(str(exc))
@check("service")
def check_service(spec, ctx):
try:
proc = subprocess.run(["systemctl", "is-enabled", spec["name"]],
capture_output=True, text=True, timeout=10)
except FileNotFoundError:
raise CannotEvaluate("systemctl not found")
except subprocess.TimeoutExpired:
raise CannotEvaluate("systemctl timed out")
state = (proc.stdout.strip().splitlines() or [""])[0]
if state == "not-found" or "No such file or directory" in proc.stderr:
raise Missing(spec["name"]) # systemd 255+ prints not-found; systemd 252 prints the error text
if not state:
raise CannotEvaluate(proc.stderr.strip() or "no output from systemctl")
return state
def compare(spec, actual):
if spec["type"] == "file_mode" and "max_mode" in spec:
extra = int(actual, 8) & ~int(spec["max_mode"], 8)
return extra == 0
return norm(actual) == norm(spec["expected"])
def evaluate(spec, defaults, ctx):
rec = {"id": spec["id"], "type": spec["type"],
"severity": spec.get("severity", defaults.get("severity", "medium")),
"expected": spec.get("expected", spec.get("max_mode")),
"actual": None, "status": None, "note": ""}
on_missing = spec.get("on_missing", defaults.get("on_missing", "drift"))
try:
fn = CHECKS[spec["type"]]
except KeyError:
rec["status"], rec["note"] = "error", "unknown check type"
return rec
try:
actual = fn(spec, ctx)
except Missing:
if spec.get("expected") == "absent":
rec["actual"], rec["status"], rec["note"] = "absent", "ok", ""
return rec
if "default" in spec: # setting absent: the program's documented default applies
actual = spec["default"]
rec["note"] = "absent, using stated default"
elif on_missing == "not_applicable":
rec["status"], rec["note"] = "not_applicable", "absent on this host"
return rec
else:
rec["status"], rec["note"] = "drift", "absent"
return rec
except CannotEvaluate as exc:
rec["status"], rec["note"] = "error", str(exc)
return rec
rec["actual"] = actual
rec["status"] = "ok" if compare(spec, actual) else "drift"
return rec
def main(argv=None):
ap = argparse.ArgumentParser(description=__doc__)
ap.add_argument("baseline")
ap.add_argument("--root", default="", help="prefix for file paths (testing)")
ap.add_argument("--host", default=socket.gethostname())
ap.add_argument("--json-out", required=True)
args = ap.parse_args(argv)
with open(args.baseline, encoding="utf-8") as fh:
baseline = json.load(fh)
defaults = baseline.get("defaults", {})
ctx = {"root": args.root}
results = [evaluate(s, defaults, ctx) for s in baseline["checks"]]
counts = {k: 0 for k in ("ok", "drift", "not_applicable", "error")}
for r in results:
counts[r["status"]] += 1
report = {"schema_version": 1, "host": args.host, "summary": counts,
"results": results}
with open(args.json_out, "w", encoding="utf-8") as fh:
json.dump(report, fh, indent=2, sort_keys=True)
fh.write("\n")
print(f"{args.host}: {counts['drift']} drift, {counts['ok']} ok, "
f"{counts['not_applicable']} n/a, {counts['error']} could not check")
for r in results:
if r["status"] in ("drift", "error"):
print(f" [{r['severity']}] {r['id']}: {r['status']} "
f"(expected {r['expected']}, actual {r['actual']}) {r['note']}".rstrip())
if counts["drift"]:
return 1
return 2 if counts["error"] else 0
if __name__ == "__main__":
sys.exit(main())
The baseline
{
"defaults": {"severity": "medium", "on_missing": "drift"},
"checks": [
{"id": "ssh-permit-root-login", "type": "sshd", "key": "PermitRootLogin", "expected": "no", "severity": "high"},
{"id": "ssh-password-auth", "type": "sshd", "key": "PasswordAuthentication", "expected": "no", "severity": "high"},
{"id": "ssh-empty-passwords", "type": "sshd", "key": "PermitEmptyPasswords", "expected": "no", "default": "no", "severity": "high"},
{"id": "ssh-x11-forwarding", "type": "sshd", "key": "X11Forwarding", "expected": "no", "default": "no", "severity": "low"},
{"id": "sysctl-ip-forward", "type": "sysctl", "key": "net.ipv4.ip_forward", "expected": "0"},
{"id": "sysctl-rp-filter", "type": "sysctl", "key": "net.ipv4.conf.all.rp_filter", "expected": "1"},
{"id": "sysctl-ipv6-ra", "type": "sysctl", "key": "net.ipv6.conf.all.accept_ra", "expected": "0", "on_missing": "not_applicable"},
{"id": "mode-shadow", "type": "file_mode", "path": "/etc/shadow", "max_mode": "0640", "severity": "high"},
{"id": "mode-sshd-config", "type": "file_mode", "path": "/etc/ssh/sshd_config", "max_mode": "0644"},
{"id": "mode-gshadow", "type": "file_mode", "path": "/etc/gshadow", "max_mode": "0640", "on_missing": "not_applicable"},
{"id": "svc-telnet", "type": "service", "name": "telnet.socket", "expected": "absent", "severity": "high"}
]
}
Each sshd check reads the global part of sshd_config. The OpenSSH manual states "Unless noted otherwise, for each keyword, the first obtained value will be used", so the parser returns the first occurrence of a keyword and ignores later duplicates (a few keywords accumulate instead, which is one more reason to prefer sshd -T for the effective answer). It stops at the first Match line because keywords after it only apply to matching connections. Include files are not followed. When you need the effective configuration including includes and Match evaluation, run sshd -T on the host and parse that instead. Executed in a debian:12-slim container with openssh-server installed (after mkdir -p /run/sshd and ssh-keygen -A), with an sshd_config holding PermitRootLogin yes, PasswordAuthentication=no, PermitRootLogin no and a Match User x block that sets PasswordAuthentication yes, the command sshd -T | grep -Ei '^(permitrootlogin|passwordauthentication|permitemptypasswords)' printed:
permitrootlogin yes
passwordauthentication no
permitemptypasswords no
The output is lowercase keyword value, the first PermitRootLogin wins, the Match block is not applied to the global value, and an unset keyword shows its built-in default. sshd also accepts = as the separator (PasswordAuthentication=no above), but the parser shown here splits on whitespace only, so a line written with = is read as missing; normalize the separator before comparing or use sshd -T.
Running it
The demo builds a throwaway directory tree that imitates a host, so the result is reproducible on any machine with Docker. Save drift_check.py, baseline.json and the script below in one directory (the demo script is named demo.sh):
set -u
R=/tmp/demo-root
mkdir -p $R/etc/ssh $R/proc/sys/net/ipv4/conf/all
cat > $R/etc/ssh/sshd_config <<'CFG'
# demo config
PermitRootLogin yes
PasswordAuthentication no
PermitRootLogin no
Match User backup
PasswordAuthentication yes
CFG
chmod 0644 $R/etc/ssh/sshd_config
echo 1 > $R/proc/sys/net/ipv4/ip_forward
echo 1 > $R/proc/sys/net/ipv4/conf/all/rp_filter
echo "root:*:19000:0:99999:7:::" > $R/etc/shadow; chmod 0644 $R/etc/shadow
python3 drift_check.py baseline.json --root $R --host demo-host --json-out report.json
echo "exit=$?"
cat report.json | head -40
docker run --rm -v "$PWD":/w -w /w python:3.12-slim sh demo.sh
Printed output (the script then prints the first lines of report.json, which are omitted here):
demo-host: 3 drift, 5 ok, 2 n/a, 1 could not check
[high] ssh-permit-root-login: drift (expected no, actual yes)
[medium] sysctl-ip-forward: drift (expected 0, actual 1)
[high] mode-shadow: drift (expected 0640, actual 0644)
[high] svc-telnet: error (expected absent, actual None) systemctl not found
exit=1
The summary counts (3 drift, 5 ok, 2 n/a, 1 could not check) add up to the 11 checks in the baseline, and the JSON summary object holds the same numbers: {'drift': 3, 'error': 1, 'not_applicable': 2, 'ok': 5}.
Reading the result:
ssh-permit-root-loginisdrifteven though a later line saysPermitRootLogin no: the first line wins.ssh-password-authisok: theMatch User backupblock that setsPasswordAuthentication yesis ignored by design because it only applies to that user.ssh-empty-passwordsandssh-x11-forwardingareokthrough the stated defaults (no), and the JSON records the noteabsent, using stated default.mode-shadowisdrift(0644is more permissive than the0640limit);mode-sshd-configpasses at0644.svc-telnetiserror: the container has nosystemctl, so the check reports that it could not run. It is not counted as compliant.sysctl-ipv6-raandmode-gshadowarenot_applicablebecause those paths are absent here and the baseline says absence is fine.
How the file-mode comparison works
compare checks that a file has no permission bit beyond the limit. ~limit flips every bit of the limit, and & keeps only bits that are set in both numbers, so actual & ~limit is the set of permission bits the file has that the limit does not allow. Zero means the file is within the limit. Executed in a python:3.12-slim container with the limit 0640 (the nine bits are owner rwx, group rwx, other rwx):
actual 0600 = 110000000 limit 0640 = 110100000 bits beyond limit = 000000000 -> ok
actual 0640 = 110100000 limit 0640 = 110100000 bits beyond limit = 000000000 -> ok
actual 0644 = 110100100 limit 0640 = 110100000 bits beyond limit = 000000100 -> drift
actual 0660 = 110110000 limit 0640 = 110100000 bits beyond limit = 000010000 -> drift
0644 fails because it adds the "other read" bit (the last 1 in the third line's beyond-limit column), and 0660 fails because it adds group write. 0600 passes because it only removes bits.
Adding a new kind of check
A check to confirm a line exists in a file is one function. The program below registers it and reuses main:
set -u
R=/tmp/demo-root
mkdir -p $R/etc
printf 'blacklist usb-storage\n' > $R/etc/modprobe-hardening.conf
cat > extra_check.py <<'PY'
import sys
import drift_check
from drift_check import check, Missing
@check("file_line")
def check_file_line(spec, ctx):
path = ctx["root"] + spec["path"]
try:
with open(path, encoding="utf-8") as fh:
lines = fh.read().splitlines()
except FileNotFoundError:
raise Missing(path)
return "present" if spec["line"] in lines else "absent"
sys.exit(drift_check.main())
PY
cat > extra.json <<'JSON'
{"checks": [
{"id": "usb-storage-blocked", "type": "file_line", "path": "/etc/modprobe-hardening.conf", "line": "blacklist usb-storage", "expected": "present"},
{"id": "cramfs-blocked", "type": "file_line", "path": "/etc/modprobe-hardening.conf", "line": "blacklist cramfs", "expected": "present", "severity": "low"}
]}
JSON
python3 extra_check.py extra.json --root $R --host demo-host --json-out extra-report.json
echo "exit=$?"
Output of that run:
demo-host: 1 drift, 1 ok, 0 n/a, 0 could not check
[low] cramfs-blocked: drift (expected present, actual absent)
exit=1
The first check passes because the file contains the line; the second reports drift. Nothing outside the new function and the baseline entries changed.
Complexity and edge cases
- Complexity: each check does constant work apart from I/O; an
sshdcheck readssshd_configonce per check, so N sshd checks over an L-line file cost O(N x L). Caching the parsed file per path makes it O(L + N) if the baseline grows large. - Edge cases handled: missing keys, missing files, unreadable files (reported as
error, not as pass), repeated keywords, comments, multi-value sysctl output (whitespace is normalized), a service that does not exist (newer systemd, 255 and later, printsnot-foundon stdout for an unknown unit; systemd 252, which Debian 12 ships, prints nothing on stdout andFailed to get unit file state for telnet.socket: No such file or directoryon stderr; both are treated as missing, which matters because without the second test an absent unit on a 252 host would be reported aserrorinstead of compliant), and an absent tool. - Not handled, and worth stating:
IncludeandMatchevaluation (usesshd -T), runtime sysctl values that differ from the persisted files in/etc/sysctl.d(add asysctl_persistedcheck kind to catch a setting that will revert at reboot), symlinks (os.statfollows them), and extended attributes or ownership (addownerchecks as another registered kind).
How does a mature patch management process work end to end, from knowing what you have to proving the work is done, and where do programmes usually break down?
Sample Answer
Direct answer
A patch management process is a closed loop with six stages: know what you have (an inventory of every host, OS and application, with an owner and a criticality), find what is missing (detect which patches and vulnerabilities apply to which host), prioritise by real risk, test and deploy in stages, verify independently that the patch landed, and report and improve. Programmes usually break at the first and the last stages: the inventory is incomplete, so hosts never get patched, and "done" is declared from the patching tool's own report instead of from an independent check.
The stages
- Inventory. A list of hosts is not enough. For each one you need the operating system and version, installed software, internet exposure, owner, business criticality and a maintenance window. Sources: the configuration management database (CMDB, a record of assets and their relationships), cloud APIs, the endpoint agents (small programs installed on a host that report what it runs and can act on it), and network discovery to find what nobody registered. Reconcile them; an asset that appears in discovery but not the CMDB is a finding.
- Assess. Match each host's software to published vulnerabilities and vendor patches, using the patching tool for OS and vendor patches and a vulnerability scanner (preferably authenticated, meaning it logs in to the host and reads installed versions) for coverage across everything else. Third-party applications and libraries are the usual blind spot, not the OS.
- Prioritise. Decide what goes first and what waits, using exploitation evidence, exposure and asset value rather than severity score alone. This stage needs a named owner and a written rule.
- Test and deploy in rings. A ring is a group of hosts that receives a patch at the same time. Start with a small pilot ring, then widen to larger rings, with soak time between them (a soak is a waiting period to let problems appear), and keep the ability to halt. Define maintenance windows and reboot handling, because a patch that needs a reboot is not applied until the reboot happens.
- Verify. Confirm four things per host: the package or update is installed (version check), the host rebooted if required, the service is healthy, and an independent scan no longer reports the vulnerability. A tool that says "installed successfully" can be wrong when the host was offline, the reboot is pending, or a second copy of the vulnerable library exists elsewhere on disk.
- Report and improve. Track coverage (percentage of the estate patched within its target window, by criticality), time to patch, exceptions and their age, and failed or missing hosts. Feed misses back into the inventory and the rings.
What "proving the work is done" looks like
For each patch campaign keep one record per host: patch identifier, install timestamp, reboot timestamp, post-patch scan result. A report that says "98 percent compliant" is only meaningful if the denominator is the whole inventory, including hosts that were offline or never reported. If 1,000 hosts are in the inventory and the tool reports on 920 of them, with 900 of those patched, the tool shows 97.8 percent (900 of 920) while the estate is 90.0 percent patched (900 of 1,000), and the 80 silent hosts are the actual risk.
Where programmes break down
| Breakdown | What it looks like | Fix |
|---|---|---|
| Incomplete inventory | Shadow servers, forgotten test VMs, cloud instances nobody owns | Discovery scans reconciled against the CMDB; unowned assets are quarantined or deleted |
| Reboots never happen | Patch "installed", host still running the old kernel or library | Track pending-reboot state as a patch status of its own; enforce reboot windows |
| Third-party software | OS is current, browser, Java, agents and libraries are not | Include applications in scanning; assign each an owner |
| No testing path | Patches either go out untested or never go out | Rings with a pilot that includes the critical applications |
| Fear of breaking things | Exceptions grow, patches wait for "next quarter" | Rollback plans, snapshots or images, and a small exception queue with expiry dates |
| Ownership gaps | Security finds, infrastructure patches, nobody closes | One accountable owner per stage, and a monthly review of misses |
| Measuring effort, not outcome | "We deployed 500 patches" | Measure exposure: critical findings open past their target window |
| Appliances and embedded devices | Firewalls, hypervisors, printers outside the tooling | Put them in the inventory with a manual owner and schedule |
Worked example
Estate: 1,000 hosts, 600 Windows servers and 400 Linux servers. Monthly cycle: week 1, vendor patches released and scanned against inventory; week 1 end, prioritisation meeting; week 2, pilot ring (30 hosts, drawn from both OS families and including each critical application); week 3, two further rings (150 hosts, then the remaining 820, so 30 + 150 + 820 = 1,000); week 4, verification scan and report. If the verification scan finds 37 hosts still vulnerable, the reasons are classified (offline, pending reboot, failed install, application pinned to an old version) and each class has a different action: wake or retire the offline ones, force the reboot, retry the failed install with logs, and write exceptions with an owner and an end date for the pinned ones. The report shows 963 of 1,000 patched (96.3 percent) with 37 itemised.
Trade-offs
Speed and safety pull against each other; the rings are how you buy safety cheaply. Automatic updates everywhere is simple but can remove your ability to halt, so for servers I prefer staged automation: automated deployment, human-owned promotion decisions. Agent-based patching needs an agent (a small program installed on each host that reports its state and can install patches) on every host; it sees deep detail but misses hosts where the agent is absent or broken. Agentless scanning (a scanner that connects over the network or reads cloud APIs, installing nothing) sees more kinds of device, such as appliances, but is shallower, because it only sees what the remote login exposes. Most mature programmes use both.
Your enterprise manages Windows patching with a mix of WSUS, ConfigMgr, Intune and Windows Update for Business. What is each good for, where do they fall short, and where does co-management make sense?
Sample Answer
Direct answer
WSUS is the on-premises distribution server for Microsoft updates, ConfigMgr (Configuration Manager) is the on-premises management system that uses WSUS and adds targeting, scheduling and reporting, Intune is the cloud management service, and Windows Update for Business (now called Windows Update client policies) is the set of client-side policies Intune or Group Policy applies. Co-management makes sense when one device population has a ConfigMgr history and cloud needs, so each workload can be assigned to the better tool.
Four names to keep straight: WSUS holds and hands out the updates (a server you run); ConfigMgr is the management system built on top of it; Intune is the cloud service; and Windows Update client policies (the new name for Windows Update for Business, a set of settings, not a server) are what Intune or Group Policy push to the device. An Intune update ring is those client policies packaged as one policy for one device group.
What each is good for and where it falls short
| Tool | Good for | Falls short |
|---|---|---|
| WSUS (Windows Server Update Services) | Central, on-premises control of which Microsoft updates reach computers on a network; PowerShell cmdlets for automation; LAN or offline-style networks | Microsoft says WSUS is deprecated and is no longer adding new features (still supported, with security and quality updates); it distributes Microsoft products only; you run the server |
| ConfigMgr | Collections, automatic deployment rules, maintenance windows, deadlines, compliance states, distribution points, third-party update integration options; detailed per-update reporting | Heavy infrastructure; its software update point is built on WSUS; internet-based clients need extra pieces such as a cloud management gateway (CMG, a ConfigMgr service hosted in Azure that lets ConfigMgr reach devices that are away from the corporate network) |
| Intune update rings | Cloud-managed deferral, deadline and restart settings; staged rings through device groups; pause and uninstall from the console; no on-premises update server | Needs devices to reach Microsoft and Intune endpoints, a licence, and Entra identity (Microsoft Entra ID is Microsoft's cloud identity service, formerly Azure AD); no content server of your own |
| Windows Update for Business (client policies) | The policy layer itself: deferral up to 365 days for feature updates and a shorter maximum for quality updates, pause, deadlines; settable by Group Policy or mobile device management (MDM, the enrolment channel through which a cloud service such as Intune pushes settings to a device) | Not a server product: devices fetch content themselves; Microsoft's overview lists Windows 10 and Windows 11 client editions, so plan server patching on other tooling |
Where co-management makes sense
Co-management means a device runs the ConfigMgr client and is enrolled in Intune at the same time. A workload is one area of management that can have either ConfigMgr or Intune as its authority: compliance policies, Windows Update policies, resource access, Endpoint Protection, device configuration, Office apps, client apps. The workload slider is the per-workload switch in the ConfigMgr console that moves that authority to Intune. ConfigMgr keeps every workload you have not switched, and you can pilot a workload on a separate collection (a group of devices) first.
Requirements to check first: devices must be Microsoft Entra joined or Entra hybrid joined (devices only registered with Entra are not supported), and Microsoft Entra ID P1 or P2 licensing (the paid tiers of Entra ID) is needed. The three device states differ like this:
- Entra joined: the organisation's Windows device is joined directly to Entra ID and the user signs in with a work account; no on-premises Active Directory is needed (Microsoft's device-identity overview lists organisation-owned Windows 10 and 11 devices here).
- Entra hybrid joined: the device is joined to your on-premises Active Directory and also registered with Entra ID, so it has both identities.
- Entra registered: typically a personal (bring-your-own) or mobile device that has had a work account added, without being joined to the organisation's directory. Co-management does not support this state.
Example estate: 4,000 laptops and 300 servers, on-premises Active Directory, ConfigMgr already installed.
| Population | Recommended patch channel | Reason |
|---|---|---|
| Laptops, hybrid joined | Co-manage; move the Windows Update policies workload to Intune rings, pilot on one collection first | Laptops leave the office, and rings plus deadlines work without a VPN |
| Servers | ConfigMgr with WSUS-backed software update point, with maintenance windows | Servers get only quality updates, need scheduled windows, and sit on the LAN |
| A small remote site with few devices and no ConfigMgr | WSUS alone, or Intune rings if devices are Entra joined | Avoids new infrastructure |
| Devices only registered with Entra, not joined | Keep on ConfigMgr or WSUS if they must be patched centrally | Not eligible for co-management |
Choosing
- Mostly cloud-connected clients and no ConfigMgr: Intune rings; add nothing else.
- Existing ConfigMgr, mixed estate: co-manage; move Windows Update policies first because it is one self-contained workload (one slider) that Microsoft lets you pilot on a separate collection before switching everyone.
- Servers and constrained networks: ConfigMgr or WSUS regardless of what laptops do.
Pitfalls
Two tools both setting update behaviour on one device cause conflicts; the workload slider exists so exactly one authority owns it. Declaring WSUS "dead" because of deprecation is wrong today, as it is supported, but ConfigMgr's software update point depends on it, so plan around Microsoft's lifecycle announcements instead of assuming either outcome. If you must tell the business one sentence: laptops go to the cloud first, servers stay on scheduled on-premises tooling, and the two meet through co-management.
Write PowerShell that audits the local Administrators group across domain-joined Windows servers and reports hosts with unexpected members. How do you handle credentials and unreachable hosts?
Sample Answer
Direct answer
Fan out one read-only PowerShell remoting call (PowerShell's way of running a command on another computer over WinRM, Windows Remote Management) to every member server, have each server return exactly one object (either its member list or the error it hit), compare the members to an allow-list on the auditing side, and report four statuses: OK, UNEXPECTED, ERROR and UNREACHABLE. The two design rules are that the script never handles a password (it runs under the operator's or a service account's Kerberos identity: Kerberos is the Windows domain sign-in protocol, and the script simply borrows the ticket of whoever runs it), and that a host which did not answer is reported as UNREACHABLE rather than silently counted as clean. Silence must never read as a pass.
The script
#Requires -Version 5.1
<#
Audit the local Administrators group on domain-joined member servers.
Runs under the caller's Kerberos identity (no passwords handled).
#>
[CmdletBinding()]
param(
[string[]]$ComputerName,
# Principals that are expected in local Administrators on every server.
[string[]]$Allowed = @('LOCAL\Administrator', 'CORP\Domain Admins', 'CORP\SRV-Local-Admins'),
[int]$ThrottleLimit = 32,
[int]$ConnectTimeoutSec = 20
)
# Pure comparison logic: no remoting, so it can be tested anywhere.
function Compare-AdminMember {
param(
[Parameter(Mandatory)][string[]]$Actual,
[Parameter(Mandatory)][string[]]$Allowed,
# Host being audited: HOST\name is rewritten to LOCAL\name so one allow-list fits every server.
[string]$HostName
)
$allowedSet = [System.Collections.Generic.HashSet[string]]::new(
[string[]]$Allowed, [System.StringComparer]::OrdinalIgnoreCase)
# Local accounts are prefixed with the short (NetBIOS) computer name, even when the host is addressed by FQDN.
$shortName = $HostName.Split('.')[0]
foreach ($member in $Actual) {
$normalised = $member -replace ('^' + [regex]::Escape($shortName) + '\\'), 'LOCAL\'
if (-not $allowedSet.Contains($normalised)) { $member }
}
}
if (-not $ComputerName) {
$dcNames = (Get-ADDomainController -Filter *).Name
$ComputerName = (Get-ADComputer -Filter 'OperatingSystem -like "*Server*" -and Enabled -eq $true').Name |
Where-Object { $_ -notin $dcNames }
}
$probe = {
# One object per host, success or failure, so silence can never mean "clean".
try {
$members = Get-LocalGroupMember -SID 'S-1-5-32-544' -ErrorAction Stop
[pscustomobject]@{
Error = $null
Members = @($members | ForEach-Object { $_.Name })
}
}
catch {
[pscustomobject]@{ Error = $_.Exception.Message; Members = @() }
}
}
$so = New-PSSessionOption -OpenTimeout ($ConnectTimeoutSec * 1000) -NoMachineProfile
$raw = Invoke-Command -ComputerName $ComputerName -ScriptBlock $probe `
-SessionOption $so -ThrottleLimit $ThrottleLimit `
-ErrorAction SilentlyContinue -ErrorVariable remotingErrors
$remotingErrors | ForEach-Object { Write-Verbose $_.Exception.Message }
$reached = @($raw | Select-Object -ExpandProperty PSComputerName -Unique)
$report = foreach ($r in $raw) {
$extra = if ($r.Error) { @() } else {
@(Compare-AdminMember -Actual $r.Members -Allowed $Allowed -HostName $r.PSComputerName)
}
[pscustomobject]@{
Host = $r.PSComputerName
Status = if ($r.Error) { 'ERROR' } elseif ($extra.Count) { 'UNEXPECTED' } else { 'OK' }
Unexpected = $extra -join '; '
Detail = $r.Error
}
}
$unreachable = $ComputerName | Where-Object { $_ -notin $reached } | ForEach-Object {
[pscustomobject]@{ Host = $_; Status = 'UNREACHABLE'; Unexpected = ''; Detail = 'no result returned (see -Verbose)' }
}
@($report) + @($unreachable) | Sort-Object Status, Host
Run it as .\Audit-LocalAdmins.ps1 -Verbose | Export-Csv admins.csv -NoTypeInformation from a machine with the Active Directory PowerShell module (installed with RSAT, the Remote Server Administration Tools) and an account that is allowed to open remoting sessions to the servers. Pass -ComputerName for a subset; with no parameter it discovers every enabled server computer account in the Active Directory (AD) domain except domain controllers.
What the report looks like. The four rows below are illustrative: the host names are made up, and I produced them by running the script's own comparison and report-building lines (unchanged, in PowerShell 7) on sample probe results, because the remoting itself needs Windows servers. The CSV is sorted by Status then Host:
"Host","Status","Unexpected","Detail"
"sql01","ERROR","","Access is denied."
"app01","OK","",
"file01","UNEXPECTED","CORP\jsmith; FILE01\svc_backup",
"web02","UNREACHABLE","","no result returned (see -Verbose)"
Reading it: OK means the host answered and every member is on the allow-list; UNEXPECTED lists the members that are not (Unexpected column), which is what you investigate; ERROR means the host answered but the group read failed, with the reason in Detail (the error text in the sample row is made up); UNREACHABLE means no result came back from that host: it did not answer, or it answered but refused the connection (for example access denied at logon), so nothing is known about its group. The reason, where Windows gave one, is in $remotingErrors and is printed with -Verbose. The empty cells are normal.
Why it is built this way
Reading the group. Get-LocalGroupMember -SID 'S-1-5-32-544' addresses the local Administrators group by its well-known SID (security identifier), so it still works on a server whose OS language renames the group. Note on scope: the Microsoft.PowerShell.LocalAccounts module is not available in 32-bit PowerShell on a 64-bit system. Domain controllers are excluded because they have no local account database of their own: the Administrators group there is a domain-wide built-in group, which needs a separate AD audit.
Credentials.
- No password appears in the script, a parameter, or a file.
Invoke-Commanduses the caller's current Kerberos credentials, and the script block touches nothing beyond the local server, so no credential has to be forwarded to a third machine, and CredSSP is not needed. The "second hop" picture: you run the script on workstation A, and it connects to server B (the first hop). If code running on B then had to reach a file share or server C (the second hop), B would need your credentials to authenticate there, and Kerberos does not hand B a reusable copy of them by default, so that call fails. CredSSP is the setting that works around this by sending your actual credentials to B, which is why it is best avoided. Here B only reads its own local group, so there is no second hop. - For a one-off with a different account,
Invoke-Command -Credential (Get-Credential)prompts and keeps the secret in aPSCredentialobject only in memory. - For a scheduled run, run the task as a group managed service account (gMSA): Active Directory rotates its password, so no secret is stored anywhere. Give that account the least privilege that allows opening a remoting session and reading local groups, and test it. If local administrator rights turn out to be required, treat the account as a privileged identity: it should not log on interactively anywhere, and its use should be alerted on, because an account that can read every server's admins can usually do more.
Unreachable hosts. A connection failure in Invoke-Command is a non-terminating error: the hosts that answer still return their results and the command continues. That is convenient, but it also means a dead host contributes nothing to the output. The script therefore computes UNREACHABLE as the requested names minus the names that returned an object (PSComputerName is added to every remote result). Reading the Invoke-Command call: -ComputerName and -ScriptBlock say where to run the probe and what to run; -SessionOption $so applies the timeout and no-profile settings; -ErrorAction SilentlyContinue stops each connection failure from printing a red error and halting the loop, so reachable hosts still return results; -ErrorVariable remotingErrors (written without a $) captures those same errors into the variable $remotingErrors so they are not lost, and -Verbose prints them. Errors are silenced, but hosts are never lost, because the UNREACHABLE list is computed afterwards from the names that did not answer. New-PSSessionOption -OpenTimeout is in milliseconds and defaults to 180000 (three minutes); lowering it to 20 seconds keeps dead hosts from stalling the run, and -ThrottleLimit caps concurrent connections (default 32). Error text from failed connections is available with -Verbose.
Errors on reachable hosts. The probe wraps the cmdlet in try/catch with -ErrorAction Stop and returns the message, so a host where the call failed shows as ERROR with its reason instead of an empty, apparently clean list.
The comparison is separate and testable. Compare-AdminMember takes the actual members, the allow-list and the host name, rewrites HOST\name to LOCAL\name (the local prefix is the short computer name, even when the host is addressed by its FQDN, fully qualified domain name) and returns whatever is not on the list. Testing it needs no Windows host. The script cannot simply be loaded into a test session, because loading it would run the remoting. So the first line uses Parser.ParseFile to read the script file and build a syntax tree (an AST, abstract syntax tree) without executing anything; the second line asks the tree for the first function definition in it, which is Compare-AdminMember; and the third wraps that function's text in a script block and runs it with a leading dot, which defines just that function in the current session:
$ast=[System.Management.Automation.Language.Parser]::ParseFile("$PSScriptRoot/Audit-LocalAdmins.ps1",[ref]$null,[ref]$null)
$fn=$ast.Find({param($n) $n -is [System.Management.Automation.Language.FunctionDefinitionAst]},$true)
. ([scriptblock]::Create($fn.Extent.Text))
$allowed='LOCAL\Administrator','CORP\Domain Admins','CORP\SRV-Local-Admins'
$actual='FILE01\Administrator','CORP\Domain Admins','CORP\jsmith','FILE01\svc_backup','corp\srv-local-admins'
Compare-AdminMember -Actual $actual -Allowed $allowed -HostName file01.corp.example.com
CORP\jsmith
FILE01\svc_backup
FILE01\Administrator matched LOCAL\Administrator, CORP\Domain Admins matched exactly, and corp\srv-local-admins matched despite the case difference. Only the two genuinely unexpected members came back. The whole script was parse-checked and its cmdlets and parameters were checked against Microsoft Learn; the remoting path itself needs Windows servers and was not executed here.
Complexity and edge cases
- Work is one remote call per server, run up to
-ThrottleLimitat a time, so the cost grows linearly with the server count; the comparison is O(members) per host with a hash set lookup. - Both lists are compared as strings, so the requested names and the reported
PSComputerNamemust use the same form. The AD discovery path uses theNameproperty throughout; if you supply FQDNs yourself, supply them consistently. - The allow-list matches by name. A renamed built-in Administrator account would be flagged, which is a safe failure but noisy. A hardened version compares SIDs.
- Domain groups in the allow-list are trusted as a unit: the cmdlet reports direct members, so who sits inside
SRV-Local-Adminsmust be audited in AD. - Servers that are powered off, in a different forest, or with WinRM (Windows Remote Management, the transport that PowerShell remoting uses) blocked all land in UNREACHABLE. Follow up on that list; a host that stays unreachable for several runs is a finding in itself.
PrincipalSource(Local, Active Directory, Microsoft Entra group, Microsoft Account) is only populated on Windows 10, Windows Server 2016 and later, so do not rely on it for older servers.
Trade-offs
A scheduled audit like this detects drift but does not prevent it. The preventive control is a Group Policy "Restricted Groups" or Local Users and Groups preference that sets the membership, with this report as the independent check that the policy is applying. Reporting only is deliberate here: an auditing script that also removes members can lock out an admin during an incident.
A hardened baseline keeps drifting once servers are in production. Design how you would detect drift against it across Windows and Linux hosts, and how you decide per setting between reporting only and fixing it automatically.
Sample Answer
Direct answer
Make the baseline a single versioned source of truth, check it at three points (image build, provisioning, and continuously at runtime), and decide per setting between report-only and auto-fix with a rule: auto-fix only when the correction is deterministic (the same input always gives the same result, with no per-host judgement), idempotent, reversible and cannot take a service or an administrator out; report and ticket everything else. Keep the scan results as dated, tamper-evident evidence (any later edit would be visible) so an auditor can see the history, not only today's state.
Design: three checkpoints and evidence
- Image build: scan every image before it is published and fail the build on violations. On Linux, OpenSCAP (an open-source compliance scanner) can evaluate a profile and write results and an HTML report with
oscap xccdf eval --profile <profile> --results-arf results.xml --report report.html <datastream>. A profile is a named subset of rules, such as a CIS level; a datastream is the single file that bundles the rules and the checks that test them; XCCDF is the XML format those rules are written in and results are reported in; on Windows, build from a hardened image and apply the settings through Group Policy. - Provisioning: enforce at first boot with configuration management (Ansible, Group Policy or an endpoint management tool) so no host starts life drifted.
- Runtime: re-check continuously (for example daily) in detect mode. Ansible can run read-only with
--check(and--diff), where modules that support check mode report the changes they would make. Note the documented limits: modules without check-mode support report nothing, and tasks whose conditions depend on registered results from earlier tasks produce no output in check mode. - Evidence: store each scan result (the XML results file or the exported report) with the host, time, baseline version and operator, in write-once storage (storage that accepts new files but refuses edits and deletions, for example object storage with a retention lock). This is what an auditor asks for.
Deciding per setting: report only or fix automatically
| Setting | Mode | Why |
|---|---|---|
| Disable root SSH login | Fix | Deterministic, no application depends on it, reversible |
| Disable X11 forwarding | Fix | Same |
| Limit SSH authentication tries | Report | Rarely harmful but needs review against automation that retries |
| Reverse-path filtering (a kernel check that drops a packet whose reply would leave by a different network interface than it arrived on) | Report | Can break asymmetric routing (traffic that arrives by one path and returns by another); owner must approve per host |
| Require SMB signing on Windows file servers | Report | Legacy clients lose access; needs a rollout plan |
Rules behind the table:
- Fix automatically when the setting is a pure tightening that no workload legitimately needs and the fix is idempotent (running it twice changes nothing).
- Report only when it can interrupt service or lock people out, needs a reboot, varies by host role, or when the same setting is repeatedly reverted by a person or program. Repeated reverts mean something is fighting your baseline, so raise an alert instead of fixing again.
- Every report-only drift gets an owner and a due date, or a time-limited exception with an expiry.
- Examples of fixes that are not deterministic, so they stay report-only: "set
rp_filterto whatever suits this host's routing" (the right value differs per host), "remove local administrators who look unfamiliar" (who is legitimate is a human judgement), and any change that only takes effect after a reboot.
How the pieces fit: the single versioned baseline is what everything is compared against; the three checkpoints decide when you look; the table and rules decide what happens on a mismatch. OpenSCAP and the registry script below are the detectors for Linux and Windows hosts, and Ansible check mode and Group Policy are how you detect or enforce through the tool a fleet is already managed with.
Worked example: Linux check that fixes some settings and reports others
This script reads a table of settings. Rows marked fix are rewritten when they drift. Rows marked report are only flagged. It takes a root directory so it can be tested safely.
#!/usr/bin/env bash
# Report-or-fix drift check for key/value settings in config files.
# Usage: drift-check.sh ROOT (ROOT is / on a real host)
set -euo pipefail
root=${1:-/}
# file | key | expected value | mode (report|fix)
settings=(
"etc/ssh/sshd_config|PermitRootLogin|no|fix"
"etc/ssh/sshd_config|X11Forwarding|no|fix"
"etc/ssh/sshd_config|MaxAuthTries|4|report"
"etc/sysctl.d/99-hardening.conf|net.ipv4.conf.all.rp_filter|1|report"
)
drift=0
for row in "${settings[@]}"; do
IFS='|' read -r file key want mode <<<"$row"
path="$root/$file"
have=$({ sed -E 's/[[:space:]]*=[[:space:]]*/ /' "$path" 2>/dev/null || true; } |
awk -v k="$key" '$1 == k { v = $2 } END { print v }')
if [[ "$have" == "$want" ]]; then
printf 'OK %-40s %s\n' "$key" "$have"
continue
fi
drift=$((drift + 1))
printf 'DRIFT %-40s have=%s want=%s mode=%s\n' "$key" "${have:-<unset>}" "$want" "$mode"
if [[ "$mode" == fix ]]; then
if [[ ! -f "$path" ]]; then
printf 'SKIP %-40s not fixed, %s does not exist\n' "$key" "$file"
else
if grep -qE "^[[:space:]]*${key}[[:space:]]" "$path"; then
sed -i -E "s|^[[:space:]]*${key}[[:space:]].*|${key} ${want}|" "$path"
else
printf '%s %s\n' "$key" "$want" >>"$path"
fi
printf 'FIXED %-40s now=%s\n' "$key" "$want"
fi
fi
done
echo "drift_count=$drift"
exit $(( drift > 0 ))
Driver and real output (run inside a Debian container with GNU sed):
rm -rf /tmp/root && mkdir -p /tmp/root/etc/ssh /tmp/root/etc/sysctl.d
printf 'PermitRootLogin yes\nMaxAuthTries 6\n' > /tmp/root/etc/ssh/sshd_config
printf 'net.ipv4.conf.all.rp_filter = 0\n' > /tmp/root/etc/sysctl.d/99-hardening.conf
bash drift-check.sh /tmp/root; echo "exit=$?"
bash drift-check.sh /tmp/root; echo "exit=$?"
DRIFT PermitRootLogin have=yes want=no mode=fix
FIXED PermitRootLogin now=no
DRIFT X11Forwarding have=<unset> want=no mode=fix
FIXED X11Forwarding now=no
DRIFT MaxAuthTries have=6 want=4 mode=report
DRIFT net.ipv4.conf.all.rp_filter have=0 want=1 mode=report
drift_count=4
exit=1
OK PermitRootLogin no
OK X11Forwarding no
DRIFT MaxAuthTries have=6 want=4 mode=report
DRIFT net.ipv4.conf.all.rp_filter have=0 want=1 mode=report
drift_count=2
exit=1
Reading the script, line by line:
settings=( ... )is a table with one row per setting; the four fields in each row are separated by|.IFS='|' read -r file key want mode <<<"$row"splits one row on|into four variables (IFSis the field separatorreaduses,-rstops backslashes being treated as escapes, and<<<"$row"feeds the row toreadas its input). For the first row that givesfile=etc/ssh/sshd_config key=PermitRootLogin want=no mode=fix.- The
have=$(...)line finds the current value. The{ sed ... || true; }group matters: withset -euo pipefail, a missing config file would makesedfail and silently end the whole script with status 2 and no output. With the guard, a missing file simply reads as<unset>and is reported as drift (run on a root whosesshd_configalready meets the baseline and which has no sysctl file, it printsDRIFT net.ipv4.conf.all.rp_filter have=<unset> want=1 mode=reportanddrift_count=1). The same guard does not help afixrow, because the rewrite needs a file to edit: without the[[ ! -f "$path" ]]test in the fix branch, a root with nosshd_configmadegrepand then the>>append fail and the whole run stop after the first DRIFT line, with nodrift_countand exit status 1, which looks the same as ordinary drift. With the test, that row printsSKIP PermitRootLogin not fixed, etc/ssh/sshd_config does not exist, stays counted as drift, and the run finishes (on an empty root all four rows are drift, two of themSKIP,drift_count=4, exit 1; run in the same container).sed -E 's/[[:space:]]*=[[:space:]]*/ /'turns akey = valueline intokey valueby replacing the first=and the spaces around it with one space (lines already writtenkey valuepass through unchanged).awk -v k="$key" '$1 == k { v = $2 } END { print v }'then looks for lines whose first word equals the key, remembers the second word, and prints the last one remembered when the file ends. Run on a small file in a Debian container:
--- after sed:
PermitRootLogin yes
MaxAuthTries 6
MaxAuthTries 5
# X11Forwarding yes
--- awk for MaxAuthTries:
5
The commented-out X11Forwarding line is ignored because its first word is #, and when a key appears twice the last line wins. That is how sysctl files behave; sshd keeps the first value instead, one more reason the sketch's reading of a file can differ from the effective configuration.
[[ "$have" == "$want" ]]printsOKand moves to the next row; anything else counts as drift, incrementsdriftand printsDRIFT. Only rows with modefixreach the rewrite, and only when the file exists:sed -ireplaces the existing line, orprintf ... >>appends one if the key was missing.exit $(( drift > 0 ))ends the script with status 1 if any drift remains and 0 otherwise, because the arithmetic comparison evaluates to 1 or 0. Run in the same container,drift=0exits 0 anddrift=3exits 1.
The first run fixes two settings and reports two. The second run finds the fixed ones clean (idempotent) while the report-only ones stay open until a human acts. The non-zero exit code lets a scheduler or pipeline alarm on remaining drift.
Limits of this sketch, so you do not trust it blindly: it reads files, not effective configuration. The sshd manual says that for each keyword the first obtained value is used, and that keywords after a Match line apply only to matching connections, so an appended line can be shadowed or captured by a Match block (a section of the configuration whose settings apply only to connections matching a condition, such as a particular user or source address). In production, read the effective SSH configuration with sshd -T, which prints it, rather than grepping the file.
Worked example: Windows registry-backed setting
On Windows the same decision logic applies; prefer Group Policy or endpoint management to enforce, and use a script only for what they do not cover. This reports drift for SMB signing and fixes it only when run with -Fix:
param([switch]$Fix)
$path = 'HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters'
$name = 'RequireSecuritySignature'
$want = 1
$have = Get-ItemPropertyValue -Path $path -Name $name -ErrorAction SilentlyContinue
if ($have -eq $want) { "OK $name = $have"; return }
"DRIFT $name have=$have want=$want"
if ($Fix) {
Set-ItemProperty -Path $path -Name $name -Value $want
"FIXED $name now=$want"
}
Run it on a Windows host, since the registry provider is Windows-only. RequireSecuritySignature is the registry setting Microsoft names for the "always sign" SMB policy. It is deliberately report-only by default.
Trade-offs and pitfalls
- Auto-fix everything and you will eventually take down an application at 3 a.m.; report everything and drift grows faster than people close tickets. The per-setting rule is the compromise.
- Detecting drift is half the job: find out why it happened (manual change, a package script, a stopped agent) or the same drift returns.
- Measure it: drift count per host per week, mean time to close report-only items, and number of exceptions past expiry.
- A scanner finding is only evidence if the scan could authenticate and covered the host.
Unlock Full Question Bank
Get access to all 47 System and Endpoint Hardening interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.