Repository navigation
Support privileged executions. - #4677
Conversation
edd5dfc to
f8d23d3
Compare
vito
left a comment
There was a problem hiding this comment.
Just one concern about the engine config, otherwise LGTM!
There was a problem hiding this comment.
fwiw you could also set tcp://docker:2375 instead of calling Endpoint, but both are valid, just stylistic trade-offs
There was a problem hiding this comment.
There was a problem hiding this comment.
Previously I switched to having a blank default engine.toml and applying our own defaults at runtime, to make this config additive:
Line 32 in 275a713
The advantage of doing it this way is that when someone needs to add e.g. registry mirror config to engine.toml they don't need to keep updating it to include whatever other defaults we add.
insecure-entitlements is a little tricky though because it's hard to differentiate between the Buildkit default empty value and the user intentionally setting it to empty to prevent our default. 🤔
One option is to add our own flag to the engine like --disable-insecure-root-capabilities that prevents us from adding these defaults.
There was a problem hiding this comment.
Yep that makes sense, what do you think about this:
- Update the setting of the worker label to be automatic in main based on whether the entitlement is present or not. This remove the need for that whole section of config.
- Move the default shim binary setting to also be in our main, next to the other default engine config settings you added
- Leave in a a default toml config, but now it consists just of
debug = true
insecure-entitlements = ["security.insecure"]
I updated with the above, let me know what you think. My concern with --disable-insecure-root-capabilities as a flag is that it gets confusing to explain in combination with the existing buildkit flag and in general I think it's simpler to only have to explain to users where they need to change a toml config file rather than start explaining mixes of toml configs, command line flags, entrypoint settings, etc.
Users who want a custom toml config will need to include those two lines, but that seems like not too much to ask or subject to lots of change in the same way the more complicated networking/worker configs are. So overall felt like a good balance.
There was a problem hiding this comment.
Nice, yeah that seems like a good balance since now engine.toml only contains optional things and an empty one is valid again. 👍
There was a problem hiding this comment.
👍 - neat idea; I had a similar problem in #4711 where the schema needed to know the DNS domain. I decided to just remove it but this makes sense too, and might be useful information to make available to an operator if we decide to keep it after all.
There was a problem hiding this comment.
Yeah I have a local branch w/ a half-written operator api implementation, which this would fit in nicely with. Unfortunately I keep finding barely good enough workarounds such as this one for it to make sense to go finish that implementation, but someday! In the meantime, worker labels are (terrible) read-only kv api I guess.
Signed-off-by: Erik Sipsma <[email protected]>
This adds a new bool flag called
InsecureRootCapabilitiestoWithExecoptions that enables privileged execution of containers. See discussion here for reasoning behind allowing this to be set in the engine (though the field itself defaults tofalse). The operator manual is also updated with instructions on disabling it if needed.Went with the name
InsecureRootCapabilitiesbecause it conveys that it's inherently insecure (security onus is on the user) and technically accurate in that it results in root capabilities being inherited by the process (whereas "privileged" is somewhat more ambiguous). Feel free to bikeshed away though.In the longer run it would be great to give users fine grain settings for which capabilities should be inherited, but that can be added later in a backwards compatible way if needed.
Resolves #3874