-
Notifications
You must be signed in to change notification settings - Fork 374
virtcontainers: Pass seccomp profile inside VM #689
Conversation
Build failed (third-party-check pipeline) integration testing with
|
Not sure the agent support |
Build failed (third-party-check pipeline) integration testing with
|
@jodh-intel @nitkon I was thinking, shouldn't this PR introduce a new config option inside |
@sboeuf - ah you mean we should have that option so the runtime is clear that seccomp support must be provided by the agent in the image, or else it needs to fail? Yes, I agree. This is the same sort of issue as:
|
@sboeuf @jodh-intel :
Case 2: If we are thinking of implementing via configuration.toml, then ....
and error out saying "agent does not support seccomp. "
runtime/virtcontainers/kata_agent.go Line 724 in a5e82c1
runtime/virtcontainers/kata_agent_test.go Line 454 in a5e82c1
|
|
@nitkon the problem with enabling this by default is that even when you're not passing any seccomp from the CLI, the spec won't be nil, and this will trigger libcontainer to try to use seccomp. Please try to look into the way seccomp is actually carried from the CLI to the agent, and identify where it's providing a My advice would be to dump the spec in various places so that you can figure this out. |
If the user does not provide any seccomp profile explicitly, then do we not want the default seccomp provided by docker to be applied to our container? If we want the default seccomp profile to be applied to each container, we should have both agent and rootfs seccomp capable always and not optional. It might affect size and boot time, but will provide additional security.
You mean to say when no seccomp profile is provided by the user, make sure the default seccomp is dropped inside the agent, resulting in libcontainer not trying to use the default seccomp?
Sure. Thanks for the input. |
As you mentioned, we don't want to affect our boot time and memory footprint by enabling seccomp. At least for now. But I understand that some people might want this extra feature and that's what you're trying to enable here. Also, because the spec that we get might have a default seccomp, then we have no other choice than letting the user decide if he wants to use seccomp or not. And in our case, this translates as a configuration option. |
I'd appreciate it if the team could review the following (very carefully), but I think this summarises the main scenarios we need to handle in code (and tests!!)...
Footnotes:
|
@jodh-intel - would it be easy for you to add maybe an |
@grahamwhaley - you mean drop the existing "seccomp enforced?" column and bundle into the next column? |
Table updated with more details on the column meanings. |
Ah, that is what that column means! ;-) - then, np @jodh-intel as it is. thx! |
Hi @jodh-intel , thanks for the table 👍
|
Hi @nitkon
Having thought about this a little more, I'm not sure I like the idea of the config file determining whether seccomp support should be enabled. Instead, I think that when Kata fully supports seccomp, the config file should be used to tell the runtime how to behave depending on what sort of seccomp environment it's running in. And we should probe to determine whether the agent/image is seccomp-capable. If we rely on the config file to determine whether seccomp should be used, there are three possible scenarios when a seccomp profile is provided but the config file disables seccomp:
That last one is the nasty one of course. Also, it begs the question how will the admin know if the image supports seccomp? Even if the image itself has the seccomp libraries installed (which
Yes, but it doesn't currently have that capability - it just drops it. So by "handling" I mean that the runtime can heuristically decide what to do.
See above.
Again, see above ;) I think a better design might be to introduce a new gRPC agent call that the runtime can make before it sends over the OCI spec (including the seccomp profile). That gRPC call would tell the runtime whether the agent can deal with seccomp or not. That would be a pure agent call - again, we don't want libcontainer getting involved at this stage. Something like:
(Aside: In fact, I wonder if we want to replace Once that
The problem is that the "current behaviour" != "best behaviour" in the scenario where the agent does support seccomp since the default behaviour should probably be to enforce, so I think we'll need to break the current behaviour (by making seccomp enforced if available) to ensure the users get the safest possible default config. [*] - However, we may need to come up with a config option to handle this scenario if the admin has requested that seccomp be disabled even though the agent supports it. |
@jodh-intel Yes, I agree. |
@nitkon - I've raised kata-containers/agent#381 for adding a new gRPC call. I'm happy to look at that if you want? |
@jodh-intel : Okay sure. Go ahead :-) |
@nitkon - ok, I've assigned it to myself and hope to look at that today/tomorrow "with a following wind" ;) |
@nitkon @jodh-intel ping looks like #381 is closed. Was that what we needed for this? |
Yes, kata-containers/agent#381 is now closed. I'm probably going to raise a PR to move that call in the runtime, but the call will still be made. As such, @nitkon can re-vendor the agent into the runtime to get the latest version of |
ping @nitkon |
@nitkon ping (From your weekly Kata herder) |
/test
On Dec 5, 2018 20:43, "nitkon" <notifications@github.com> wrote:
Travis-CI is passing. Can someone start the jenkins CI test?
ping for review @jodh-intel <https://github.com/jodh-intel> @bergwolf
<https://github.com/bergwolf> @egernst <https://github.com/egernst>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#689 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADTbLrh0M6VeHfm7KumdTORX6ve14-Nks5u179-gaJpZM4WW7cg>
.
|
/retest |
The test failures are not related to the PR. Let's have a retest. |
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.
Just one comment. Otherwise looks good to me. Thanks @nitkon !
virtcontainers/kata_agent.go
Outdated
@@ -986,9 +987,18 @@ func (k *kataAgent) createContainer(sandbox *Sandbox, c *Container) (p *Process, | |||
return nil, err | |||
} | |||
|
|||
request := &grpc.GuestDetailsRequest{ |
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.
We already query guest details in getAndStoreGuestDetails()
. Please just save the secomp results got from there and then we can use it everywhere. By saving it, please add it to Sandbox
and also save it on disk so that we can access it again after the very first create sandbox call.
/retest |
1 similar comment
/retest |
/retest |
@nitkon ready to merge? |
ping @nitkon |
@raravena80 : Sorry for the late reply. I was caught up in some personal work. Yes the PR is good to merge. @bergwolf I shall optimize it in a follow-up PR later ... |
Updated my PR. Not started the tests as all tests are failing for a couple of days... |
d69eca3
to
8086cad
Compare
Re-pushed the PR as there was some |
/test |
Pass Seccomp profile to the agent only if the configuration.toml allows it to be passed and the agent/image is seccomp capable. Fixes: kata-containers#688 Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
/test |
CI's are passing now. All green. @jodh-intel @grahamwhaley |
…anch-bump # Kata Containers 1.10.0-alpha1
Seccomp profile was dropped as agent, inside the VM,
was not capable of handling it. Allow it to be passed
as agent binary is now build with -tags "seccomp" and
the image on the guest would have libseccomp installed.
Fixes: #688
Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com