policy for resmgrd
Resmgrd is a daemon which is used on SuSE Linux to mediate access to devices. Clients can ask resmgrd to open a specific device, resmgrd checks if the app has appropriate permission and opens the device on behalf of the client. Resmgrd should probably be a userspace SELinux enforcer, but for now the attached policy allows it to work on a SELinux system.
Thomas
Signature · 2 lines
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA D09E C562 2BAE B2F4 ABE7
domains/program/unused/resmgrd.te +25 -0
@@ -0,0 +1,25 @@ +# DESC resmgrd - resource manager daemon +# +# Author: Thomas Bleher <[email protected]> + +daemon_base_domain(resmgrd) +var_run_domain(resmgrd, { file sock_file }) +etc_domain(resmgrd) +read_locale(resmgrd_t) +allow resmgrd_t self:capability { dac_override dac_read_search sys_admin sys_rawio }; + +allow resmgrd_t etc_t:file { getattr read }; +allow resmgrd_t self:unix_stream_socket create_stream_socket_perms; +allow resmgrd_t self:unix_dgram_socket { connect create write }; + +# hardware access +allow resmgrd_t device_t:lnk_file { getattr read }; +# not sure if it needs write access, needs to be investigated further... +allow resmgrd_t removable_device_t:blk_file { getattr ioctl read write }; +allow resmgrd_t scsi_generic_device_t:chr_file { getattr ioctl read }; +allow resmgrd_t scanner_device_t:chr_file { getattr }; +# I think a dontaudit should be enough there +dontaudit resmgrd_t fixed_disk_device_t:blk_file { getattr ioctl read }; + +# there is a macro can_resmgrd_connect() in macros/program/resmgrd_macros.te +
domains/program/unused/xdm.te +1 -0
@@ -130,6 +130,7 @@ allow xdm_t v4l_device_t:chr_file { setattr getattr }; allow xdm_t scanner_device_t:chr_file { setattr getattr }; allow xdm_t tty_device_t:chr_file { ioctl read write setattr getattr }; +can_resmgrd_connect(xdm_t) # Access xdm log files. file_type_auto_trans(xdm_t, var_log_t, xserver_log_t, file)
file_contexts/program/resmgrd.fc +6 -0
@@ -0,0 +1,6 @@ +# resmgrd +/sbin/resmgrd -- system_u:object_r:resmgrd_exec_t +/etc/resmgr\.conf -- system_u:object_r:resmgrd_etc_t +/var/run/resmgr\.pid -- system_u:object_r:resmgrd_var_run_t +/var/run/\.resmgr_socket system_u:object_r:resmgrd_var_run_t +
macros/base_user_macros.te +2 -0
@@ -177,6 +177,8 @@ allow $1_t misc_device_t:{ chr_file blk_file } rw_file_perms; allow $1_t device_t:lnk_file { getattr read }; +can_resmgrd_connect($1_t) + # # evolution and gnome-session try to create a netlink socket #
macros/program/resmgrd_macros.te +10 -0
@@ -0,0 +1,10 @@ +# Macro for resmgrd + +define(`can_resmgrd_connect', ` +ifdef(`resmgrd.te', ` +allow $1 resmgrd_t:unix_stream_socket connectto; +allow $1 resmgrd_var_run_t:sock_file write; +allow $1 resmgrd_t:fd use; +') +') +
Quoted 6 lines · Thomas Bleher
Resmgrd is a daemon which is used on SuSE Linux to mediate access to devices. Clients can ask resmgrd to open a specific device, resmgrd checks if the app has appropriate permission and opens the device on behalf of the client. Resmgrd should probably be a userspace SELinux enforcer, but for now the attached policy allows it to work on a SELinux system.
allow resmgrd_t self:unix_dgram_socket { connect create write };
I suggest that the above be replace by:
allow resmgrd_t self:unix_dgram_socket create_socket_perms;
There's no real reason to restrict it's unix domain socket access to itself.
Apart from that it's great, I've put it in my tree.
Signature · 9 lines
http://www.coker.com.au/selinux/ My NSA Security Enhanced Linux packages http://www.coker.com.au/bonnie++/ Bonnie++ hard drive benchmark http://www.coker.com.au/postal/ Postal SMTP/POP benchmark http://www.coker.com.au/~russell/ My home page -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.
Quoted 9 lines · Russell Coker
Quoted 6 lines · Thomas Bleher
Resmgrd is a daemon which is used on SuSE Linux to mediate access to devices. Clients can ask resmgrd to open a specific device, resmgrd checks if the app has appropriate permission and opens the device on behalf of the client. Resmgrd should probably be a userspace SELinux enforcer, but for now the attached policy allows it to work on a SELinux system.
Quoted 7 lines
allow
resmgrd_tself:unix_dgram_socket { connect create write };I suggest that the above be replace by:
allow
resmgrd_tself:unix_dgram_socketcreate_socket_perms;There's no real reason to restrict it's unix domain socket access to itself.
Agreed.
New version of the patch attached.
Thomas
Signature · 2 lines
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA D09E C562 2BAE B2F4 ABE7
domains/program/unused/resmgrd.te +25 -0
@@ -0,0 +1,25 @@ +# DESC resmgrd - resource manager daemon +# +# Author: Thomas Bleher <[email protected]> + +daemon_base_domain(resmgrd) +var_run_domain(resmgrd, { file sock_file }) +etc_domain(resmgrd) +read_locale(resmgrd_t) +allow resmgrd_t self:capability { dac_override dac_read_search sys_admin sys_rawio }; + +allow resmgrd_t etc_t:file { getattr read }; +allow resmgrd_t self:unix_stream_socket create_stream_socket_perms; +allow resmgrd_t self:unix_dgram_socket create_socket_perms; + +# hardware access +allow resmgrd_t device_t:lnk_file { getattr read }; +# not sure if it needs write access, needs to be investigated further... +allow resmgrd_t removable_device_t:blk_file { getattr ioctl read write }; +allow resmgrd_t scsi_generic_device_t:chr_file { getattr ioctl read }; +allow resmgrd_t scanner_device_t:chr_file { getattr }; +# I think a dontaudit should be enough there +dontaudit resmgrd_t fixed_disk_device_t:blk_file { getattr ioctl read }; + +# there is a macro can_resmgrd_connect() in macros/program/resmgrd_macros.te +
domains/program/unused/xdm.te +1 -0
@@ -130,6 +130,7 @@ allow xdm_t v4l_device_t:chr_file { setattr getattr }; allow xdm_t scanner_device_t:chr_file { setattr getattr }; allow xdm_t tty_device_t:chr_file { ioctl read write setattr getattr }; +can_resmgrd_connect(xdm_t) # Access xdm log files. file_type_auto_trans(xdm_t, var_log_t, xserver_log_t, file)
file_contexts/program/resmgrd.fc +6 -0
@@ -0,0 +1,6 @@ +# resmgrd +/sbin/resmgrd -- system_u:object_r:resmgrd_exec_t +/etc/resmgr\.conf -- system_u:object_r:resmgrd_etc_t +/var/run/resmgr\.pid -- system_u:object_r:resmgrd_var_run_t +/var/run/\.resmgr_socket system_u:object_r:resmgrd_var_run_t +
macros/base_user_macros.te +2 -0
@@ -177,6 +177,8 @@ allow $1_t misc_device_t:{ chr_file blk_file } rw_file_perms; allow $1_t device_t:lnk_file { getattr read }; +can_resmgrd_connect($1_t) + # # evolution and gnome-session try to create a netlink socket #
macros/program/resmgrd_macros.te +10 -0
@@ -0,0 +1,10 @@ +# Macro for resmgrd + +define(`can_resmgrd_connect', ` +ifdef(`resmgrd.te', ` +allow $1 resmgrd_t:unix_stream_socket connectto; +allow $1 resmgrd_var_run_t:sock_file write; +allow $1 resmgrd_t:fd use; +') +') +
Ping [was: Re: policy for resmgrd]
Quoted 5 lines · Thomas Bleher
Quoted 4 lines · Russell Coker
Quoted 2 lines · Thomas Bleher
Resmgrd is a daemon which is used on SuSE Linux to mediate access to devices.
Just a small reminder so that this patch (together with the patch for timidity) is not forgotten.
If there are objections to these patches I'd like to hear them, otherwise it would be cool if they could make their way to CVS.
Thanks,
Thomas
Signature · 2 lines
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA D09E C562 2BAE B2F4 ABE7
Merged.
Quoted 22 lines · Thomas Bleher
Quoted 9 lines · Russell Coker
Quoted 6 lines · Thomas Bleher
Resmgrd is a daemon which is used on SuSE Linux to mediate access to devices. Clients can ask resmgrd to open a specific device, resmgrd checks if the app has appropriate permission and opens the device on behalf of the client. Resmgrd should probably be a userspace SELinux enforcer, but for now the attached policy allows it to work on a SELinux system.
Quoted 7 lines
allow
resmgrd_tself:unix_dgram_socket { connect create write };I suggest that the above be replace by:
allow
resmgrd_tself:unix_dgram_socketcreate_socket_perms;There's no real reason to restrict it's unix domain socket access to itself.
Agreed.
New version of the patch attached.Thomas
Signature · 7 lines
James Carter <[email protected]> National Security Agency -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.