-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dangerous default behaviour (mounting home directory inside minikube VM) #6788
Comments
I believe the mount is only for minikube HOME folder so that would be |
Mounting the (actual, real) home directory is a “feature” inherited from libmachine. Like most of Docker, it prefers convenience over security. On Mac I think it was even worse, it mounted |
Hello @medyagh Linux
Darwin
Windows
working on a fix, i will send a PR soon. |
About machine: The defaulting mounting is only implemented for the VirtualBox driver, I believe (not KVM) And it actually mounts https://github.com/docker/machine/blob/master/drivers/virtualbox/virtualbox_linux.go#L7 https://github.com/docker/machine/blob/master/drivers/virtualbox/virtualbox_darwin.go#L7 In minikube, the setting was called
This is not the But the mount behaviour is the same. |
Wonder why it was not simply using homedir.HomeDir() on darwin too ? Is it broken somehow @medyagh, what does homedir.HomeDir() return on your Mac ? Thought it was |
|
@starbassma : there are two different types of mounts here, both could mount your home... The first parameter you mention, This means that if you run virtualbox and you run One under
As per above, it can be disabled. And the --mount=false is default already. Only virtualbox implements --disable-driver-mounts now, with xhyve gone. Originally 4545f8d |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@sharifelgamal i see you closed the issue. Is there a way to properly reopen it? i am using minikube
And i still see this behavior (and was shocked with such defaults for test environments where everything can go wrong). |
This default is being carried forward into systems such as Docker Desktop and Podman Desktop, as a part of the Docker legacy. Other systems mount the home directory as read-only, same privacy implications but less chances of destruction. For now, it's opt-out. |
Hello,
When starting a minikube instance
minikube start
by default, the
--mount-string=
is set to home directory~
of the host machine, this argument is passed to the minikube mount command on start, the home directory is mounted under/minikube-host
(mode -493 =>).executing
rm -rf /
inside the minikube VM (or with ssh) would have a catastrophic effect (~ directory of the host machine deleted).Since minikube is made for testing purposes, executing deletion command is highly probable.
I think this default behavior is very dangerous and should be changed.
Regards
UPDATE:
This behavior is related to VirtualBox's driver, not to minikube's mount, disabling the fs mounts provided by the hypervisors should fix this behavior (by setting disable-driver-mounts to true)
thanks to @afbjorklund for his remarks
The text was updated successfully, but these errors were encountered: