On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:
> On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp wrote:> > > > From: Yuqiong Sun <suny@us.ibm.com>> > > > Add new CONFIG_IMA_NS config option. Let clone() create a new IMA> > namespace upon CLONE_NEWNS flag. Add ima_ns data structure in> > nsproxy.> > ima_ns is allocated and freed upon IMA namespace creation and exit.> > Currently, the ima_ns contains no useful IMA data but only a dummy> > interface. This patch creates the framework for namespacing the> > different> > aspects of IMA (eg. IMA-audit, IMA-measurement, IMA-appraisal).> > > > Signed-off-by: Yuqiong Sun <suny@us.ibm.com>> > > > Changelog:> > * Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag> > Hi,> > So this means that every mount namespace clone will clone a new IMA> namespace. Is that really ok?
Based on what: space concerns (struct ima_ns is reasonably small)? or
whether tying it to the mount namespace is the correct thing to do. On
the latter, it does seem that this should be a property of either the
mount or user ns rather than its own separate ns. I could see a use
where even a container might want multiple ima keyrings within the
container (say containerised apache service with multiple tenants), so
instinct tells me that mount ns is the correct granularity for this.
James

On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:
> On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:> > On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp wrote:> > > > > > From: Yuqiong Sun <suny@us.ibm.com>> > > > > > Add new CONFIG_IMA_NS config option. Let clone() create a new IMA> > > namespace upon CLONE_NEWNS flag. Add ima_ns data structure in> > > nsproxy.> > > ima_ns is allocated and freed upon IMA namespace creation and exit.> > > Currently, the ima_ns contains no useful IMA data but only a dummy> > > interface. This patch creates the framework for namespacing the> > > different> > > aspects of IMA (eg. IMA-audit, IMA-measurement, IMA-appraisal).> > > > > > Signed-off-by: Yuqiong Sun <suny@us.ibm.com>> > > > > > Changelog:> > > * Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag> > > > Hi,> > > > So this means that every mount namespace clone will clone a new IMA> > namespace. Is that really ok?> > Based on what: space concerns (struct ima_ns is reasonably small)? or> whether tying it to the mount namespace is the correct thing to do. On
Mostly the latter. The other would be not so much space concerns as
time concerns. Many things use new mounts namespaces, and we wouldn't
want multiple IMA calls on all file accesses by all of those.
> the latter, it does seem that this should be a property of either the> mount or user ns rather than its own separate ns. I could see a use> where even a container might want multiple ima keyrings within the> container (say containerised apache service with multiple tenants), so> instinct tells me that mount ns is the correct granularity for this.
I wonder whether we could use echo 1 > /sys/kernel/security/ima/newns as
the trigger for requesting a new ima ns on the next clone(CLONE_NEWNS).

On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:
> On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:> > > > On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:> > > > > > On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp wrote:> > > > > > > > > > > > From: Yuqiong Sun <suny@us.ibm.com>> > > > > > > > Add new CONFIG_IMA_NS config option. Let clone() create a new> > > > IMA namespace upon CLONE_NEWNS flag. Add ima_ns data structure> > > > in nsproxy. ima_ns is allocated and freed upon IMA namespace> > > > creation and exit. Currently, the ima_ns contains no useful IMA> > > > data but only a dummy interface. This patch creates the> > > > framework for namespacing the different aspects of IMA (eg.> > > > IMA-audit, IMA-measurement, IMA-appraisal).> > > > > > > > Signed-off-by: Yuqiong Sun <suny@us.ibm.com>> > > > > > > > Changelog:> > > > * Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag> > > > > > Hi,> > > > > > So this means that every mount namespace clone will clone a new> > > IMA namespace. Is that really ok?> > > > Based on what: space concerns (struct ima_ns is reasonably small)?> > or whether tying it to the mount namespace is the correct thing to> > do. On> > Mostly the latter. The other would be not so much space concerns as> time concerns. Many things use new mounts namespaces, and we> wouldn't want multiple IMA calls on all file accesses by all of> those.> > > > > the latter, it does seem that this should be a property of either> > the mount or user ns rather than its own separate ns. I could see> > a use where even a container might want multiple ima keyrings> > within the container (say containerised apache service with> > multiple tenants), so instinct tells me that mount ns is the> > correct granularity for this.> > I wonder whether we could use echo 1 > /sys/kernel/security/ima/newns> as the trigger for requesting a new ima ns on the next> clone(CLONE_NEWNS).
I could go with that, but what about the trigger being installing or
updating the keyring? That's the only operation that needs namespace
separation, so on mount ns clone, you get a pointer to the old ima_ns
until you do something that requires a new key, which then triggers the
copy of the namespace and installing it?
James

On 07/25/2017 03:48 PM, Mimi Zohar wrote:
> On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:>> On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:>>> On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:>>>> On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:>>>>> On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp wrote:>>>>>>>>>>>> From: Yuqiong Sun <suny@us.ibm.com>>>>>>>>>>>>> Add new CONFIG_IMA_NS config option. Let clone() create a new>>>>>> IMA namespace upon CLONE_NEWNS flag. Add ima_ns data structure>>>>>> in nsproxy. ima_ns is allocated and freed upon IMA namespace>>>>>> creation and exit. Currently, the ima_ns contains no useful IMA>>>>>> data but only a dummy interface. This patch creates the>>>>>> framework for namespacing the different aspects of IMA (eg.>>>>>> IMA-audit, IMA-measurement, IMA-appraisal).>>>>>>>>>>>> Signed-off-by: Yuqiong Sun <suny@us.ibm.com>>>>>>>>>>>>> Changelog:>>>>>> * Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag>>>>> Hi,>>>>>>>>>> So this means that every mount namespace clone will clone a new>>>>> IMA namespace. Is that really ok?>>>> Based on what: space concerns (struct ima_ns is reasonably small)?>>>> or whether tying it to the mount namespace is the correct thing to>>>> do. On>>> Mostly the latter. The other would be not so much space concerns as>>> time concerns. Many things use new mounts namespaces, and we>>> wouldn't want multiple IMA calls on all file accesses by all of>>> those.>>>>>>> the latter, it does seem that this should be a property of either>>>> the mount or user ns rather than its own separate ns. I could see>>>> a use where even a container might want multiple ima keyrings>>>> within the container (say containerised apache service with>>>> multiple tenants), so instinct tells me that mount ns is the>>>> correct granularity for this.>>> I wonder whether we could use echo 1 > /sys/kernel/security/ima/newns>>> as the trigger for requesting a new ima ns on the next>>> clone(CLONE_NEWNS).>> I could go with that, but what about the trigger being installing or>> updating the keyring? That's the only operation that needs namespace>> separation, so on mount ns clone, you get a pointer to the old ima_ns>> until you do something that requires a new key, which then triggers the>> copy of the namespace and installing it?> It isn't just the keyrings that need to be namespaced, but the> measurement list and policy as well.>> IMA-measurement, IMA-appraisal and IMA-audit are all policy based.>> As soon as the namespace starts, measurements should be added to the> namespace specific measurement list, not it's parent.
IMA is about measuring things, logging what was executed, and finally
someone looking at the measurement log and detecting 'things'. So at
least one attack that needs to be prevented is a malicious person
opening an IMA namespace, executing something malicious, and not leaving
any trace on the host because all the logs went into the measurement
list of the IMA namespace, which disappeared. That said, I am wondering
whether there has to be a minimum set of namespaces (PID, UTS)
providing enough 'isolation' that someone may actually open an IMA
namespace and run their code. To avoid leaving no traces one could argue
to implement recursive logging, so something that is logged inside the
namespace will be detected in all parent containers up to the
init_ima_ns (host) because it's logged (and TPM extended) there as well.
The challenge with that is that logging costs memory and that can be
abused as well until the machine needs a reboot... I guess the solution
could be requesting an IMA namespace in one way or another but requiring
several other namespace flags in the clone() to actually 'get' it.
Jumping namespaces with setns() may have to be restricted as well once
there is an IMA namespace.
Stefan
>> Mimi>

On Tue, 2017-07-25 at 15:48 -0400, Mimi Zohar wrote:
> On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:> > > > On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:> > > > > > On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:> > > > > > > > > > > > On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:
[...]
> > > > the latter, it does seem that this should be a property of> > > > either the mount or user ns rather than its own separate ns. I> > > > could see a use where even a container might want multiple ima> > > > keyrings within the container (say containerised apache service> > > > with multiple tenants), so instinct tells me that mount ns is> > > > the correct granularity for this.> > > > > > I wonder whether we could use echo 1 >> > > /sys/kernel/security/ima/newns> > > as the trigger for requesting a new ima ns on the next> > > clone(CLONE_NEWNS).> > > > I could go with that, but what about the trigger being installing> > or updating the keyring? That's the only operation that needs> > namespace separation, so on mount ns clone, you get a pointer to> > the old ima_ns until you do something that requires a new key,> > which then triggers the copy of the namespace and installing it?> > It isn't just the keyrings that need to be namespaced, but the> measurement list and policy as well.
OK, so trigger to do a just in time copy would be new key or new
policy. The measurement list is basically just a has of a file taken
at a policy point. Presumably it doesn't change if we install a new
policy or key, so it sounds like it should be tied to the underlying
mount point? I'm thinking if we set up a hundred mount ns each
pointing to /var/container, we don't want /var/container/bin/something
to have 100 separate measurements each with the same hash.
> IMA-measurement, IMA-appraisal and IMA-audit are all policy based.> > As soon as the namespace starts, measurements should be added to the> namespace specific measurement list, not it's parent.
Would the measurement in a child namespace yield a different
measurement in the parent? I'm thinking not, because a measurement is
just a hash. Now if the signature of the hash in the xattr needs a
different key, obviously this differs, but the expensive part
(computing the hash) shouldn't change.
James
> Mimi> > _______________________________________________> Containers mailing list> Containers@lists.linux-foundation.org> https://lists.linuxfoundation.org/mailman/listinfo/containers

On Tue, Jul 25, 2017 at 04:11:29PM -0400, Stefan Berger wrote:
> On 07/25/2017 03:48 PM, Mimi Zohar wrote:> >On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:> >>On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:> >>>On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:> >>>>On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:> >>>>>On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp wrote:> >>>>>>> >>>>>>From: Yuqiong Sun <suny@us.ibm.com>> >>>>>>> >>>>>>Add new CONFIG_IMA_NS config option. Let clone() create a new> >>>>>>IMA namespace upon CLONE_NEWNS flag. Add ima_ns data structure> >>>>>>in nsproxy. ima_ns is allocated and freed upon IMA namespace> >>>>>>creation and exit. Currently, the ima_ns contains no useful IMA> >>>>>>data but only a dummy interface. This patch creates the> >>>>>>framework for namespacing the different aspects of IMA (eg.> >>>>>>IMA-audit, IMA-measurement, IMA-appraisal).> >>>>>>> >>>>>>Signed-off-by: Yuqiong Sun <suny@us.ibm.com>> >>>>>>> >>>>>>Changelog:> >>>>>>* Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag> >>>>>Hi,> >>>>>> >>>>>So this means that every mount namespace clone will clone a new> >>>>>IMA namespace. Is that really ok?> >>>>Based on what: space concerns (struct ima_ns is reasonably small)?> >>>>or whether tying it to the mount namespace is the correct thing to> >>>>do. On> >>>Mostly the latter. The other would be not so much space concerns as> >>>time concerns. Many things use new mounts namespaces, and we> >>>wouldn't want multiple IMA calls on all file accesses by all of> >>>those.> >>>> >>>>the latter, it does seem that this should be a property of either> >>>>the mount or user ns rather than its own separate ns. I could see> >>>>a use where even a container might want multiple ima keyrings> >>>>within the container (say containerised apache service with> >>>>multiple tenants), so instinct tells me that mount ns is the> >>>>correct granularity for this.> >>>I wonder whether we could use echo 1 > /sys/kernel/security/ima/newns> >>>as the trigger for requesting a new ima ns on the next> >>>clone(CLONE_NEWNS).> >>I could go with that, but what about the trigger being installing or> >>updating the keyring? That's the only operation that needs namespace> >>separation, so on mount ns clone, you get a pointer to the old ima_ns> >>until you do something that requires a new key, which then triggers the> >>copy of the namespace and installing it?> >It isn't just the keyrings that need to be namespaced, but the> >measurement list and policy as well.> >> >IMA-measurement, IMA-appraisal and IMA-audit are all policy based.> >> >As soon as the namespace starts, measurements should be added to the> >namespace specific measurement list, not it's parent.
Shouldn't it be both?
If not, then it seems to me this must be tied to user namespace.
> IMA is about measuring things, logging what was executed, and> finally someone looking at the measurement log and detecting> 'things'. So at least one attack that needs to be prevented is a> malicious person opening an IMA namespace, executing something> malicious, and not leaving any trace on the host because all the> logs went into the measurement list of the IMA namespace, which> disappeared. That said, I am wondering whether there has to be a> minimum set of namespaces (PID, UTS) providing enough 'isolation'> that someone may actually open an IMA namespace and run their code.> To avoid leaving no traces one could argue to implement recursive> logging, so something that is logged inside the namespace will be> detected in all parent containers up to the init_ima_ns (host)> because it's logged (and TPM extended) there as well. The challenge> with that is that logging costs memory and that can be abused as> well until the machine needs a reboot... I guess the solution could> be requesting an IMA namespace in one way or another but requiring> several other namespace flags in the clone() to actually 'get' it.> Jumping namespaces with setns() may have to be restricted as well> once there is an IMA namespace.
Wait. So if I create a new IMA namespace, the things I run in
that namespace are not subject to the parent namespace policy?
-serge

On Tue, 2017-07-25 at 13:31 -0700, James Bottomley wrote:
> On Tue, 2017-07-25 at 15:48 -0400, Mimi Zohar wrote:> > On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:> > > > > > On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:> > > > > > > > On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:> > > > > > > > > > > > > > > On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:> [...]> > > > > the latter, it does seem that this should be a property of> > > > > either the mount or user ns rather than its own separate ns. I> > > > > could see a use where even a container might want multiple ima> > > > > keyrings within the container (say containerised apache service> > > > > with multiple tenants), so instinct tells me that mount ns is> > > > > the correct granularity for this.> > > > > > > > I wonder whether we could use echo 1 >> > > > /sys/kernel/security/ima/newns> > > > as the trigger for requesting a new ima ns on the next> > > > clone(CLONE_NEWNS).> > > > > > I could go with that, but what about the trigger being installing> > > or updating the keyring? That's the only operation that needs> > > namespace separation, so on mount ns clone, you get a pointer to> > > the old ima_ns until you do something that requires a new key,> > > which then triggers the copy of the namespace and installing it?> > > > It isn't just the keyrings that need to be namespaced, but the> > measurement list and policy as well.> > OK, so trigger to do a just in time copy would be new key or new> policy.
The kernel has support for an initial builtin policy, which can be
later replaced. The builtin policies, if specified, begin measuring
files very early in the boot process. Similarly for namespace, we
would want to start measuring files as early as possible.
> The measurement list is basically just a has of a file taken> at a policy point. Presumably it doesn't change if we install a new> policy or key, so it sounds like it should be tied to the underlying> mount point? I'm thinking if we set up a hundred mount ns each> pointing to /var/container, we don't want /var/container/bin/something> to have 100 separate measurements each with the same hash.> > > IMA-measurement, IMA-appraisal and IMA-audit are all policy based.> > > > As soon as the namespace starts, measurements should be added to the> > namespace specific measurement list, not it's parent.> > Would the measurement in a child namespace yield a different> measurement in the parent? I'm thinking not, because a measurement is> just a hash. Now if the signature of the hash in the xattr needs a> different key, obviously this differs, but the expensive part> (computing the hash) shouldn't change.
Depending on the measurement list template format (eg. ima-ng, ima-
sig, custom template format), the template data would contain the file
hash, but in addition it might contain the file signature. As keys
could be namespace specific, the file signatures could be different.
Mimi

On Tue, 2017-07-25 at 15:46 -0500, Serge E. Hallyn wrote:
> On Tue, Jul 25, 2017 at 04:11:29PM -0400, Stefan Berger wrote:> > On 07/25/2017 03:48 PM, Mimi Zohar wrote:> > >On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:> > >>On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:> > >>>On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:> > >>>>On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:> > >>>>>On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp wrote:> > >>>>>>> > >>>>>>From: Yuqiong Sun <suny@us.ibm.com>> > >>>>>>> > >>>>>>Add new CONFIG_IMA_NS config option. Let clone() create a new> > >>>>>>IMA namespace upon CLONE_NEWNS flag. Add ima_ns data structure> > >>>>>>in nsproxy. ima_ns is allocated and freed upon IMA namespace> > >>>>>>creation and exit. Currently, the ima_ns contains no useful IMA> > >>>>>>data but only a dummy interface. This patch creates the> > >>>>>>framework for namespacing the different aspects of IMA (eg.> > >>>>>>IMA-audit, IMA-measurement, IMA-appraisal).> > >>>>>>> > >>>>>>Signed-off-by: Yuqiong Sun <suny@us.ibm.com>> > >>>>>>> > >>>>>>Changelog:> > >>>>>>* Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag> > >>>>>Hi,> > >>>>>> > >>>>>So this means that every mount namespace clone will clone a new> > >>>>>IMA namespace. Is that really ok?> > >>>>Based on what: space concerns (struct ima_ns is reasonably small)?> > >>>>or whether tying it to the mount namespace is the correct thing to> > >>>>do. On> > >>>Mostly the latter. The other would be not so much space concerns as> > >>>time concerns. Many things use new mounts namespaces, and we> > >>>wouldn't want multiple IMA calls on all file accesses by all of> > >>>those.> > >>>> > >>>>the latter, it does seem that this should be a property of either> > >>>>the mount or user ns rather than its own separate ns. I could see> > >>>>a use where even a container might want multiple ima keyrings> > >>>>within the container (say containerised apache service with> > >>>>multiple tenants), so instinct tells me that mount ns is the> > >>>>correct granularity for this.> > >>>I wonder whether we could use echo 1 > /sys/kernel/security/ima/newns> > >>>as the trigger for requesting a new ima ns on the next> > >>>clone(CLONE_NEWNS).> > >>I could go with that, but what about the trigger being installing or> > >>updating the keyring? That's the only operation that needs namespace> > >>separation, so on mount ns clone, you get a pointer to the old ima_ns> > >>until you do something that requires a new key, which then triggers the> > >>copy of the namespace and installing it?> > >It isn't just the keyrings that need to be namespaced, but the> > >measurement list and policy as well.> > >> > >IMA-measurement, IMA-appraisal and IMA-audit are all policy based.> > >> > >As soon as the namespace starts, measurements should be added to the> > >namespace specific measurement list, not it's parent.> > Shouldn't it be both?
The policy defines which files are measured. The namespace policy
could be different than it's parent's policy, and the parent's policy
could be different than the native policy. Basically, file
measurements need to be added to the namespace measurement list,
recursively, up to the native measurement list.
Mimi
> > If not, then it seems to me this must be tied to user namespace.> > > IMA is about measuring things, logging what was executed, and> > finally someone looking at the measurement log and detecting> > 'things'. So at least one attack that needs to be prevented is a> > malicious person opening an IMA namespace, executing something> > malicious, and not leaving any trace on the host because all the> > logs went into the measurement list of the IMA namespace, which> > disappeared. That said, I am wondering whether there has to be a> > minimum set of namespaces (PID, UTS) providing enough 'isolation'> > that someone may actually open an IMA namespace and run their code.> > To avoid leaving no traces one could argue to implement recursive> > logging, so something that is logged inside the namespace will be> > detected in all parent containers up to the init_ima_ns (host)> > because it's logged (and TPM extended) there as well. The challenge> > with that is that logging costs memory and that can be abused as> > well until the machine needs a reboot... I guess the solution could> > be requesting an IMA namespace in one way or another but requiring> > several other namespace flags in the clone() to actually 'get' it.> > Jumping namespaces with setns() may have to be restricted as well> > once there is an IMA namespace.> > Wait. So if I create a new IMA namespace, the things I run in> that namespace are not subject to the parent namespace policy?

On 07/25/2017 04:46 PM, Serge E. Hallyn wrote:
> On Tue, Jul 25, 2017 at 04:11:29PM -0400, Stefan Berger wrote:>> On 07/25/2017 03:48 PM, Mimi Zohar wrote:>>> On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:>>>> On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:>>>>> On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:>>>>>> On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:>>>>>>> On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp wrote:>>>>>>>> From: Yuqiong Sun <suny@us.ibm.com>>>>>>>>>>>>>>>>> Add new CONFIG_IMA_NS config option. Let clone() create a new>>>>>>>> IMA namespace upon CLONE_NEWNS flag. Add ima_ns data structure>>>>>>>> in nsproxy. ima_ns is allocated and freed upon IMA namespace>>>>>>>> creation and exit. Currently, the ima_ns contains no useful IMA>>>>>>>> data but only a dummy interface. This patch creates the>>>>>>>> framework for namespacing the different aspects of IMA (eg.>>>>>>>> IMA-audit, IMA-measurement, IMA-appraisal).>>>>>>>>>>>>>>>> Signed-off-by: Yuqiong Sun <suny@us.ibm.com>>>>>>>>>>>>>>>>> Changelog:>>>>>>>> * Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag>>>>>>> Hi,>>>>>>>>>>>>>> So this means that every mount namespace clone will clone a new>>>>>>> IMA namespace. Is that really ok?>>>>>> Based on what: space concerns (struct ima_ns is reasonably small)?>>>>>> or whether tying it to the mount namespace is the correct thing to>>>>>> do. On>>>>> Mostly the latter. The other would be not so much space concerns as>>>>> time concerns. Many things use new mounts namespaces, and we>>>>> wouldn't want multiple IMA calls on all file accesses by all of>>>>> those.>>>>>>>>>>> the latter, it does seem that this should be a property of either>>>>>> the mount or user ns rather than its own separate ns. I could see>>>>>> a use where even a container might want multiple ima keyrings>>>>>> within the container (say containerised apache service with>>>>>> multiple tenants), so instinct tells me that mount ns is the>>>>>> correct granularity for this.>>>>> I wonder whether we could use echo 1 > /sys/kernel/security/ima/newns>>>>> as the trigger for requesting a new ima ns on the next>>>>> clone(CLONE_NEWNS).>>>> I could go with that, but what about the trigger being installing or>>>> updating the keyring? That's the only operation that needs namespace>>>> separation, so on mount ns clone, you get a pointer to the old ima_ns>>>> until you do something that requires a new key, which then triggers the>>>> copy of the namespace and installing it?>>> It isn't just the keyrings that need to be namespaced, but the>>> measurement list and policy as well.>>>>>> IMA-measurement, IMA-appraisal and IMA-audit are all policy based.>>>>>> As soon as the namespace starts, measurements should be added to the>>> namespace specific measurement list, not it's parent.> Shouldn't it be both?>> If not, then it seems to me this must be tied to user namespace.>>> IMA is about measuring things, logging what was executed, and>> finally someone looking at the measurement log and detecting>> 'things'. So at least one attack that needs to be prevented is a>> malicious person opening an IMA namespace, executing something>> malicious, and not leaving any trace on the host because all the>> logs went into the measurement list of the IMA namespace, which>> disappeared. That said, I am wondering whether there has to be a>> minimum set of namespaces (PID, UTS) providing enough 'isolation'>> that someone may actually open an IMA namespace and run their code.>> To avoid leaving no traces one could argue to implement recursive>> logging, so something that is logged inside the namespace will be>> detected in all parent containers up to the init_ima_ns (host)>> because it's logged (and TPM extended) there as well. The challenge>> with that is that logging costs memory and that can be abused as>> well until the machine needs a reboot... I guess the solution could>> be requesting an IMA namespace in one way or another but requiring>> several other namespace flags in the clone() to actually 'get' it.>> Jumping namespaces with setns() may have to be restricted as well>> once there is an IMA namespace.> Wait. So if I create a new IMA namespace, the things I run in> that namespace are not subject to the parent namespace policy?
We would treat the IMA namespace policy independently of the host
policy. A user can sign his containers' files with his own keys, upload
the container to the cloud and run them with keys that are different
than those of the host. The keys (actually certs) would be found in the
container, same for the policy.
Stefan
>> -serge>

On 07/27/2017 01:18 PM, Magalhaes, Guilherme (Brazil R&D-CL) wrote:
>>> -----Original Message----->> From: Mimi Zohar [mailto:zohar@linux.vnet.ibm.com]>> Sent: quinta-feira, 27 de julho de 2017 11:39>> To: Magalhaes, Guilherme (Brazil R&D-CL)>> <guilherme.magalhaes@hpe.com>; Serge E. Hallyn <serge@hallyn.com>>> Cc: Mehmet Kayaalp <mkayaalp@cs.binghamton.edu>; Yuqiong Sun>> <sunyuqiong1988@gmail.com>; containers <containers@lists.linux->> foundation.org>; linux-kernel <linux-kernel@vger.kernel.org>; David Safford>> <david.safford@ge.com>; James Bottomley>> <James.Bottomley@HansenPartnership.com>; linux-security-module <linux->> security-module@vger.kernel.org>; ima-devel <linux-ima->> devel@lists.sourceforge.net>; Yuqiong Sun <suny@us.ibm.com>>> Subject: Re: [Linux-ima-devel] [RFC PATCH 1/5] ima: extend clone() with IMA>> namespace support>>>> On Thu, 2017-07-27 at 12:51 +0000, Magalhaes, Guilherme (Brazil R&D->> CL) wrote:>>>>>>> On Tue, 2017-07-25 at 16:08 -0500, Serge E. Hallyn wrote:>>>>> On Tue, Jul 25, 2017 at 04:57:57PM -0400, Mimi Zohar wrote:>>>>>> On Tue, 2017-07-25 at 15:46 -0500, Serge E. Hallyn wrote:>>>>>>> On Tue, Jul 25, 2017 at 04:11:29PM -0400, Stefan Berger wrote:>>>>>>>> On 07/25/2017 03:48 PM, Mimi Zohar wrote:>>>>>>>>> On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:>>>>>>>>>> On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:>>>>>>>>>>> On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley>> wrote:>>>>>>>>>>>> On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:>>>>>>>>>>>>> On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp>>>> wrote:>>>>>>>>>>>>>> From: Yuqiong Sun <suny@us.ibm.com>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Add new CONFIG_IMA_NS config option. Let clone() create>> a>>>>>>>>>>>>>> new IMA namespace upon CLONE_NEWNS flag. Add>> ima_ns>>>> data>>>>>>>>>>>>>> structure in nsproxy. ima_ns is allocated and freed upon>>>>>>>>>>>>>> IMA namespace creation and exit. Currently, the ima_ns>>>>>>>>>>>>>> contains no useful IMA data but only a dummy interface.>>>>>>>>>>>>>> This patch creates the framework for namespacing the>>>> different aspects of IMA (eg.>>>>>>>>>>>>>> IMA-audit, IMA-measurement, IMA-appraisal).>>>>>>>>>>>>>>>>>>>>>>>>>>>> Signed-off-by: Yuqiong Sun <suny@us.ibm.com>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Changelog:>>>>>>>>>>>>>> * Use CLONE_NEWNS instead of a new CLONE_NEWIMA>> flag>>>>>>>>>>>>> Hi,>>>>>>>>>>>>>>>>>>>>>>>>>> So this means that every mount namespace clone will clone>> a>>>>>>>>>>>>> new IMA namespace. Is that really ok?>>>>>>>>>>>> Based on what: space concerns (struct ima_ns is reasonably>>>> small)?>>>>>>>>>>>> or whether tying it to the mount namespace is the correct>>>>>>>>>>>> thing to do. On>>>>>>>>>>> Mostly the latter. The other would be not so much space>>>>>>>>>>> concerns as time concerns. Many things use new mounts>>>>>>>>>>> namespaces, and we wouldn't want multiple IMA calls on all>>>>>>>>>>> file accesses by all of those.>>>>>>>>>>>>>>>>>>>>>>> the latter, it does seem that this should be a property of>>>>>>>>>>>> either the mount or user ns rather than its own separate ns.>>>>>>>>>>>> I could see a use where even a container might want multiple>>>>>>>>>>>> ima keyrings within the container (say containerised apache>>>>>>>>>>>> service with multiple tenants), so instinct tells me that>>>>>>>>>>>> mount ns is the correct granularity for this.>>>>>>>>>>> I wonder whether we could use echo 1 >>>>>>>>>>>> /sys/kernel/security/ima/newns as the trigger for requesting>>>>>>>>>>> a new ima ns on the next clone(CLONE_NEWNS).>>>>>>>>>> I could go with that, but what about the trigger being>>>>>>>>>> installing or updating the keyring? That's the only operation>>>>>>>>>> that needs namespace separation, so on mount ns clone, you>> get>>>>>>>>>> a pointer to the old ima_ns until you do something that>>>>>>>>>> requires a new key, which then triggers the copy of the>> namespace>>>> and installing it?>>>>>>>>> It isn't just the keyrings that need to be namespaced, but the>>>>>>>>> measurement list and policy as well.>>>>>>>>>>>>>>>>>> IMA-measurement, IMA-appraisal and IMA-audit are all policy>>>> based.>>>>>>>>> As soon as the namespace starts, measurements should be>> added>>>>>>>>> to the namespace specific measurement list, not it's parent.>>>>>>> Shouldn't it be both?>>>>>> The policy defines which files are measured. The namespace policy>>>>>> could be different than it's parent's policy, and the parent's>>>>>> policy could be different than the native policy. Basically, file>>>>>> measurements need to be added to the namespace measurement>> list,>>>>>> recursively, up to the native measurement list.>>>>> Yes, but if a task t1 is in namespace ns2 which is a child of>>>>> namespace ns1, and it accesses a file which ns1's policy says must be>>>>> measured, then will ns1's required measurement happen (and be>>>> appended>>>>> to the ns1 measurement list), whether or not ns2's policy requires it?>>>> Yes, as the file needs to be measured only in the ns1 policy, the>>>> measurement would exist in the ns1 measurement list, but not in the>>>> ns2 measurement list. The pseudo code snippet below might help.>>> This algorithm is potentially extending a PCR in TPM multiple times>>> for a single file event under a given namespace and duplicating>>> entries. Any concerns with performance and memory footprint?>> Going forward we assume associated with each container will be a vTPM.>> The namespace measurements will extend a vTPM. As the container comes>> and goes the associated measurement list, keyring, and vTPM will come>> and go as well. For this reason, based on policy, the same file>> measurement might appear in multiple measurement lists.> My concern is that the base of namespacing the measurement lists is on the> integration of containers with vTPM. Associating vTPM with containers as> they are today is not a simple integration since vTPM requires a VM and> containers do not.
There's a vTPM proxy driver in the kernel that enables spawning a
frontend /dev/tpm%d and an anonymous backend file descriptor where a
vTPM can listen on for TPM commands. I integrated this with 'swtpm' and
I have been working on integrating this into runc. Currently each
container started with runc can get one (or multiple) vTPMs and
/dev/tpm0 [and /dev/tpmrm0 in case of TPM2] then appear inside the
container.
What is missing for integration with IMA namespacing are patches for:
1) IMA to use a tpm_chip to talk to rather than issue TPM commands with
TPM_ANY_NUM as parameter to TPM driver functions
2) an ioctl for the vtpm proxy driver to attach a vtpm proxy instance's
tpm_chip to an IMA namespace; this ioctl should be called after the
creation of the IMA namespace (by container mgmt. stack [runc])
3) - some way for the IMA namespace to release the vTPM proxy's
'tpm_chip' and other resources once the IMA namespace is deleted
I have these patches in some form and would post them at a later stage
of namespacing IMA.
swtpm: https://github.com/stefanberger/swtpm
libtpms: https://github.com/stefanberger/libtpms
runc pull request: https://github.com/opencontainers/runc/pull/1082
Stefan

> -----Original Message-----> From: Stefan Berger [mailto:stefanb@linux.vnet.ibm.com]> Sent: quinta-feira, 27 de julho de 2017 14:50> To: Magalhaes, Guilherme (Brazil R&D-CL)> <guilherme.magalhaes@hpe.com>; Mimi Zohar> <zohar@linux.vnet.ibm.com>; Serge E. Hallyn <serge@hallyn.com>> Cc: Mehmet Kayaalp <mkayaalp@cs.binghamton.edu>; Yuqiong Sun> <sunyuqiong1988@gmail.com>; containers <containers@lists.linux-> foundation.org>; linux-kernel <linux-kernel@vger.kernel.org>; David Safford> <david.safford@ge.com>; James Bottomley> <James.Bottomley@HansenPartnership.com>; linux-security-module <linux-> security-module@vger.kernel.org>; ima-devel <linux-ima-> devel@lists.sourceforge.net>; Yuqiong Sun <suny@us.ibm.com>> Subject: Re: [Linux-ima-devel] [RFC PATCH 1/5] ima: extend clone() with IMA> namespace support> > On 07/27/2017 01:18 PM, Magalhaes, Guilherme (Brazil R&D-CL) wrote:> >> >> -----Original Message-----> >> From: Mimi Zohar [mailto:zohar@linux.vnet.ibm.com]> >> Sent: quinta-feira, 27 de julho de 2017 11:39> >> To: Magalhaes, Guilherme (Brazil R&D-CL)> >> <guilherme.magalhaes@hpe.com>; Serge E. Hallyn <serge@hallyn.com>> >> Cc: Mehmet Kayaalp <mkayaalp@cs.binghamton.edu>; Yuqiong Sun> >> <sunyuqiong1988@gmail.com>; containers <containers@lists.linux-> >> foundation.org>; linux-kernel <linux-kernel@vger.kernel.org>; David> Safford> >> <david.safford@ge.com>; James Bottomley> >> <James.Bottomley@HansenPartnership.com>; linux-security-module> <linux-> >> security-module@vger.kernel.org>; ima-devel <linux-ima-> >> devel@lists.sourceforge.net>; Yuqiong Sun <suny@us.ibm.com>> >> Subject: Re: [Linux-ima-devel] [RFC PATCH 1/5] ima: extend clone() with> IMA> >> namespace support> >>> >> On Thu, 2017-07-27 at 12:51 +0000, Magalhaes, Guilherme (Brazil R&D-> >> CL) wrote:> >>>> >>>> On Tue, 2017-07-25 at 16:08 -0500, Serge E. Hallyn wrote:> >>>>> On Tue, Jul 25, 2017 at 04:57:57PM -0400, Mimi Zohar wrote:> >>>>>> On Tue, 2017-07-25 at 15:46 -0500, Serge E. Hallyn wrote:> >>>>>>> On Tue, Jul 25, 2017 at 04:11:29PM -0400, Stefan Berger wrote:> >>>>>>>> On 07/25/2017 03:48 PM, Mimi Zohar wrote:> >>>>>>>>> On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:> >>>>>>>>>> On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:> >>>>>>>>>>> On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley> >> wrote:> >>>>>>>>>>>> On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:> >>>>>>>>>>>>> On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp> >>>> wrote:> >>>>>>>>>>>>>> From: Yuqiong Sun <suny@us.ibm.com>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>> Add new CONFIG_IMA_NS config option. Let clone() create> >> a> >>>>>>>>>>>>>> new IMA namespace upon CLONE_NEWNS flag. Add> >> ima_ns> >>>> data> >>>>>>>>>>>>>> structure in nsproxy. ima_ns is allocated and freed upon> >>>>>>>>>>>>>> IMA namespace creation and exit. Currently, the ima_ns> >>>>>>>>>>>>>> contains no useful IMA data but only a dummy interface.> >>>>>>>>>>>>>> This patch creates the framework for namespacing the> >>>> different aspects of IMA (eg.> >>>>>>>>>>>>>> IMA-audit, IMA-measurement, IMA-appraisal).> >>>>>>>>>>>>>>> >>>>>>>>>>>>>> Signed-off-by: Yuqiong Sun <suny@us.ibm.com>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>> Changelog:> >>>>>>>>>>>>>> * Use CLONE_NEWNS instead of a new CLONE_NEWIMA> >> flag> >>>>>>>>>>>>> Hi,> >>>>>>>>>>>>>> >>>>>>>>>>>>> So this means that every mount namespace clone will clone> >> a> >>>>>>>>>>>>> new IMA namespace. Is that really ok?> >>>>>>>>>>>> Based on what: space concerns (struct ima_ns is reasonably> >>>> small)?> >>>>>>>>>>>> or whether tying it to the mount namespace is the correct> >>>>>>>>>>>> thing to do. On> >>>>>>>>>>> Mostly the latter. The other would be not so much space> >>>>>>>>>>> concerns as time concerns. Many things use new mounts> >>>>>>>>>>> namespaces, and we wouldn't want multiple IMA calls on all> >>>>>>>>>>> file accesses by all of those.> >>>>>>>>>>>> >>>>>>>>>>>> the latter, it does seem that this should be a property of> >>>>>>>>>>>> either the mount or user ns rather than its own separate ns.> >>>>>>>>>>>> I could see a use where even a container might want multiple> >>>>>>>>>>>> ima keyrings within the container (say containerised apache> >>>>>>>>>>>> service with multiple tenants), so instinct tells me that> >>>>>>>>>>>> mount ns is the correct granularity for this.> >>>>>>>>>>> I wonder whether we could use echo 1 >> >>>>>>>>>>> /sys/kernel/security/ima/newns as the trigger for requesting> >>>>>>>>>>> a new ima ns on the next clone(CLONE_NEWNS).> >>>>>>>>>> I could go with that, but what about the trigger being> >>>>>>>>>> installing or updating the keyring? That's the only operation> >>>>>>>>>> that needs namespace separation, so on mount ns clone, you> >> get> >>>>>>>>>> a pointer to the old ima_ns until you do something that> >>>>>>>>>> requires a new key, which then triggers the copy of the> >> namespace> >>>> and installing it?> >>>>>>>>> It isn't just the keyrings that need to be namespaced, but the> >>>>>>>>> measurement list and policy as well.> >>>>>>>>>> >>>>>>>>> IMA-measurement, IMA-appraisal and IMA-audit are all policy> >>>> based.> >>>>>>>>> As soon as the namespace starts, measurements should be> >> added> >>>>>>>>> to the namespace specific measurement list, not it's parent.> >>>>>>> Shouldn't it be both?> >>>>>> The policy defines which files are measured. The namespace policy> >>>>>> could be different than it's parent's policy, and the parent's> >>>>>> policy could be different than the native policy. Basically, file> >>>>>> measurements need to be added to the namespace measurement> >> list,> >>>>>> recursively, up to the native measurement list.> >>>>> Yes, but if a task t1 is in namespace ns2 which is a child of> >>>>> namespace ns1, and it accesses a file which ns1's policy says must be> >>>>> measured, then will ns1's required measurement happen (and be> >>>> appended> >>>>> to the ns1 measurement list), whether or not ns2's policy requires it?> >>>> Yes, as the file needs to be measured only in the ns1 policy, the> >>>> measurement would exist in the ns1 measurement list, but not in the> >>>> ns2 measurement list. The pseudo code snippet below might help.> >>> This algorithm is potentially extending a PCR in TPM multiple times> >>> for a single file event under a given namespace and duplicating> >>> entries. Any concerns with performance and memory footprint?> >> Going forward we assume associated with each container will be a vTPM.> >> The namespace measurements will extend a vTPM. As the container> comes> >> and goes the associated measurement list, keyring, and vTPM will come> >> and go as well. For this reason, based on policy, the same file> >> measurement might appear in multiple measurement lists.> > My concern is that the base of namespacing the measurement lists is on> the> > integration of containers with vTPM. Associating vTPM with containers as> > they are today is not a simple integration since vTPM requires a VM and> > containers do not.> > There's a vTPM proxy driver in the kernel that enables spawning a> frontend /dev/tpm%d and an anonymous backend file descriptor where a> vTPM can listen on for TPM commands. I integrated this with 'swtpm' and> I have been working on integrating this into runc. Currently each> container started with runc can get one (or multiple) vTPMs and> /dev/tpm0 [and /dev/tpmrm0 in case of TPM2] then appear inside the> container.>
This is an interesting solution especially for nested namespaces with the
recursive application of measurements and a having list per container.
Following the TCG specs/requirements, what could we say about security
guarantees of real TPMs Vs this vTPM implementation?
--
Guilherme
> What is missing for integration with IMA namespacing are patches for:> > 1) IMA to use a tpm_chip to talk to rather than issue TPM commands with> TPM_ANY_NUM as parameter to TPM driver functions> 2) an ioctl for the vtpm proxy driver to attach a vtpm proxy instance's> tpm_chip to an IMA namespace; this ioctl should be called after the> creation of the IMA namespace (by container mgmt. stack [runc])> 3) - some way for the IMA namespace to release the vTPM proxy's> 'tpm_chip' and other resources once the IMA namespace is deleted> > I have these patches in some form and would post them at a later stage> of namespacing IMA.> > swtpm: https://github.com/stefanberger/swtpm> libtpms: https://github.com/stefanberger/libtpms> runc pull request: https://github.com/opencontainers/runc/pull/1082> > Stefan

On 07/27/2017 03:39 PM, Magalhaes, Guilherme (Brazil R&D-CL) wrote:
>>> There's a vTPM proxy driver in the kernel that enables spawning a>> frontend /dev/tpm%d and an anonymous backend file descriptor where a>> vTPM can listen on for TPM commands. I integrated this with 'swtpm' and>> I have been working on integrating this into runc. Currently each>> container started with runc can get one (or multiple) vTPMs and>> /dev/tpm0 [and /dev/tpmrm0 in case of TPM2] then appear inside the>> container.>>> This is an interesting solution especially for nested namespaces with the> recursive application of measurements and a having list per container.>> Following the TCG specs/requirements, what could we say about security> guarantees of real TPMs Vs this vTPM implementation?
A non-root user may not be able to do access the (permanent) state of
the vTPM state files since the container management stack would restrict
access to the files using DAC. Access to runtime data is also prevented
since the vTPM would not run under the account of the non-root user.
To protect the vTPM's permanent state file from access by a root user it
comes down to preventing the root user from getting a hold of the key
used for encrypting that file. Encrypting the state of the vTPM is
probably the best we can do to approximate a temper-resistant chip, but
preventing the root user from accessing the key may be more challenging.
Preventing root from accessing runtime data could be achieved by using
XGS or a similar technology.
Stefan

> > Each measurement entry in the list could have new fields to identify> > the namespace. Since the namespaces can be reused, a timestamp or> > others fields could be added to uniquely identify the namespace id.> > The more fields included in the measurement list, the more> measurements will be added to the measurement list. Wouldn't it be> enough to know that a certain file has been accessed/executed on the> system and base any analytics/forensics on the IMA-audit data.
With the recursive application of policy through the namespace hierarchy,
a measurement added to the parent namespace could be misleading since
the file pathname makes sense in the current namespace but possibly not
for the parent namespace. This is the reason why I believe some new field
might be needed in the IMA template format to indicate or uniquely
identify the namespace.
--
Guilherme

On Fri, 2017-07-28 at 14:19 +0000, Magalhaes, Guilherme (Brazil R&D-
CL) wrote:
> > > Each measurement entry in the list could have new fields to identify> > > the namespace. Since the namespaces can be reused, a timestamp or> > > others fields could be added to uniquely identify the namespace id.> > > > The more fields included in the measurement list, the more> > measurements will be added to the measurement list. Wouldn't it be> > enough to know that a certain file has been accessed/executed on the> > system and base any analytics/forensics on the IMA-audit data.> > With the recursive application of policy through the namespace hierarchy,> a measurement added to the parent namespace could be misleading since > the file pathname makes sense in the current namespace but possibly not> for the parent namespace.
Fair enough.
> This is the reason why I believe some new field> might be needed in the IMA template format to indicate or uniquely > identify the namespace.
I would probably include information to uniquely identify the file
(eg. UUID, mountpoint), not the namespace.
Mimi

On 07/25/2017 04:46 PM, Serge E. Hallyn wrote:
> On Tue, Jul 25, 2017 at 04:11:29PM -0400, Stefan Berger wrote:>> On 07/25/2017 03:48 PM, Mimi Zohar wrote:>>> On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:>>>> On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:>>>>> On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:>>>>>> On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:>>>>>>> On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp wrote:>>>>>>>> From: Yuqiong Sun <suny@us.ibm.com>>>>>>>>>>>>>>>>> Add new CONFIG_IMA_NS config option. Let clone() create a new>>>>>>>> IMA namespace upon CLONE_NEWNS flag. Add ima_ns data structure>>>>>>>> in nsproxy. ima_ns is allocated and freed upon IMA namespace>>>>>>>> creation and exit. Currently, the ima_ns contains no useful IMA>>>>>>>> data but only a dummy interface. This patch creates the>>>>>>>> framework for namespacing the different aspects of IMA (eg.>>>>>>>> IMA-audit, IMA-measurement, IMA-appraisal).>>>>>>>>>>>>>>>> Signed-off-by: Yuqiong Sun <suny@us.ibm.com>>>>>>>>>>>>>>>>> Changelog:>>>>>>>> * Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag>>>>>>> Hi,>>>>>>>>>>>>>> So this means that every mount namespace clone will clone a new>>>>>>> IMA namespace. Is that really ok?>>>>>> Based on what: space concerns (struct ima_ns is reasonably small)?>>>>>> or whether tying it to the mount namespace is the correct thing to>>>>>> do. On>>>>> Mostly the latter. The other would be not so much space concerns as>>>>> time concerns. Many things use new mounts namespaces, and we>>>>> wouldn't want multiple IMA calls on all file accesses by all of>>>>> those.>>>>>>>>>>> the latter, it does seem that this should be a property of either>>>>>> the mount or user ns rather than its own separate ns. I could see>>>>>> a use where even a container might want multiple ima keyrings>>>>>> within the container (say containerised apache service with>>>>>> multiple tenants), so instinct tells me that mount ns is the>>>>>> correct granularity for this.>>>>> I wonder whether we could use echo 1 > /sys/kernel/security/ima/newns>>>>> as the trigger for requesting a new ima ns on the next>>>>> clone(CLONE_NEWNS).>>>> I could go with that, but what about the trigger being installing or>>>> updating the keyring? That's the only operation that needs namespace>>>> separation, so on mount ns clone, you get a pointer to the old ima_ns>>>> until you do something that requires a new key, which then triggers the>>>> copy of the namespace and installing it?>>> It isn't just the keyrings that need to be namespaced, but the>>> measurement list and policy as well.>>>>>> IMA-measurement, IMA-appraisal and IMA-audit are all policy based.>>>>>> As soon as the namespace starts, measurements should be added to the>>> namespace specific measurement list, not it's parent.> Shouldn't it be both?>> If not, then it seems to me this must be tied to user namespace.>>> IMA is about measuring things, logging what was executed, and>> finally someone looking at the measurement log and detecting>> 'things'. So at least one attack that needs to be prevented is a>> malicious person opening an IMA namespace, executing something>> malicious, and not leaving any trace on the host because all the>> logs went into the measurement list of the IMA namespace, which>> disappeared. That said, I am wondering whether there has to be a>> minimum set of namespaces (PID, UTS) providing enough 'isolation'>> that someone may actually open an IMA namespace and run their code.>> To avoid leaving no traces one could argue to implement recursive>> logging, so something that is logged inside the namespace will be>> detected in all parent containers up to the init_ima_ns (host)>> because it's logged (and TPM extended) there as well. The challenge>> with that is that logging costs memory and that can be abused as>> well until the machine needs a reboot... I guess the solution could>> be requesting an IMA namespace in one way or another but requiring>> several other namespace flags in the clone() to actually 'get' it.>> Jumping namespaces with setns() may have to be restricted as well>> once there is an IMA namespace.> Wait. So if I create a new IMA namespace, the things I run in> that namespace are not subject to the parent namespace policy?
We'll let an IMA namespace set its own policy and rules in that policy
will decide whether the child namespaces' measurements will also be
logged. This is to avoid a potentially huge log on the host. However,
the activities of root in namespaces may need to be logged independently
of what the policy rules say so that root's activities in the TCB will
always be tracked also if he operates in a temporary mount/IMA namespace
pair (and sharing the rest of the namespaces with the host).
Stefan
>> -serge>

On 03/08/2018 03:19 PM, Serge E. Hallyn wrote:
> Quoting Stefan Berger (stefanb@linux.vnet.ibm.com):>> On 07/20/2017 06:50 PM, Mehmet Kayaalp wrote:>>> From: Yuqiong Sun<suny@us.ibm.com>>>>>>> Add new CONFIG_IMA_NS config option. Let clone() create a new IMA>>> namespace upon CLONE_NEWNS flag. Add ima_ns data structure in nsproxy.>>> ima_ns is allocated and freed upon IMA namespace creation and exit.>>> Currently, the ima_ns contains no useful IMA data but only a dummy>>> interface. This patch creates the framework for namespacing the different>>> aspects of IMA (eg. IMA-audit, IMA-measurement, IMA-appraisal).>>>>>> Signed-off-by: Yuqiong Sun<suny@us.ibm.com>>>>>>> Changelog:>>> * Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag>>> * Use existing ima.h headers>>> * Move the ima_namespace.c to security/integrity/ima/ima_ns.c>>> * Fix typo INFO->INO>>> * Each namespace free's itself, removed recursively free'ing>>> until init_ima_ns from free_ima_ns()>> With this patch we would use CLONE_NEWNS and create an IMA and mount>> namespace at the same time. However, the code below creates two>> inodes to handle the two namespaces separately via setns(). The> ... right.>> Either the ima and mounts namespaces are so closely tied that ima_ns> should be unshared on every CLONE_NEWNS, or not. If they are, then> every setns(CLONE_NEWNS) must also change the ima_ns. That is not the> case here. Every clone creates a new ima_ns, but we're not forcing> tasks to be in the ima_ns that is matched with its mntns, and> furthermore we have another object lifecycle to worry about.>> It still seems to me that the only sane way to do this is to have the> ima_ns be its own object; have it be owned by a user_ns; require> CAP_SYS_ADMIN (or better CAP_MAC_ADMIN) to your current userns to> clone a new one, maybe with no other tasks in userns yet, for good> measure. And support hierarchical measuring (so parents can still> get information about a child's actions).
I think there is a real benefit to keeping the IMA namespace with the
mount namespace since the mount namespace carries the signatures in the
xattrs and IMA the (appraisal) policy. The user namespace has the keys
IMA needs for signature verification and if missing, the appraisal will
fail (at least that is how it could work but Mimi tells me the pointer
to the IMA keyring is cached). So there's an incentive to keep the
otherwise 'loose' namespaces 'together.' If we were to associate the IMA
namespace with the user namespace or be stand-alone, it is easier to
just setns() the mount namespace and circumvent the IMA (appraisal) policy.
> If IMA is to be at all trustworthy for remote appraisal, then I do
remote appraisal ? remote attestation ?
> not see how you can let a privileged insecure container completely> bypass IMA. The key difference between allowing new ima_ns with> mntns or only with userns is that after unsharing my user_ns, my> privilege with respect to the parent is lost. A new mntns doesn't> change anything about how I can corrupt the parent.
Not quite following. After unsharing the user_ns IMA could be made to
loose access to its keys from the previous user_ns and starting apps
would fail appraisal then, unless the new user_ns IMA keyring has the
same keys again.

Quoting Stefan Berger (stefanb@linux.vnet.ibm.com):
> On 03/08/2018 03:19 PM, Serge E. Hallyn wrote:> >Quoting Stefan Berger (stefanb@linux.vnet.ibm.com):> >>On 07/20/2017 06:50 PM, Mehmet Kayaalp wrote:> >>>From: Yuqiong Sun<suny@us.ibm.com>> >>>> >>>Add new CONFIG_IMA_NS config option. Let clone() create a new IMA> >>>namespace upon CLONE_NEWNS flag. Add ima_ns data structure in nsproxy.> >>>ima_ns is allocated and freed upon IMA namespace creation and exit.> >>>Currently, the ima_ns contains no useful IMA data but only a dummy> >>>interface. This patch creates the framework for namespacing the different> >>>aspects of IMA (eg. IMA-audit, IMA-measurement, IMA-appraisal).> >>>> >>>Signed-off-by: Yuqiong Sun<suny@us.ibm.com>> >>>> >>>Changelog:> >>>* Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag> >>>* Use existing ima.h headers> >>>* Move the ima_namespace.c to security/integrity/ima/ima_ns.c> >>>* Fix typo INFO->INO> >>>* Each namespace free's itself, removed recursively free'ing> >>>until init_ima_ns from free_ima_ns()> >>With this patch we would use CLONE_NEWNS and create an IMA and mount> >>namespace at the same time. However, the code below creates two> >>inodes to handle the two namespaces separately via setns(). The> >... right.> >> >Either the ima and mounts namespaces are so closely tied that ima_ns> >should be unshared on every CLONE_NEWNS, or not. If they are, then> >every setns(CLONE_NEWNS) must also change the ima_ns. That is not the> >case here. Every clone creates a new ima_ns, but we're not forcing> >tasks to be in the ima_ns that is matched with its mntns, and> >furthermore we have another object lifecycle to worry about.> >> >It still seems to me that the only sane way to do this is to have the> >ima_ns be its own object; have it be owned by a user_ns; require> >CAP_SYS_ADMIN (or better CAP_MAC_ADMIN) to your current userns to> >clone a new one, maybe with no other tasks in userns yet, for good> >measure. And support hierarchical measuring (so parents can still> >get information about a child's actions).> > I think there is a real benefit to keeping the IMA namespace with> the mount namespace since the mount namespace carries the signatures> in the xattrs and IMA the (appraisal) policy. The user namespace has
But xattrs have to do with the files and filesystem. Not with
mounts.
> the keys IMA needs for signature verification and if missing, the> appraisal will fail (at least that is how it could work but Mimi> tells me the pointer to the IMA keyring is cached). So there's an> incentive to keep the otherwise 'loose' namespaces 'together.' If we> were to associate the IMA namespace with the user namespace or be> stand-alone, it is easier to just setns() the mount namespace and> circumvent the IMA (appraisal) policy.
Sure but you won't have privilege over the previous namespace.
Now, you will over the uids you were delegated - almost seems like an
ima_ns should be assoicated with a segregated uid range.
> >If IMA is to be at all trustworthy for remote appraisal, then I do> > remote appraisal ? remote attestation ?
right attestation
> >not see how you can let a privileged insecure container completely> >bypass IMA. The key difference between allowing new ima_ns with> >mntns or only with userns is that after unsharing my user_ns, my> >privilege with respect to the parent is lost. A new mntns doesn't> >change anything about how I can corrupt the parent.> > Not quite following. After unsharing the user_ns IMA could be made> to loose access to its keys from the previous user_ns and starting> apps would fail appraisal then, unless the new user_ns IMA keyring> has the same keys again.
It doesn't inherit the parent's to begin with? I guess I don't
know enough about how the keyring is managed.

On Thu, Mar 08, 2018 at 09:04:52AM -0500, Stefan Berger wrote:
> On 07/25/2017 04:46 PM, Serge E. Hallyn wrote:> >On Tue, Jul 25, 2017 at 04:11:29PM -0400, Stefan Berger wrote:> >>On 07/25/2017 03:48 PM, Mimi Zohar wrote:> >>>On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:> >>>>On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:> >>>>>On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:> >>>>>>On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:> >>>>>>>On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp wrote:> >>>>>>>>From: Yuqiong Sun <suny@us.ibm.com>> >>>>>>>>> >>>>>>>>Add new CONFIG_IMA_NS config option. Let clone() create a new> >>>>>>>>IMA namespace upon CLONE_NEWNS flag. Add ima_ns data structure> >>>>>>>>in nsproxy. ima_ns is allocated and freed upon IMA namespace> >>>>>>>>creation and exit. Currently, the ima_ns contains no useful IMA> >>>>>>>>data but only a dummy interface. This patch creates the> >>>>>>>>framework for namespacing the different aspects of IMA (eg.> >>>>>>>>IMA-audit, IMA-measurement, IMA-appraisal).> >>>>>>>>> >>>>>>>>Signed-off-by: Yuqiong Sun <suny@us.ibm.com>> >>>>>>>>> >>>>>>>>Changelog:> >>>>>>>>* Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag> >>>>>>>Hi,> >>>>>>>> >>>>>>>So this means that every mount namespace clone will clone a new> >>>>>>>IMA namespace. Is that really ok?> >>>>>>Based on what: space concerns (struct ima_ns is reasonably small)?> >>>>>>or whether tying it to the mount namespace is the correct thing to> >>>>>>do. On> >>>>>Mostly the latter. The other would be not so much space concerns as> >>>>>time concerns. Many things use new mounts namespaces, and we> >>>>>wouldn't want multiple IMA calls on all file accesses by all of> >>>>>those.> >>>>>> >>>>>>the latter, it does seem that this should be a property of either> >>>>>>the mount or user ns rather than its own separate ns. I could see> >>>>>>a use where even a container might want multiple ima keyrings> >>>>>>within the container (say containerised apache service with> >>>>>>multiple tenants), so instinct tells me that mount ns is the> >>>>>>correct granularity for this.> >>>>>I wonder whether we could use echo 1 > /sys/kernel/security/ima/newns> >>>>>as the trigger for requesting a new ima ns on the next> >>>>>clone(CLONE_NEWNS).> >>>>I could go with that, but what about the trigger being installing or> >>>>updating the keyring? That's the only operation that needs namespace> >>>>separation, so on mount ns clone, you get a pointer to the old ima_ns> >>>>until you do something that requires a new key, which then triggers the> >>>>copy of the namespace and installing it?> >>>It isn't just the keyrings that need to be namespaced, but the> >>>measurement list and policy as well.> >>>> >>>IMA-measurement, IMA-appraisal and IMA-audit are all policy based.> >>>> >>>As soon as the namespace starts, measurements should be added to the> >>>namespace specific measurement list, not it's parent.> >Shouldn't it be both?> >> >If not, then it seems to me this must be tied to user namespace.> >> >>IMA is about measuring things, logging what was executed, and> >>finally someone looking at the measurement log and detecting> >>'things'. So at least one attack that needs to be prevented is a> >>malicious person opening an IMA namespace, executing something> >>malicious, and not leaving any trace on the host because all the> >>logs went into the measurement list of the IMA namespace, which> >>disappeared. That said, I am wondering whether there has to be a> >>minimum set of namespaces (PID, UTS) providing enough 'isolation'> >>that someone may actually open an IMA namespace and run their code.> >>To avoid leaving no traces one could argue to implement recursive> >>logging, so something that is logged inside the namespace will be> >>detected in all parent containers up to the init_ima_ns (host)> >>because it's logged (and TPM extended) there as well. The challenge> >>with that is that logging costs memory and that can be abused as> >>well until the machine needs a reboot... I guess the solution could> >>be requesting an IMA namespace in one way or another but requiring> >>several other namespace flags in the clone() to actually 'get' it.> >>Jumping namespaces with setns() may have to be restricted as well> >>once there is an IMA namespace.> >Wait. So if I create a new IMA namespace, the things I run in> >that namespace are not subject to the parent namespace policy?> > We'll let an IMA namespace set its own policy and rules in that> policy will decide whether the child namespaces' measurements will> also be logged. This is to avoid a potentially huge log on the host.> However, the activities of root in namespaces may need to be logged> independently of what the policy rules say so that root's activities> in the TCB will always be tracked also if he operates in a temporary> mount/IMA namespace pair (and sharing the rest of the namespaces> with the host).
Thanks, Stefan. Is there a particular paper where I can get a good
idea of what is and is not part of the goals and threat model here?
My impression was that you are measuring things that are executed in an
effort to make sure that anything that can affect resource $x will
be at some point detectable. But if you allow containers (not in a
user namespace) to evade the ima measurements that seems to undermine
that, so that must not be your goal. And even if you insist on a
user namespace, if some resource is owned by $uid, then $uid can create
a new namespace, evade the detection, and run malicious code to affect
the resource.
Unless you're counting on the container runtime to set a proper new
ima policy? But if that's the case then you can't have every CLONE_NEWNS
start a new ima ns.
So I think I need to start from scratch.
thanks,
-serge

On 03/08/2018 09:59 PM, Serge E. Hallyn wrote:
> On Thu, Mar 08, 2018 at 09:04:52AM -0500, Stefan Berger wrote:>> On 07/25/2017 04:46 PM, Serge E. Hallyn wrote:>>> On Tue, Jul 25, 2017 at 04:11:29PM -0400, Stefan Berger wrote:>>>> On 07/25/2017 03:48 PM, Mimi Zohar wrote:>>>>> On Tue, 2017-07-25 at 12:08 -0700, James Bottomley wrote:>>>>>> On Tue, 2017-07-25 at 14:04 -0500, Serge E. Hallyn wrote:>>>>>>> On Tue, Jul 25, 2017 at 11:49:14AM -0700, James Bottomley wrote:>>>>>>>> On Tue, 2017-07-25 at 12:53 -0500, Serge E. Hallyn wrote:>>>>>>>>> On Thu, Jul 20, 2017 at 06:50:29PM -0400, Mehmet Kayaalp wrote:>>>>>>>>>> From: Yuqiong Sun <suny@us.ibm.com>>>>>>>>>>>>>>>>>>>>> Add new CONFIG_IMA_NS config option. Let clone() create a new>>>>>>>>>> IMA namespace upon CLONE_NEWNS flag. Add ima_ns data structure>>>>>>>>>> in nsproxy. ima_ns is allocated and freed upon IMA namespace>>>>>>>>>> creation and exit. Currently, the ima_ns contains no useful IMA>>>>>>>>>> data but only a dummy interface. This patch creates the>>>>>>>>>> framework for namespacing the different aspects of IMA (eg.>>>>>>>>>> IMA-audit, IMA-measurement, IMA-appraisal).>>>>>>>>>>>>>>>>>>>> Signed-off-by: Yuqiong Sun <suny@us.ibm.com>>>>>>>>>>>>>>>>>>>>> Changelog:>>>>>>>>>> * Use CLONE_NEWNS instead of a new CLONE_NEWIMA flag>>>>>>>>> Hi,>>>>>>>>>>>>>>>>>> So this means that every mount namespace clone will clone a new>>>>>>>>> IMA namespace. Is that really ok?>>>>>>>> Based on what: space concerns (struct ima_ns is reasonably small)?>>>>>>>> or whether tying it to the mount namespace is the correct thing to>>>>>>>> do. On>>>>>>> Mostly the latter. The other would be not so much space concerns as>>>>>>> time concerns. Many things use new mounts namespaces, and we>>>>>>> wouldn't want multiple IMA calls on all file accesses by all of>>>>>>> those.>>>>>>>>>>>>>>> the latter, it does seem that this should be a property of either>>>>>>>> the mount or user ns rather than its own separate ns. I could see>>>>>>>> a use where even a container might want multiple ima keyrings>>>>>>>> within the container (say containerised apache service with>>>>>>>> multiple tenants), so instinct tells me that mount ns is the>>>>>>>> correct granularity for this.>>>>>>> I wonder whether we could use echo 1 > /sys/kernel/security/ima/newns>>>>>>> as the trigger for requesting a new ima ns on the next>>>>>>> clone(CLONE_NEWNS).>>>>>> I could go with that, but what about the trigger being installing or>>>>>> updating the keyring? That's the only operation that needs namespace>>>>>> separation, so on mount ns clone, you get a pointer to the old ima_ns>>>>>> until you do something that requires a new key, which then triggers the>>>>>> copy of the namespace and installing it?>>>>> It isn't just the keyrings that need to be namespaced, but the>>>>> measurement list and policy as well.>>>>>>>>>> IMA-measurement, IMA-appraisal and IMA-audit are all policy based.>>>>>>>>>> As soon as the namespace starts, measurements should be added to the>>>>> namespace specific measurement list, not it's parent.>>> Shouldn't it be both?>>>>>> If not, then it seems to me this must be tied to user namespace.>>>>>>> IMA is about measuring things, logging what was executed, and>>>> finally someone looking at the measurement log and detecting>>>> 'things'. So at least one attack that needs to be prevented is a>>>> malicious person opening an IMA namespace, executing something>>>> malicious, and not leaving any trace on the host because all the>>>> logs went into the measurement list of the IMA namespace, which>>>> disappeared. That said, I am wondering whether there has to be a>>>> minimum set of namespaces (PID, UTS) providing enough 'isolation'>>>> that someone may actually open an IMA namespace and run their code.>>>> To avoid leaving no traces one could argue to implement recursive>>>> logging, so something that is logged inside the namespace will be>>>> detected in all parent containers up to the init_ima_ns (host)>>>> because it's logged (and TPM extended) there as well. The challenge>>>> with that is that logging costs memory and that can be abused as>>>> well until the machine needs a reboot... I guess the solution could>>>> be requesting an IMA namespace in one way or another but requiring>>>> several other namespace flags in the clone() to actually 'get' it.>>>> Jumping namespaces with setns() may have to be restricted as well>>>> once there is an IMA namespace.>>> Wait. So if I create a new IMA namespace, the things I run in>>> that namespace are not subject to the parent namespace policy?>> We'll let an IMA namespace set its own policy and rules in that>> policy will decide whether the child namespaces' measurements will>> also be logged. This is to avoid a potentially huge log on the host.>> However, the activities of root in namespaces may need to be logged>> independently of what the policy rules say so that root's activities>> in the TCB will always be tracked also if he operates in a temporary>> mount/IMA namespace pair (and sharing the rest of the namespaces>> with the host).> Thanks, Stefan. Is there a particular paper where I can get a good> idea of what is and is not part of the goals and threat model here?
Yuqiong is publishing a paper in this area. I believe the conference is
only later this year.
Our goals are to enable IMA measurements, appraisal, and auditing inside
a container using namespaces. IMA measurements are about logging files
that were read or executables that were started on a machine, appraisal
is about locking down the machine and only allowing files to be accessed
that have been properly signed. We certainly want to prevent the abuse
of namespaces by users to do things that go undetected. A primary
concern are activities of root in the TCB.
Support for IMA in namespaces should enable the following:
- IMA policy for container (similar to the host):
- there should be an initial default policy for every IMA namespace
that measures activities inside the container
- the policy can be overwritten once with a user-defined policy that
may activate appraisal
- IMA policy extensions due to namespacing:
- an IMA policy should allow rules that define whether activities in
(all) child namespaces is to be measured (prevents huge logs on the host)
- to prevent root from spawning new IMA namespaces and doing things
undetected in the TCB, all activities of root are (recursively) measured
in all IMA namespaces independent of whether the policy enables logging
in child namespaces
- IMA appraisal and keys:
- each IMA namespace should have its own keyring so that each
container can have its files signed with different keys
- it should be possible to enforce that only certified keys are
loaded onto a keyring, similar to .ima on the host
- IMA auditing:
- auditing should report activity in namespaces following the IMA
policy; root's activities in containers should be audited
- TPM and measurements:
- The IMA namespace that holds the logs should be configurable to
extend PCRs; since the single TPM of the host cannot be shared by
containers, each IMA namespace would have to be associated with its own
TPM instance (vTPM); measurement on the initial IMA namespace are
extended into the hardware TPM asdone today
A concrete 'ab-use' case that we are trying to avoid is the following:
- a user creating a privileged container that shares the host's mount
namespace: it would be unexpected if there is an IMA policy active on
the host that enforces file appraisal but in this case the IMA policy is
not enforced since a (hypothetical) IMA namespace of the host was not
joined since only the mount namespace of the host was joined. Now we
have two choices here: We tie the mount and IMA namespaces together via
sinlge clone flag, as proposed, and joining the mount namespace
automatically joins the associated IMA namespace (single setns()). Or we
make user space responsible for it and say if a mount namespace is
joined, find the associated IMA namespace (how to do that?), and join
both of them (2 setns() calls). Well, I think the former would preferred
over the latter.
Let's assume we tie MNT and IMA together, then there are other scenarios
with switching through the other namespaces (UTS, PID, IPC, NET, USER,
CGROUP). I am not sure what is supposed to happen other than logging the
activity active in the current IMA namespace:
What should happen with IMA logging, appraisal, and auditing if we
setns() through all available
- PID namespaces and send signals: log, appraise, and audit file
activity following IMA policy
- IPC namespaces and send messages via IPC: same as for PID
- UTS namespaces and setting hostname: same as for PID
- NET namespaces and sending network traffic: same as for PID?
- CGROUP namespaces and configuring cgroups: same as for PID?
- USER: should now the keys of this USER namespace be active or the keys
of the original user namespace used during the clone()? other than that,
same as for PID?
>> My impression was that you are measuring things that are executed in an> effort to make sure that anything that can affect resource $x will> be at some point detectable. But if you allow containers (not in> user namespace) to evade the ima measurements that seems to undermine> that, so that must not be your goal. And even if you insist on a
Yes, we want to prevent 'abuse', especially by root. See above.
> user namespace, if some resource is owned by $uid, then $uid can create> a new namespace, evade the detection, and run malicious code to affect> the resource.>> Unless you're counting on the container runtime to set a proper new> ima policy? But if that's the case then you can't have every CLONE_NEWNS> start a new ima ns.
The container runtime will be able to overwrite a default IMA policy
that is active upon spawning an IMA namespace. This policy has to be
useful in so far that it must enable a gapless measurement chain and for
example show keys that were loaded into keyrings or the IMA policy that
was loaded.
Stefan
>> So I think I need to start from scratch.>> thanks,> -serge> --> To unsubscribe from this list: send the line "unsubscribe linux-security-module" in> the body of a message to majordomo@vger.kernel.org> More majordomo info at http://vger.kernel.org/majordomo-info.html>

On Fri, 9 Mar 2018, Stefan Berger wrote:
> Yuqiong is publishing a paper in this area. I believe the conference is only> later this year.> > Our goals are to enable IMA measurements, appraisal, and auditing inside a> container using namespaces.
This is excellent to have -- can you include this requirements analysis as
a file Documentation/security on the next posting?
Also, if you need a public space for managing these kinds of documents,
consider utilizing
http://kernsec.org/wiki/index.php/Linux_Kernel_Integrity
- James

On 03/11/2018 06:58 PM, James Morris wrote:
> On Fri, 9 Mar 2018, Stefan Berger wrote:>>> Yuqiong is publishing a paper in this area. I believe the conference is only>> later this year.>>>> Our goals are to enable IMA measurements, appraisal, and auditing inside a>> container using namespaces.> This is excellent to have -- can you include this requirements analysis as> a file Documentation/security on the next posting?>> Also, if you need a public space for managing these kinds of documents,> consider utilizing> http://kernsec.org/wiki/index.php/Linux_Kernel_Integrity
Thanks for the pointer. I tried creating an account, but the interface
wouldn't let me. Who is managing it?
Stefan
>>> - James

On Tue, 13 Mar 2018, Stefan Berger wrote:
> On 03/11/2018 06:58 PM, James Morris wrote:> > On Fri, 9 Mar 2018, Stefan Berger wrote:> > > > > Yuqiong is publishing a paper in this area. I believe the conference is> > > only> > > later this year.> > > > > > Our goals are to enable IMA measurements, appraisal, and auditing inside a> > > container using namespaces.> > This is excellent to have -- can you include this requirements analysis as> > a file Documentation/security on the next posting?> > > > Also, if you need a public space for managing these kinds of documents,> > consider utilizing> > http://kernsec.org/wiki/index.php/Linux_Kernel_Integrity> > Thanks for the pointer. I tried creating an account, but the interface> wouldn't let me. Who is managing it?
Email me for an account, per the note on the front page.