Re: [PATCH v12 0/9] LSM: Multiple concurrent LSMs

Eric W. Biederman
2013-01-11T19:35:28Z

Casey Schaufler <casey@schaufler-ca.com> writes:

>> When a distro is run in a container it is desirable to be able to run
>> the distro's security policy in that container. Ideally this will get
>> addressed by being able to do some level of per user namespace stacking.
>> Say selinux outside and apparmor inside a container.
>>
>> I think this would take a little more work than what Casey has currently
>> devised but I am hopeful an additional layer of stacking can be added
>> after Casey has merged the basic layer of stacking.
>
> Would that be per-container LSM lists? I hadn't thought about
> doing that, and don't know how you might implement it, but I
> suppose it could work.

Essentially per-container LSM lists. The semantics would be that
first you perform the global LSM list checks, and then you perform
the container LSM list checks (with additional layers if containers are
nested). For LSM modules that depend on security labels I think there
would be a conflict that would prevent nesting.

This is already implemented for capabilities. Something is already
happening with apparmor.

In practice it may just be a matter of getting the LSMs to be aware of
the containers rather than having per container LSM lists. Especially
as all of the hooks are called every time for every LSM.

The important part is that the effect be nested policy. Having nested calls
is likely to be unnecessary and inefficient if there is much nesting of
containers going on.

Eric