Samba fixes
I have been working heavily with the samba team here to get selinux policy working well with samba.
Most controversial part issamba_unconfined_script_exec_t
Which is a directory that administrators can put random scripts into and allow samba to execute.
policy/modules/services/samba.fc +3 -0
@@ -27,6 +27,9 @@ /var/cache/samba/winbindd_privileged(/.*)? gen_context(system_u:object_r:winbind_var_run_t,s0) /var/lib/samba(/.*)? gen_context(system_u:object_r:samba_var_t,s0) +/var/lib/samba/winbindd_privileged(/.*)? gen_context(system_u:object_r:winbind_var_run_t,s0) + +/var/lib/samba/scripts(/.*)? gen_context(system_u:object_r:samba_unconfined_script_exec_t,s0) /var/log/samba(/.*)? gen_context(system_u:object_r:samba_log_t,s0)
policy/modules/services/samba.if +86 -0
112 lines not on this page · raw message
policy/modules/services/samba.te +83 -2
182 lines not on this page · raw message
policy/modules/services/nscd.te +9 -1
@@ -30,7 +30,7 @@ allow nscd_t self:capability { kill setgid setuid audit_write }; dontaudit nscd_t self:capability sys_tty_config; -allow nscd_t self:process { getattr setsched signal_perms }; +allow nscd_t self:process { getattr setcap setsched signal_perms }; allow nscd_t self:fifo_file { read write }; allow nscd_t self:unix_stream_socket create_stream_socket_perms; allow nscd_t self:unix_dgram_socket create_socket_perms;
@@ -119,3 +119,11 @@ xen_dontaudit_rw_unix_stream_sockets(nscd_t) xen_append_log(nscd_t) ') + +optional_policy(` + tunable_policy(`samba_domain_controller',` + samba_append_log(nscd_t) + samba_dontaudit_use_fds(nscd_t) + ') +') +
policy/modules/services/radius.te +4 -0
@@ -130,3 +130,7 @@ optional_policy(` udev_read_db(radiusd_t) ') + +optional_policy(` + samba_read_var_files(radiusd_t) +')
Quoted 7 lines · Daniel J Walsh
I have been working heavily with the samba team here to get selinux policy working well with samba.
Most controversial part is
samba_unconfined_script_exec_tWhich is a directory that administrators can put random scripts into and allow samba to execute.
So, three questions:
1) What user would be executing these scripts? The 'samba' user?
2) What is the intention of such functionality? To have samba be able to run file management tools or something?
3) Is supporting this functionality even a good idea?
Mike
--
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 11 lines · Michael C Thompson
Quoted 7 lines · Daniel J Walsh
I have been working heavily with the samba team here to get selinux policy working well with samba.
Most controversial part is
samba_unconfined_script_exec_tWhich is a directory that administrators can put random scripts into and allow samba to execute.
So, three questions:
1) What user would be executing these scripts? The 'samba' user?
Samba Developers say:
Either the authenticated user or root, it really depends on the script.
For example, a "preexec" script is run before the share is accessed as the user that authenticated to samba (or the forced user as per "force user" parameter), while a "root preexec" script would always be run as root. Other scripts always run as root or always as auth user depending on the action to be performed (ie add user scripts always run as root, while print related stuff should always run as user).
Quoted 3 lines
2) What is the intention of such functionality? To have samba be able to run file management tools or something?
3) Is supporting this functionality even a good idea?
As opposed to setenforce 0/or samba_disable_trans?
Quoted 2 lines
Mike
--
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 24 lines · Daniel J Walsh
Quoted 11 lines · Michael C Thompson
Quoted 7 lines · Daniel J Walsh
I have been working heavily with the samba team here to get selinux policy working well with samba.
Most controversial part is
samba_unconfined_script_exec_tWhich is a directory that administrators can put random scripts into and allow samba to execute.
So, three questions:
1) What user would be executing these scripts? The 'samba' user?Samba Developers say:
Either the authenticated user or root, it really depends on the script.
For example, a "preexec" script is run before the share is accessed as the user that authenticated to samba (or the forced user as per "force user" parameter), while a "root preexec" script would always be run as root. Other scripts always run as root or always as auth user depending on the action to be performed (ie add user scripts always run as root, while print related stuff should always run as user).
Quoted 1 line
Quoted 3 lines
Quoted 2 lines
2) What is the intention of such functionality? To have samba be able to run file management tools or something?
3) Is supporting this functionality even a good idea?As opposed to setenforce 0/or
samba_disable_trans?
That might be better than running with a false sense of security :) Even though this is an "administrative restricted" set of scripts, if an attacker could place malicious scripts in the directory, then permitting samba to exec them as root could be an avenue of attack.
My original point was simply that if its so controversial, that might beg the question "is offering this functionality a good idea, in the first place?".
Mike
--
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 30 lines · Michael C Thompson
Quoted 29 lines · Daniel J Walsh
Quoted 5 lines · Michael C Thompson
Quoted 4 lines · Daniel J Walsh
I have been working heavily with the samba team here to get selinux policy working well with samba.
Quoted 8 lines
Quoted 5 lines
Most controversial part is
samba_unconfined_script_exec_tWhich is a directory that administrators can put random scripts into and allow samba to execute.
So, three questions:
1) What user would be executing these scripts? The 'samba' user?Samba Developers say:
Either the authenticated user or root, it really depends on the script.
For example, a "preexec" script is run before the share is accessed as the user that authenticated to samba (or the forced user as per "force user" parameter), while a "root preexec" script would always be run as root. Other scripts always run as root or always as auth user depending on the action to be performed (ie add user scripts always run as root, while print related stuff should always run as user).
Quoted 4 lines
2) What is the intention of such functionality? To have samba be able to run file management tools or something?
3) Is supporting this functionality even a good idea?
Quoted 7 lines
Quoted 1 line
As opposed to setenforce 0/or
samba_disable_trans?That might be better than running with a false sense of security :) Even though this is an "administrative restricted" set of scripts, if an attacker could place malicious scripts in the directory, then permitting samba to exec them as root could be an avenue of attack.
Well, setenforce 0 means that SELinux is definitely not improving security while allowing this is just a potential problem.
Quoted 5 lines
My original point was simply that if its so controversial, that might beg the question "is offering this functionality a good idea, in the first place?".
Trying to make security decisions for people makes them just disable SELinux. I don't mean to aim this directly at you, but we should treat the users of SELinux as intelligent and capable of making their own risk decisions.
As long as it is possible to use this feature in at least one way that isn't false security then it should be available (e.g., by tightly controlling how the scripts could be added). Clueless users will allow this one way or another and I think it is preferable to have them leave SELinux on than disable it.
Along those lines:
* Can samba write to this directory (making it essentially unconfined)?
* Is the directory separately typed so that other domains can be controlled?
* Is there a fairly easy way to create a confined script type (like with Apache)? That would offer a more secure alternative?
* Can the running of the scripts be disabled with a boolean?
Karl
Quoted 6 lines
Mike
--
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.
--
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.