-
Notifications
You must be signed in to change notification settings - Fork 181
The vagrant lxc sudoers is insecure #269
Comments
Well, I'm not sure there is something we can do about it apart from adding a note on the README saying that it is insecure and should be used for local development only and should be avoided on production environments. TBH, the only really secure way I can think of is to use user namespaces, but I'm not sure if / when I'll get to that. /cc @jefmathiot |
So why not just recommend NOPASSWD: ALL, if that provides same sense of security? |
Wouldn't that allow any kind of command (regardless if it is required by vagrant-lxc or not) to be run without a password? I understand that a malicious user could The sudoers file is not a requirement for the plugin to work and you don't have to use it if you are worried about the security implications of that. The idea with that is to skip passwords for vagrant-lxc specific operations only, I understand the side effects as you explained but it something I can live with. I think this is a better and less insecure approach than the old dummy wrapper that acted as a simple pass through. |
May be it's beneficial to make safe wrapper script? |
@tailhook Totally agree. I was just discussing the point with @duckmole and @ehartmann. We arrived at the same conclusion:
|
Are you guys willing to work on that safe wrapper script? I had plans to remove that for the final 1.0.0 but if you think it might be useful I can postpone it :-) |
@fgrehm I am working on that and following this strategy:
I've made an inventory of all commands and I guess commands in Driver#compress_rootfs should be kept out of the whitelist. AFAIK it is used only for packaging. The command would allow to I also plan on adding a Are you ok with that ? |
👍 |
Due to how sudo works, the rule
/bin/rm /usr/lib/lxc/templates/*
, means the following command will work:This is what man says:
The
rm
command may be changed tounlink
since the latter receives single argument only.But there are also
cp
commands with wildcard which effectively allow to replace any files with root privileges.All in all if those vulnerabilities can't be fixed, it's probably better to just set
NOPASSWD:ALL
, than making false sense of security.The text was updated successfully, but these errors were encountered: