exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 206 discussion

Actual exam question from CompTIA's XK0-005
Question #: 206
Topic #: 1
[All XK0-005 Questions]

The security team has identified a web service that is running with elevated privileges. A Linux administrator is working to change the systemd service file to meet security compliance standards. Given the following output:

[Unit]
Description=CompTIA server daemon
Documentation=man:webserver(8) man:webserver_config(5)

After=network.target -

[Service]

Type=notify -
EnvironmentFile=/etc/webserver/config
ExecStart=/usr/sbin/webserver -D $OPTIONS
ExecReload=/bin/kill -HUP SMAINPID

KillMode=process -

Restart=on-failure -

RestartSec=42s -

[Install]

WantedBy=multi-user.target -

Which of the following remediation steps will prevent the web service from running as a privileged user?

  • A. Removing the ExecStart=/usr/sbin/webserver -D $OPTIONS from the service file
  • B. Updating the EnvironmentFile line in the [Service] section to /home/webservice/config
  • C. Adding the User=webservice to the [Service] section of the service file
  • D. Changing the multi-user.target in the [Install] section to basic.target
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
makuziker
8 months, 3 weeks ago
Selected Answer: C
Yes, you should specify a User option in the service file. But, I would also like to see this web server binary stored somewhere else, not /usr/sbin; that is meant for super-user system-wide binaries. /usr/local/bin would be more appropriate in my opinion.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago