Carve out sudo commands for sudoers NOPASSWD - #532
Conversation
There was a problem hiding this comment.
I'm iffy on the security implications of this:
When one chooses to not add the commands to the sudoer file, we no long show the leaf commands that the script runs. You'd need to inspect the script file, which can change with a git pull.
If the commands in the sudoer file points to the script in the git repo, you have the same issue with the scripts updating with git pull. I think generally sudoer points to read-only binaries.
For allowing to run password-less, it looks like sudoer allows filtering by commandline arguments. Isn't it already possible to add each command ruby-bench runs to sudoer without changing ruby-bench?
I'm fine with adding
I wonder what you would for these scripts. Would you specify all specific commands used in shell scripts?
Sure, I can live with that. I didn't think of describing the content of shell scripts in sudoers, which might not necessarily be stable and could accidentally break because of that, but with the expectation that we don't modify those scripts in the first place, it should work. |
ruby/ruby-bench#532 was not accepted, so instead of pointing sudoers at scripts in the ruby-bench checkout, list the exact commands that lib/cpu_config.rb runs with sudo, relying on sudoers argument matching.
This PR carves out the commands to modify CPU frequency and turbo boost as separate scripts so that we could let
/etc/sudoersallow password-less sudo on them. It removes the need of password input without--no-sudo.