nerdexam
CompTIA

XK0-005 · Question #591

A Linux administrator provisioned a new web server with custom administrative permissions for certain users. The administrator receives a report that user1 is unable to restart the Apache web…

The correct answer is D. Webadmin should be listed as a group in the custom.conf file. To allow a specific user to manage a service with sudo while maintaining least privilege, sudoers configuration should grant specific permissions to a relevant group.

Security

Question

A Linux administrator provisioned a new web server with custom administrative permissions for certain users. The administrator receives a report that user1 is unable to restart the Apache web service on this server. The administrator reviews the following output:

Which of the following would most likely resolve the issue while maintaining a least privilege security model?

Options

  • AUser1 should be added to the wheel group to manage the service.
  • BUser1 should have "NOPASSWD:" after the "ALL=" in the custom.conf.
  • CThe wheel line in the custom.conf file should be uncommented.
  • DWebadmin should be listed as a group in the custom.conf file.

How the community answered

(22 responses)
  • A
    5% (1)
  • B
    5% (1)
  • C
    14% (3)
  • D
    77% (17)

Why each option

To allow a specific user to manage a service with `sudo` while maintaining least privilege, `sudoers` configuration should grant specific permissions to a relevant group.

AUser1 should be added to the wheel group to manage the service.

Adding user1 to the wheel group typically grants broad sudo access, which often goes against the least privilege security model if user1 only needs to manage Apache.

BUser1 should have "NOPASSWD:" after the "ALL=" in the custom.conf.

Adding NOPASSWD: would remove the password prompt for user1 when using sudo, but it does not grant the underlying permission to manage the Apache service if it's not already defined.

CThe wheel line in the custom.conf file should be uncommented.

Uncommenting the wheel line in custom.conf would enable broad sudo access for members of the wheel group, which contradicts the least privilege principle if user1 only needs to manage Apache.

DWebadmin should be listed as a group in the custom.conf file.Correct

If `custom.conf` is a `sudoers` file for custom administrative permissions, listing `Webadmin` as a group and adding `user1` to it, along with a `sudo` rule for restarting Apache, grants the specific privilege without broad root access. This aligns with the least privilege principle by granting only the required permission.

Concept tested: Sudoers configuration for specific service management

Source: https://www.sudo.ws/docs/sudoers_man/

Topics

#sudoers configuration#Least Privilege#Access Control#Group Management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice