All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ted Toth <txtoth@gmail.com>
To: SELinux <selinux@vger.kernel.org>
Subject: Fwd: [systemd-devel] socket activation selinux context on create
Date: Thu, 25 Aug 2022 08:22:26 -0500	[thread overview]
Message-ID: <CAFPpqQEva6Z339ZXKxF2=ueug7YFrsFD0Tk6W88cZQxx0sg7OQ@mail.gmail.com> (raw)
In-Reply-To: <Ywc+pjOFkAEswVuQ@gardel-login>

I asked on the systemd-devel list about enabling systemd to set the
context of a socket and got the answer I've included below. I don't
know how a transition rule can be written to transition tcp sockets to
multiple different target contexts, is this possible and if so how?

---------- Forwarded message ---------
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, Aug 25, 2022 at 4:19 AM
Subject: Re: [systemd-devel] socket activation selinux context on create
To: Ted Toth <txtoth@gmail.com>
Cc: <systemd-devel@lists.freedesktop.org>


On Mi, 24.08.22 11:50, Ted Toth (txtoth@gmail.com) wrote:

> I don't see a way to set the context of the socket that systemd
> listens on. If there is a way to do this please tell me otherwise I'd
> like to see an option (SELinuxCreateContext?) added to be able to set
> the context (setsockcreatecon) to be used by systemd when creating the
> socket. Currently as an extra layer of security I add code called in
> the socket activation ExecStartPre process to check that the source
> context (peercon) can connect to the target context (getcon). If a
> sockets context was set by systemd I would have to perform this
> additional check as my SELinux policy would do it for me.

This was proposed before, but SELinux maintainers really want that the
loaded selinux policy picks the label, and not unit files.

i.e. as I understand their philosophy: how labels are assigned should
be encoded in the database and in the policy but not elsewhere,
i.e. in unit files. I think that philosophy does make sense.

Lennart

--
Lennart Poettering, Berlin

       reply	other threads:[~2022-08-25 13:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAFPpqQHS_v7gqXsdCpE3LXA4JzL=-K0U7Q9jiGY5EqT6XCoQbg@mail.gmail.com>
     [not found] ` <Ywc+pjOFkAEswVuQ@gardel-login>
2022-08-25 13:22   ` Ted Toth [this message]
2022-08-25 13:30     ` [systemd-devel] socket activation selinux context on create Ted Toth
2022-08-25 19:55       ` Ted Toth
2022-08-29 21:21     ` Paul Moore
2022-08-30 22:04       ` Ted Toth
2022-08-31  0:45         ` Paul Moore
2022-08-31 14:55           ` Christian Göttsche
2022-08-31 17:02             ` Ted Toth
2022-08-31 17:28               ` Dominick Grift
2022-09-01 16:57                 ` Ted Toth
2022-09-02 10:00                   ` Dominick Grift
2022-09-02 13:56                     ` Ted Toth

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='CAFPpqQEva6Z339ZXKxF2=ueug7YFrsFD0Tk6W88cZQxx0sg7OQ@mail.gmail.com' \
    --to=txtoth@gmail.com \
    --cc=selinux@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 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.