On magical sudo powers
One of my coworkers and I needed to install some packages on a test VM today, but we didn't have sudo access to do so. We do, however, have sudo access to puppet, so in what can only be described as flagrant puppet abuse, we came up with this:
sudo puppet apply -e "exec {'magic': path => '$PATH', command => '$* >> `tty` 2>&1',}"
Which I then call with a shell alias called vudo (because magic... voodoo... vudo... sudo... yeah, it's been kind of a long day, shut up) and then, with magical vudo powers, we could install packages, because:
ryn@compy:~ $ vudo whoami
root
notice: /Stage[main]//Exec[magic]/returns: executed successfully
notice: Finished catalog run in 0.09 seconds
and what's that, we can now run any command that we want because puppet exec is a honey badger and doesn't give a shit about what the sudoers file says we can or can't do? OH YES.
We promised to use our powers only for good, or for awesome, but really, if you find people using puppet exec in order to get their work done, you might want to rethink your permission scheme just a wee bit.