selinux-refpolicy.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Iooss <nicolas.iooss@m4x.org>
To: Chris PeBenito <pebenito@ieee.org>,
	Dominick Grift <dac.override@gmail.com>
Cc: selinux-refpolicy@vger.kernel.org
Subject: Re: [RFC] ssh: remove unconfined_shell_domtrans(sshd_t)
Date: Sun, 1 Sep 2019 13:19:56 +0200	[thread overview]
Message-ID: <CAJfZ7=nT+Q+Oy10T4ooPioOMuk=-57G6-2o1Wa5PeokOxaZ8vA@mail.gmail.com> (raw)
In-Reply-To: <21a95013-0147-63fa-77ab-471ef24b0eb8@ieee.org>

On Sat, Aug 31, 2019 at 10:54 PM Chris PeBenito <pebenito@ieee.org> wrote:
>
> On 8/31/19 1:27 PM, Dominick Grift wrote:
> > This call allows sshd_t associated processes with run shell with an automatic domain transition to unconfined_t.
> > I was unable to make sense of the commit that added this:
> >
> > https://github.com/SELinuxProject/refpolicy/commit/708aab13932bb8830a2d37850cc0a5c72a5d4df4
> >
> > Debian's motd dynamic pam module makes sshd run a shell, we want this shell to run with sshd_t instead of unconfined_t
> >
> > This patch will make the ssh_sysadm_login boolean apply to unconfined ssh logins.
> > To me this makes sense, as unconfined_t is targeted equivalent to the strict sysadm_t.
> > The boolean could however be renamed to the more generic ssh_priv_login name.
> >
> > Signed-off-by: Dominick Grift <dac.override@gmail.com>
> > ---
> >   policy/modules/services/ssh.te | 4 ----
> >   1 file changed, 4 deletions(-)
> >
> > diff --git a/policy/modules/services/ssh.te b/policy/modules/services/ssh.te
> > index 4e75b6e1..a99ad912 100644
> > --- a/policy/modules/services/ssh.te
> > +++ b/policy/modules/services/ssh.te
> > @@ -328,10 +328,6 @@ optional_policy(`
> >       systemd_dbus_chat_logind(sshd_t)
> >   ')
> >
> > -optional_policy(`
> > -     unconfined_shell_domtrans(sshd_t)
> > -')
> > -
> >   optional_policy(`
> >       xserver_domtrans_xauth(sshd_t)
> >       xserver_link_xdm_keys(sshd_t)
>
> I don't have any objections to this.

Would it be possible to extend this patch to other callers of
unconfined_shell_domtrans, like the patch below? It will help fix
issues with Debian's PAM module that generates the MOTD (Message Of
The Day) in a dynamic way, using shell commands (cf.
https://wiki.debian.org/motd for more information: calling system()
triggers a transition to system_u:system_r:unconfined_t because of
unconfined_shell_domtrans).

diff --git a/policy/modules/services/remotelogin.te
b/policy/modules/services/remotelogin.te
index bc2292e37892..c7c9c5646785 100644
--- a/policy/modules/services/remotelogin.te
+++ b/policy/modules/services/remotelogin.te
@@ -91,10 +91,6 @@ optional_policy(`
  telnet_use_ptys(remote_login_t)
 ')

-optional_policy(`
- unconfined_shell_domtrans(remote_login_t)
-')
-
 optional_policy(`
  usermanage_read_crack_db(remote_login_t)
 ')
diff --git a/policy/modules/services/rshd.te b/policy/modules/services/rshd.te
index 0f4caffc4f33..196ed2848e4b 100644
--- a/policy/modules/services/rshd.te
+++ b/policy/modules/services/rshd.te
@@ -74,6 +74,5 @@ optional_policy(`
 ')

 optional_policy(`
- unconfined_shell_domtrans(rshd_t)
  unconfined_signal(rshd_t)
 ')
diff --git a/policy/modules/system/locallogin.te
b/policy/modules/system/locallogin.te
index a56f3d1fbe16..632d2542972d 100644
--- a/policy/modules/system/locallogin.te
+++ b/policy/modules/system/locallogin.te
@@ -200,10 +200,6 @@ optional_policy(`
  systemd_write_inherited_logind_sessions_pipes(local_login_t)
 ')

-optional_policy(`
- unconfined_shell_domtrans(local_login_t)
-')
-
 optional_policy(`
  usermanage_read_crack_db(local_login_t)
 ')


  reply	other threads:[~2019-09-01 11:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-31 17:27 [RFC] ssh: remove unconfined_shell_domtrans(sshd_t) Dominick Grift
2019-08-31 20:54 ` Chris PeBenito
2019-09-01 11:19   ` Nicolas Iooss [this message]
2019-09-01 11:36     ` Dominick Grift

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='CAJfZ7=nT+Q+Oy10T4ooPioOMuk=-57G6-2o1Wa5PeokOxaZ8vA@mail.gmail.com' \
    --to=nicolas.iooss@m4x.org \
    --cc=dac.override@gmail.com \
    --cc=pebenito@ieee.org \
    --cc=selinux-refpolicy@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).