[systemd-devel] [systemd SELinux] system status permission

Ian Pilcher arequipeno at gmail.com
Mon Oct 7 18:31:07 UTC 2019


On 10/7/19 12:09 PM, Dominick Grift wrote:
> 
> I tried it out with simple `systemctl status`
> 
> Oct 07 19:04:21 myguest systemd[1]: Sent message type=method_return
> sender=org.freedesktop.systemd1 destination=n/a path=n/a
> interface=n/a member=n/a cookie=1 reply_cookie=1 signature=a{sv}
> error-name=n/a error-message=n/a Oct 07 19:04:21 myguest systemd[1]:
> SELinux access check
> scon=wheel.id:sysadm.role:systemctl.sysadm.subj:s0
> tcon=sys.id:sys.role:systemd.system.subj:s0 tclass=system perm=status
> path=(null) cmdline=: 0 Oct 07 19:04:21 myguest systemd[1]: Got
> message type=method_call sender=n/a
> destination=org.freedesktop.systemd1 path=/org/freedesktop/systemd1
> interface=org.freedesktop.DBus.Properties member=GetAll cookie=1
> reply_cookie=0 signature=s error-name=n/a error-message=n/a
> 
> So the method "get all properties from systemd1" was called by
> running that, and that triggered a "system status" check
> 

Thanks for checking this out.  I does indeed seem that this check is
triggered by the 'systemctl status' command (or which I was previously
unaware).  It isn't, however, triggered by 'systemctl status $UNIT';
that check looks like:

Oct 07 13:20:45 c7.penurio.us systemd[1]: SELinux access check 
scon=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 
tcon=unconfined_u:object_r:radvd_dynamic_unit_file_t:s0 tclass=service 
perm=status path=/etc/systemd/system/radvd.service cmdline=systemctl 
status radvd.service: 0

I.e. the target context type is that of the unit file.

Looks like this is going to be a dontaudit, since my service has no
business looking at the overall system state.

-- 
========================================================================
Ian Pilcher                                         arequipeno at gmail.com
-------- "I grew up before Mark Zuckerberg invented friendship" --------
========================================================================


More information about the systemd-devel mailing list