From: Joshua Brindle <brindle@quarksecurity.com>
To: selinux@tycho.nsa.gov
Subject: Re: [RFC] systemd the userspace object manager
Date: Fri, 21 Nov 2014 07:43:57 -0500 [thread overview]
Message-ID: <546F338D.9030003@quarksecurity.com> (raw)
In-Reply-To: <20141121113120.GA25417@e145.network2>
Dominick Grift wrote:
> On Thu, Nov 20, 2014 at 03:44:19PM -0500, Joshua Brindle wrote:
>> I can see why you'd want someone to be able to restart apache but not
>> everything. Certainly having specific permissions is not the way to
>> accomplish that.
>>
>> The rule above is kind of strange, permissions should not be equivalence
>> classes, types should be, so it should be more like:
>>
>> allow<domain requesting restart> <derived service label> : init {start
>> stop}
>>
>> right?
>
> If only it were that simple. Here is my take on the whole thing:
>
> Generally services are managed by "service" access checks on unit file types
>
> allow webadmin webserverunitfile:service {start stop};
>
> However these is also a concept of transient (in-memory) unit files, managing a service through a transient unit would work like:
>
> allow user self:service {start stop};
>
> or in the case of transient systemd units:
>
> allow user systemd:service {stop start};
>
> Then there is the system(d) class which also has the start, stop permissions associated with it (it is yet to be determined for what exactly)
>
> In my policy systemd-logind does the following:
>
> allow logind_t systemd:system(d) { start stop };
>
> I suspect that this is required to spawn the systemd session daemon (at least)
> It may or may not also be required for kexec (not sure as i havent tested that yet)
>
> This is pretty much just all speculation though, in the sense that this is broadly what i see happening in the system, and it might not be the same as what *should* be happening
> Instead its probably better to just read the systemd object manager code
>
I don't think we are saying different things. Note my rule above
specifically says the object label is derived. I never speculated about
how it would be derived, though it could be based on label mapping or
type_trans calculations. In the cases above it would seem like there are
some transient labels that need to be derived without the luxury of an
object on-disk so you could either using a labeling file:
user_u:user_r:user_t:s0 user_u:user_r:user_service_t:s0
or a type_transition using the systemd or service object class:
type_transition user_t systemd_t service:user_service_t
Both of these has been done for various other userspace object classes,
I haven't yet seen anything that makes systemd 'special'.
prev parent reply other threads:[~2014-11-21 12:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 16:38 [RFC] systemd the userspace object manager Christopher J. PeBenito
2014-11-18 18:48 ` Christopher J. PeBenito
2014-11-18 19:20 ` Dominick Grift
2014-11-20 13:52 ` Christopher J. PeBenito
2014-11-20 15:59 ` Dominick Grift
2014-11-20 20:44 ` Joshua Brindle
2014-11-21 11:31 ` Dominick Grift
2014-11-21 12:43 ` Joshua Brindle [this message]
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=546F338D.9030003@quarksecurity.com \
--to=brindle@quarksecurity.com \
--cc=selinux@tycho.nsa.gov \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.