Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In my experience, if you see * or more rarely ? in a sudo command configuration then there's a good chance there's a problem.

I once saw a bunch of systemctl start someprefix* being allowed in a sudoers configuration (likewise for stop). systemctl can start more than one service at a time and the way that the sudoers configuration is checked is by glob matching the concatenated command.

If your command is literally: "systemctl" "start" "someprefix" "sshd" this gets concatenated to "systemctl start someprefix sshd" which matches the glob "systemctl start someprefix*".



If you want to grant particular systemctl start/stops to normal users, that can be done with policykit,


Thanks, I didn't know that!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: