Security

A support user is allowed to run less on one log file as root through sudo. The security team worries the user could type !sh inside less and get an unrestricted root shell. Which sudoers entry BEST mitigates this?

Show the answer

Correct answerC. ops ALL=(root) NOEXEC: /usr/bin/less /var/log/app.log

The NOEXEC tag stops the allowed program from running other commands, which blocks shell escapes from less. NOPASSWD only removes the password prompt, and denying one shell path is easily bypassed with other shells or binaries.