All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominick Grift <dominick.grift@defensec.nl>
To: Russell Coker <russell@coker.com.au>
Cc: selinux-refpolicy@vger.kernel.org
Subject: Re: machinectl shell policy
Date: Thu, 24 Dec 2020 09:37:50 +0100	[thread overview]
Message-ID: <ypjlczyz61lt.fsf@defensec.nl> (raw)
In-Reply-To: <8322849.62pqQp6Oog@liv> (Russell Coker's message of "Thu, 24 Dec 2020 09:18:14 +1100")

Russell Coker <russell@coker.com.au> writes:

> allow sysadm_t systemd_machined_t:dbus send_msg;
> systemd_manage_userdb_runtime_dirs(systemd_machined_t)
> systemd_manage_userdb_runtime_sock_files(systemd_machined_t)
> term_use_ptmx(systemd_machined_t)
> dev_getattr_fs(systemd_machined_t)
> term_getattr_pty_fs(systemd_machined_t)
>
> To enable "machinectl shell" on recent versions of systemd we need something 
> like the above policy (which is not complete or ideal, still doesn't work so 
> no point polishing it) and something for the below.  What is the below about?

this should be thoroughly addressed. machined creates a login pty that
gets relabeled on login as per type_change rules.

>
> type=USER_AVC msg=audit(1608759091.934:1799): pid=324 uid=108 auid=4294967295 
> ses=4294967295 subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  
> denied  { 0x2 } for msgtype=error 
> error_name=org.freedesktop.DBus.Error.FileNotFound dest=:1.18 spid=2642 
> tpid=2706 scontext=system_u:system_r:systemd_machined_t:s0 
> tcontext=bofh:sysadm_r:sysadm_t:s0-s0:c0.c1023 tclass=(null) permissive=0  
> exe="/usr/bin/dbus-daemon" sauid=108 hostname=? addr=? 
> terminal=?'UID="messagebus" AUID="unset" SAUID="messagebus"

Yes i noticed the above as well on debian with dbus-daemon, i dont see
any of these on fedora with dbus-broker

By the way we probably shouldnt use the same dbus policy for both
dbus-daemon and dbus-broker because theyre pretty different.

* dbus-broker does not check method returns (dbus-daemon does)
* dbus-broker is systemd specific (dbus activation works via systemd)

-- 
gpg --locate-keys dominick.grift@defensec.nl
Key fingerprint = FCD2 3660 5D6B 9D27 7FC6  E0FF DA7E 521F 10F6 4098
https://sks-keyservers.net/pks/lookup?op=get&search=0xDA7E521F10F64098
Dominick Grift

  reply	other threads:[~2020-12-24  8:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 22:18 machinectl shell policy Russell Coker
2020-12-24  8:37 ` Dominick Grift [this message]
2020-12-25  5:12   ` Russell Coker
2020-12-25  7:58     ` Dominick Grift
2020-12-25  9:16       ` Russell Coker
2020-12-25 11:37         ` Dominick Grift
2021-01-04 14:48         ` Chris PeBenito
2021-01-04 15:00           ` Dominick Grift
2021-01-04 15:06             ` Dominick Grift
2021-01-04 15:13               ` 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=ypjlczyz61lt.fsf@defensec.nl \
    --to=dominick.grift@defensec.nl \
    --cc=russell@coker.com.au \
    --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 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.