-
Notifications
You must be signed in to change notification settings - Fork 26
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
Limiting HostConfig.Binds and HostConfig.Mounts is extremely easy to defeat #34
Comments
A patch like this might suffice:
But I'm unable to test it. If I simply replace the built file, docker complains it can't validate the file. If I try to install from local file, it says invalid reference format... Anyone? |
Any update? It'd be great to add a simple check if the target is symlink or not. As of now, this omission renders the plugin quite pointless :( |
@bviktor I've been working some on this plugin for the past couple of days, and I stumbled on this issue now. Do I get it right that in your example, the "Mounts": [
{
"Source": "/home/ubuntu/root",
"Target": "/host-root",
"Type": "bind"
}
] I don't really understand the suggested patch though. Would this not be better fixed in the plugin than in OPA? |
@anderseknert I have the same problem. |
How about something like this (non-functional):
I'm new to go, so this is not correct, you can't access the body.HostConfig.Binds like that... |
Thanks @flixr! I'll take a shot at this, we'll see how it goes :) |
I started this in #61, hopefully will have some more time to test it this week... |
Sure! Let me know how it goes and if you need some help later 👍 |
Hi, Yes. You restrict bind mounts to say, Nevermind the patch, I realized since then that it's completely not the way to do it. In the meanwhile, it also came up that this interferes with volumes in docker-compose too, due to the ........ idiotic way Docker does things. If you start Docker from the CLI, this is the
This is after a docker-compose run with volumes:
Yes, you read that right. The structure is different. In the first case its This is my current policy file, which already deals with simple volumes, like:
But not with docker-compose. Ouch. For the record, this is the full docker JSON after running a container with a volume attached:
|
Yes I see, one step at a time :) Still an awesome improvement! I'm really grateful for all the work guys. I'll prolly have to open separate tickets for all the quirks I just mentioned :) |
Consider this policy:
Now run this command:
All is well. Right? No, not quite.
Wow, just wow.
So, the solution seems obvious: dereference all paths defined on the command-line before running the AuthZ checks on them.
The text was updated successfully, but these errors were encountered: