Courseiva
hardMultiple ChoiceObjective-mapped

CAS-004 Practice Question: Refer to the exhibit

Exhibit

[Unit]
Description=Auto-patch service
After=network.target

[Service]
ExecStart=/usr/local/bin/patch.sh
Restart=on-failure
User=root

Refer to the exhibit. A system administrator creates a systemd service to run a daily patching script. Which security concern is most prevalent?

⚠ Common 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.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The script runs as root

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.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The service restarts on failure

    Why it's wrong here

    Restart on failure is a reliability feature, not a security concern.

  • The script location is non-standard

    Why it's wrong here

    /usr/local/bin is a standard location for local scripts.

  • The service depends on the network

    Why it's wrong here

    Network dependency is functional, not inherently insecure.

  • The script runs as root

    Why this is correct

    Executing automation as root increases blast radius; privilege separation is recommended.

About these practice questions

One of 968 original CAS-005 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This CAS-005 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CAS-005 exam.