-
Notifications
You must be signed in to change notification settings - Fork 18.9k
[feature]: add daemon flag to set no_new_priv as default for unprivileged containers #29984
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
Conversation
|
As commented previously, we need to also support the old syntax without |
|
Actually old usage is still supported. I don't remove here. |
|
Ok, if you could add the tests then with the old and new forms, and a test of the daemon flag that would be great |
|
Sure, have done, please let me know if there is any problem. |
daemon/daemon_unix.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this match is not very precise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
opt case: no-new-privileges|no-new-privileges=true|no-new-privileges=false
wrong input? no-new-privileges=abc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not match : really-no-new-privileges, no-new-privileges-please=true etc
|
The test failure is which needs fixing (maybe changed at the time you rebased?) |
|
Have updated, please review again. |
daemon/config_unix.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I read the linked issue this would be true by default. Is that not the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is false by default. @justincormack , what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, false by default, to be compatible with the current state, otherwise things will break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification @justincormack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe default-no-new-privileges otherwise it looks like it's doing something to do the daemon.
|
This one: #29951
Cleared up now, thanks.
…On 01/09/2017 06:29 PM, Daniel Zhang wrote:
jmzwcn commented on this pull request.
> @@ -89,6 +90,7 @@ func (config *Config) InstallFlags(flags *pflag.FlagSet) {
flags.Int64Var(&config.CPURealtimePeriod, "cpu-rt-period", 0, "Limit the CPU real-time period in microseconds")
flags.Int64Var(&config.CPURealtimeRuntime, "cpu-rt-runtime", 0, "Limit the CPU real-time runtime in microseconds")
flags.StringVar(&config.SeccompProfile, "seccomp-profile", "", "Path to seccomp profile")
+ flags.BoolVar(&config.NoNewPrivileges, "no-new-privileges", false, "Disable container processes from gaining new privileges")
which link? I think It is false by default.
|
13d259f to
22faa88
Compare
|
Sorry, its a bit hectic with getting 1.13 released, I will take a look
again soon...
…On 12 Jan 2017 2:50 p.m., "Daniel Zhang" ***@***.***> wrote:
Any review?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#29984 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAdcPH-3l4KTVb44FFr-nykK6mTRRxaLks5rRj2xgaJpZM4Ld3rr>
.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't make this unrelated change (MTU is normal anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lower in this file there is also a section "This is a full example of the allowed configuration options on Linux:" which should also have this added as "no-new-privileges":false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems not get what you said:
--no-new-privileges Disable container processes from gaining new privileges
how to modify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I just mean in this section https://github.com/docker/docker/blob/master/docs/reference/commandline/dockerd.md#linux-configuration-file it needs to be added in the example config file.
|
Two minor comments but otherwise this looks fine, tested it thoroughly and it is working fine. Thanks very much for doing this. |
|
@jmzwcn It can go in a platform file, just that it will need to be defined on each platform. |
ec2aa4b to
dc6832a
Compare
cpuguy83
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, looks much cleaner. Thanks!
LGTM
|
The conflict happen again. If no problem, please merge ASAP. Thanks! |
…ners. Signed-off-by: Daniel Zhang <[email protected]>
|
ping @justincormack |
| } | ||
|
|
||
| // TestLegacyRunNoNewPrivSetuid checks that --security-opt=no-new-privileges prevents | ||
| // effective uid transtions on executing setuid binaries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/transtions/transitions/
|
The actual flag to set this got lost in a rebase, and was added again in #32944 |
[feature]: add daemon flag to set no_new_priv as default for unprivileged containers #29951
Signed-off-by: Daniel Zhang [email protected]