daemon: add a flag to override the default seccomp profile#24221
daemon: add a flag to override the default seccomp profile#24221runcom wants to merge 1 commit intomoby:masterfrom
Conversation
|
But doesn't |
You mean on the daemon? I don't think there's any The above is per container, while this PR is about replacing the default seccomp profile applied to all containers with a daemon flag |
|
Yes we want to allow distributions and users to select their seccomp defaults. This content should also not be hidden inside of the source code. Allow people to easily examine the seccomp filters on their hosts. Would eventually allow users of older more stable versions of docker to update their seccomp filters if they were improved in newer versions of docker. |
|
👍 This allows one to tune it at the daemon level without passing flag per invocation. |
|
Ping @justincormack |
|
idea seems fine to me |
|
My worry is that Dockerfiles that build fine on one daemon may not build on another daemon if another profile is set. Similar; containers may not run if the default profile is changed. I understand the use case, just wondering what the best approach is for that |
|
hmm all good points On Fri, Jul 1, 2016 at 3:48 PM, Sebastiaan van Stijn <
Jessie Frazelle |
I believe it's a configuration options much like |
|
is --dns and all other dns flags doing the same in daemon and docker run? |
by setting
containers may be wrong configured with the above flag as well and it will wrongly run as well
same as above I suspect |
|
Yes, so possibly I'm either overthinking things, or we made bad decisions in the past. I'm just thinking of the reports we received after we just introduced the seccomp profiles, and some thing were blocked that resulted in images not able to build due to that |
|
do you have any use case in mind where this would break or any specific issue I can look at? is there any difference between erroring out because seccomp blocked something or running with a misconfigured built container (the dns cases)? |
|
@thaJeztah If someone is changing defaults at daemon level, one could assume that they know what they are doing. |
|
@mrunalp yes, so perhaps I'm just overthinking the implications, idk, interested to hear what others think |
|
like they do for dns and network options - I believe it's reasonable to let daemon ops configure how containers are configured and should behave by default |
|
I tend to agree with @runcom, there is plenty way to make daemon not act the same way based on custom options and as @mrjana said "If someone is changing defaults at daemon level, one could assume that they know what they are doing.". So I'm fine with adding this options at the daemon level. Maybe in the documentation we could/should add a note about "by doing that, be aware of what you're doing because you might break stuff", but other than that 👍. |
|
Just changing the setting on --selinux-enabled or not has big ramifications on what can go wrong on the daemon level. I don't see misconfiguring the docker daemon as a valid reason to block this. I would argue that the docker package should ship a default external config, then it would be easy to see what the user/distribution changed that could cause the breakage. As opposed to having the configuration hard coded into the source. |
d4c5a6a to
1808907
Compare
|
added integration tests and docs and yes, it's pretty the same as |
73cd6f8 to
7633ab3
Compare
|
I think this is ok in principal, I think though that we should extend the json format a bit for this use case, as it is not as expressive as the default profile, which has conditionals based on architecture and (more importantly) capabilities. For one off use with |
|
I think it's nice to have conditionals for the shipped default profile (those came after). I still think it's valuable to let an administrator to choose whatever he wants at the daemon level if he chooses to do so. |
right I meant to say the new format won't be ok to run with docker-engine < 1.13 |
|
@runcom yes I am fine with that. For the case where users are doing |
|
and we define an internal map of sub arches to use if one passes x86_64, could this work out? or |
|
@justincormack https://paste.fedoraproject.org/389911/ -> this is what it looks like with multiple names |
|
@runcom I really like that format compared to what we have now, actually. Readability is much improved compared to what we have right now. Potential concern: I have no idea what the subarchitectures for MIPS should actually look like, but I have a feeling the ones you specified aren't quite correct? Someone actually familiar with the architecture would have to look at it. |
|
@mheon I put those mips subarches in, it is quite possible that the top level n32 ones should not be there actually, looking at it. I am not aware of anyone using seccomp on mips64 right now. (I think this may be correct though, but it would help if I had a machine to test with). |
|
@runcom for architectures we now have: we want to change to something like: So if you do not specify the specific architectures the map is used. (I think we can always assume you want the current architecture to be allowed). |
|
@runcom yes I think the "names" version is much more readable... |
|
@justincormack awesome (ack on arches, was my first thought as well that what we have now it's actually ok) What about inclusion filters? I don't believe we need exclusions - just include on such arches and caps it's ok, it'll be a bit more verbose but less complicated to deal with as well. |
|
@runcom I think we need exclusions for the current |
|
We can do that by including all arches except s390 and s390x and accepting arg at index 0, arg at index 1 otherwise (which will be the case with only s390x and s390) |
|
Oh I see |
|
We could use another syntax maybe and move includes to filters and use ! in front of caps and arches to mean exclusion |
|
I think I marginally prefer include/exclude, but filter would be fine too, just need to explain what the semantics are. filter is less clear about what the and/or semantics are, while include requires all to be true, exclude if any are true then do not apply, which seems intuitive. |
|
To allow future (possibly non-backward compatible) changes to the format, should we add a "version" to the file? |
I though about that, I don't have a strong opinion, maybe start to add version == 1 now? if version isn't in the json then it's assumed to be < 1 |
|
we actually need something to differentiate between the old and the new format since the old json format should still work if I've understood what @justincormack said before. |
|
Yes, it makes sense to add a version now I guess while we change it, even though there is nothing we can really do about it in older versions, but it will allow better errors in future. |
@justincormack the issue with Includes is I cannot specify more than one Architecture for a given syscall cause you run only with 1 arch at time and you can't "requires all to be true" |
|
@justincormack so maybe it makes sense to allow just 1 arch and be more verbose (?): |
|
@runcom ah yes. includes wants to be 'or' then, and excludes exclude if any. |
|
@justincormack thanks for merging the other PR, I'll rebase and work on this one asap. |
|
Might be clearer to open a new one... On 2 Sep 2016 9:26 a.m., "Antonio Murdaca" notifications@github.com wrote:
|
|
Alright |
- What I did
I've added a new daemon flag
--seccomp-profile=/path/to/seccomp.jsonto be able to use a custom default seccomp profile instead of the docker's default. This will allow people to run by default with their own default seccomp profile instead of overriding the docker's default per container.- How I did it
Added a new daemon flag
--seccomp-profile=/path/to/seccomp.json- How to verify it
You can run the daemon with
--seccomp-profile=$DOCKERSRC/profiles/seccomp/default.jsonand tweak it to verify seccomp rules are ok when running containers.- Description for the changelog
Add a daemon flag to override the default seccomp profile
- A picture of a cute animal (not mandatory but encouraged)
TODO (after design review)
command completionFOLLOW UP @albers @sdurrheimer/cc @rhatdan @mrunalp @jfrazelle @thaJeztah @LK4D4 @cpuguy83 @justincormack
Signed-off-by: Antonio Murdaca runcom@redhat.com