Refer to the exhibit. A system administrator creates a systemd service to run a daily patching script. Which security concern is most prevalent?
Executing automation as root increases blast radius; privilege separation is recommended.
Why this answer
Running the script as root (User=root) is the most prevalent security concern because it grants the script unrestricted system access. If the patching script is compromised or contains a vulnerability, an attacker could gain full control over the host, escalate privileges, or persist across reboots. The principle of least privilege dictates that services should run with the minimum necessary permissions, typically a dedicated non-root user account.
Exam trap
CompTIA often tests the principle of least privilege by hiding the most critical security flaw (running as root) among seemingly benign configuration details like restart policies or non-standard paths, leading candidates to focus on less impactful issues.
How to eliminate wrong answers
Option A is wrong because restarting on failure (Restart=on-failure) is a standard reliability feature in systemd services and does not introduce a security vulnerability; it simply ensures the service resumes after an unexpected crash. Option B is wrong because placing the script in /usr/local/bin is a conventional, non-standard location for locally maintained scripts and does not inherently pose a security risk; the path is not world-writable by default. Option C is wrong because depending on the network (After=network-online.target) is a common dependency for services that need internet access to download patches, and while it introduces a potential attack surface, it is not the most prevalent security concern compared to running as root.