From: john.johansen@canonical.com (John Johansen)
To: linux-security-module@vger.kernel.org
Subject: The secmark "one user" policy
Date: Thu, 22 Jun 2017 21:32:01 -0700 [thread overview]
Message-ID: <77bb65a4-d07e-7e92-2f80-d157833c07e8@canonical.com> (raw)
In-Reply-To: <alpine.LRH.2.20.1706231257140.17128@namei.org>
On 06/22/2017 08:02 PM, James Morris wrote:
> On Thu, 22 Jun 2017, John Johansen wrote:
>
>>> Trying to stack major LSMs arbitrarily and exposing that to userland is an
>>> architectural mess, which is what these kinds of problems are really
>>> telling us.
>>>
>>
>> The use case I keep seeing is not exposing multiple LSMs to the user
>> space. Its the container where the container wants a different LSM
>> than the system is running.
>>
>> Stacking 2 LSMs in that case and only exposing one to user space isn't
>> so unreasonable.
>
> In this case, would they both be labeling LSMs which need to label
> packets?
>
> I can imagine having Smack or SELinux as the base LSM and then having
> AppArmor in the container, but having Smack and SELinux in that
> combination would still not make sense to me.
>
I don't see why not. The container could be built expecting smack
labeling, selinux applies 1 or just a few labels to the whole
container, and accesses within the container are mediated fine grained
with smack.
If you are talking system containers like LXC/D this makes even more
sense, your running selinux on the host and the container is using smack
or AppArmor.
It does mean you would have to do some namespacing of some sort so that
the interface would know which LSM to multiplex to. Tasks in the container
write to smack or apparmor, system tasks get selinux.
selinux still gets to enforce a system policy even on the container as
it does today, and the other LSM applies policy as if the container is
the system (at least for system containers).
>>
>>> How can a user be expected to reason about a system which is running
>>> multiple independent MAC security models simultaneously? It's a terrible
>>> idea.
>>>
>>
>> At a generic system MAC level I agree, but not all LSMs that need
>> state are MACs and in the more limited container case it isn't so
>> unreasonable.
>
> Can you provide a concrete example of needing two independent packet
> labeling LSMs?
>
System containers come to mind, as mentioned above. Take an Ubuntu LXC
container and run it on fedora or RHEL. While apparmor isn't doing
packet label yet, patches for that should float up to the list soon,
and really it doesn't have to be ubuntu/apparmor the container guys
want to be a replacement for virtualization, allowing you to run
applications from different OSes on the same host.
You could take the same basic situation of an LXC container built
expecting smack and run it on fedora/RHEL with selinux enforcing for
the host. Except it isn't currently supported.
Right now LXC is limited as to what it can do with the MAC system in
the container. It can currently stack an apparmor host with an
apparmor guest each applying their own policy, but I know they would
love to be mix and match MAC systems, getting them closer to being a
replacement for virtualization. Again it could be argued that going
full virtualization is a better solution if you want different MAC
systems but people will choose (currently are choosing) to run the
container without a MAC instead of going with virtualization.
Another use case would be running snappy packages (chosen because it
is using apparmor to enforce some things, but same could be done with
flatpak if/when it starts using an LSM) on fedora. Currently you have
to either boot the system into apparmor (disabling selinux) or disable
part of the applications mediation. Again yes apparmor doesn't label
packets today but it will soon.
A little more speculatively another potential example would be an LSM
doing a personal firewalls around individual applications. Its really
very similar to the snappy/flatpak sandboxing of apps but maybe
someone wants that with out the additional baggage of a bigger LSM.
Whether it would ever get in upstream is a separate question.
I think we are just starting to scratch the surface of how stacking
will be used. Especially with all the different container/sandboxing
that is going on, and projects like flatpak and snappy pushing to be
system agnostic.
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-06-23 4:32 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 0:41 The secmark "one user" policy Casey Schaufler
2017-06-21 7:13 ` James Morris
2017-06-21 15:23 ` Casey Schaufler
2017-06-21 23:07 ` John Johansen
2017-06-21 23:45 ` Casey Schaufler
2017-06-22 0:48 ` John Johansen
2017-06-22 9:54 ` James Morris
2017-06-22 16:17 ` Casey Schaufler
2017-06-23 3:12 ` James Morris
2017-06-23 15:26 ` Casey Schaufler
2017-06-25 9:41 ` James Morris
2017-06-25 18:05 ` Casey Schaufler
2017-06-26 7:54 ` José Bollo
2017-06-26 15:10 ` Casey Schaufler
2017-06-27 10:51 ` José Bollo
2017-06-27 11:58 ` Paul Moore
2017-06-22 18:49 ` John Johansen
2017-06-23 3:02 ` James Morris
2017-06-23 4:32 ` John Johansen [this message]
2017-06-29 9:10 ` James Morris
2017-06-29 16:46 ` John Johansen
2017-06-22 22:24 ` Paul Moore
2017-06-22 23:20 ` Casey Schaufler
2017-06-23 20:47 ` Paul Moore
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=77bb65a4-d07e-7e92-2f80-d157833c07e8@canonical.com \
--to=john.johansen@canonical.com \
--cc=linux-security-module@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).