rbacsep: type transition conflicts uncovered
I was going through and doing refactoring on the rbacsep with the goal of making the branch compilable again after doing all the derived type collapsing. I ran into a problem with type transition conflicts. There are several domains which have a type transition back to the caller domain, such as su, sudo, (session) dbus, ssh-agent. But now that the derived types are collapsed, we get conflicts such as:
type_transition sudo_t shell_exec_t:process auditadm_t; type_transition sudo_t shell_exec_t:process secadm_t; type_transition sudo_t shell_exec_t:process staff_t; type_transition sudo_t shell_exec_t:process sysadm_t; type_transition sudo_t shell_exec_t:process user_t;
It would seem that there are two solutions for this:
1. keep derived types for these affected domains
2. make these applications SELinux aware
We can't collapse user domains because of their vast differences.
Signature · 9 lines
Chris PeBenito Tresys Technology, LLC (410) 290-1411 x150 -- 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 13 lines · Christopher J. PeBenito
I was going through and doing refactoring on the rbacsep with the goal of making the branch compilable again after doing all the derived type collapsing. I ran into a problem with type transition conflicts. There are several domains which have a type transition back to the caller domain, such as su, sudo, (session) dbus, ssh-agent. But now that the derived types are collapsed, we get conflicts such as:
type_transitionsudo_tshell_exec_t:processauditadm_t;type_transitionsudo_tshell_exec_t:processsecadm_t;type_transitionsudo_tshell_exec_t:processstaff_t;type_transitionsudo_tshell_exec_t:processsysadm_t;type_transitionsudo_tshell_exec_t:processuser_t;
Quoted 6 lines
It would seem that there are two solutions for this:
1. keep derived types for these affected domains
2. make these applications SELinux awareWe can't collapse user domains because of their vast differences.
I'd vote for (1). Otherwise the application is a trusted subject that can transition to any user role/domain.
Signature · 8 lines
Stephen Smalley 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.
Quoted 16 lines · Stephen Smalley
Quoted 15 lines · Christopher J. PeBenito
I was going through and doing refactoring on the rbacsep with the goal of making the branch compilable again after doing all the derived type collapsing. I ran into a problem with type transition conflicts. There are several domains which have a type transition back to the caller domain, such as su, sudo, (session) dbus, ssh-agent. But now that the derived types are collapsed, we get conflicts such as:
type_transitionsudo_tshell_exec_t:processauditadm_t;type_transitionsudo_tshell_exec_t:processsecadm_t;type_transitionsudo_tshell_exec_t:processstaff_t;type_transitionsudo_tshell_exec_t:processsysadm_t;type_transitionsudo_tshell_exec_t:processuser_t;It would seem that there are two solutions for this:
Quoted 7 lines
Quoted 4 lines
1. keep derived types for these affected domains
2. make these applications SELinux awareWe can't collapse user domains because of their vast differences.
I'd vote for (1). Otherwise the application is a trusted subject that can transition to any user role/domain.
Although in this case, hasn't sudo been made SELinux aware lately, including the ability to transition to other roles/domains?
Signature · 8 lines
Stephen Smalley 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.
Quoted 20 lines · Stephen Smalley
Quoted 19 lines · Stephen Smalley
Quoted 18 lines · Christopher J. PeBenito
I was going through and doing refactoring on the rbacsep with the goal of making the branch compilable again after doing all the derived type collapsing. I ran into a problem with type transition conflicts. There are several domains which have a type transition back to the caller domain, such as su, sudo, (session) dbus, ssh-agent. But now that the derived types are collapsed, we get conflicts such as:
type_transitionsudo_tshell_exec_t:processauditadm_t;type_transitionsudo_tshell_exec_t:processsecadm_t;type_transitionsudo_tshell_exec_t:processstaff_t;type_transitionsudo_tshell_exec_t:processsysadm_t;type_transitionsudo_tshell_exec_t:processuser_t;It would seem that there are two solutions for this:
1. keep derived types for these affected domains
2. make these applications SELinux aware
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
We can't collapse user domains because of their vast differences.
I'd vote for (1). Otherwise the application is a trusted subject that can transition to any user role/domain.
Although in this case, hasn't sudo been made SELinux aware lately, including the ability to transition to other roles/domains?
Yes, however, I suppose that we would still want to have a set of type_transitions in case sudo doesn't have the SELinux awareness.
Signature · 9 lines
Chris PeBenito Tresys Technology, LLC (410) 290-1411 x150 -- 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 23 lines · Christopher J. PeBenito
Quoted 22 lines · Stephen Smalley
Quoted 21 lines · Stephen Smalley
Quoted 19 lines · Christopher J. PeBenito
I was going through and doing refactoring on the rbacsep with the goal of making the branch compilable again after doing all the derived type collapsing. I ran into a problem with type transition conflicts. There are several domains which have a type transition back to the caller domain, such as su, sudo, (session) dbus, ssh-agent. But now that the derived types are collapsed, we get conflicts such as:
type_transitionsudo_tshell_exec_t:processauditadm_t;type_transitionsudo_tshell_exec_t:processsecadm_t;type_transitionsudo_tshell_exec_t:processstaff_t;type_transitionsudo_tshell_exec_t:processsysadm_t;type_transitionsudo_tshell_exec_t:processuser_t;It would seem that there are two solutions for this:
1. keep derived types for these affected domains
2. make these applications SELinux awareWe can't collapse user domains because of their vast differences.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I'd vote for (1). Otherwise the application is a trusted subject that can transition to any user role/domain.
Although in this case, hasn't sudo been made SELinux aware lately, including the ability to transition to other roles/domains?
Yes, however, I suppose that we would still want to have a set of
type_transitionsin case sudo doesn't have the SELinux awareness.
The final list on domains that have this problem are:
crontab_tsu_tsession_dbusd_tsudo_tssh_agent_tscreen_tuserhelper_t
The crontab one was just executing helper programs in the user domain. I suspect that was a poor choice; my cursory investigation of vixie cron and fcron indicated that it was just the editor that was run for crontab -e. I changed the transition to exec_no_trans, but it will take some more crontab testing to possibly catch other rules that need to be added. The remainder will have to be restored to their derived-types design.
Signature · 9 lines
Chris PeBenito Tresys Technology, LLC (410) 290-1411 x150 -- 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 43 lines · Christopher J. PeBenito
Quoted 23 lines · Christopher J. PeBenito
Quoted 22 lines · Stephen Smalley
Quoted 21 lines · Stephen Smalley
Quoted 19 lines · Christopher J. PeBenito
I was going through and doing refactoring on the rbacsep with the goal of making the branch compilable again after doing all the derived type collapsing. I ran into a problem with type transition conflicts. There are several domains which have a type transition back to the caller domain, such as su, sudo, (session) dbus, ssh-agent. But now that the derived types are collapsed, we get conflicts such as:
type_transitionsudo_tshell_exec_t:processauditadm_t;type_transitionsudo_tshell_exec_t:processsecadm_t;type_transitionsudo_tshell_exec_t:processstaff_t;type_transitionsudo_tshell_exec_t:processsysadm_t;type_transitionsudo_tshell_exec_t:processuser_t;It would seem that there are two solutions for this:
1. keep derived types for these affected domains
2. make these applications SELinux awareWe can't collapse user domains because of their vast differences.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I'd vote for (1). Otherwise the application is a trusted subject that can transition to any user role/domain.
Although in this case, hasn't sudo been made SELinux aware lately, including the ability to transition to other roles/domains?
Yes, however, I suppose that we would still want to have a set of
type_transitionsin case sudo doesn't have the SELinux awareness.The final list on domains that have this problem are:
crontab_tsu_tsession_dbusd_tsudo_tssh_agent_tscreen_tuserhelper_t
Quoted 4 lines
The crontab one was just executing helper programs in the user domain. I suspect that was a poor choice; my cursory investigation of vixie cron and fcron indicated that it was just the editor that was run for crontab -e. I changed the transition to
exec_no_trans,
Is that safe? The reason for transitioning back to the user domain upon editor invocation was that the user can shell out of the editor and/or execute commands straight from the editor depending on his choice of editor, and I didn't want those to run with the same permissions as crontab itself (e.g. capabilities, ability to write to crontab spool files, etc).
Quoted 5 lines
but it will take some
more crontab testing to possibly catch other rules that need to be added. The remainder will have to be restored to their derived-types design.
Signature · 8 lines
Stephen Smalley 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.
Quoted 49 lines · Stephen Smalley
Quoted 43 lines · Christopher J. PeBenito
Quoted 23 lines · Christopher J. PeBenito
Quoted 22 lines · Stephen Smalley
Quoted 21 lines · Stephen Smalley
Quoted 19 lines · Christopher J. PeBenito
I was going through and doing refactoring on the rbacsep with the goal of making the branch compilable again after doing all the derived type collapsing. I ran into a problem with type transition conflicts. There are several domains which have a type transition back to the caller domain, such as su, sudo, (session) dbus, ssh-agent. But now that the derived types are collapsed, we get conflicts such as:
type_transitionsudo_tshell_exec_t:processauditadm_t;type_transitionsudo_tshell_exec_t:processsecadm_t;type_transitionsudo_tshell_exec_t:processstaff_t;type_transitionsudo_tshell_exec_t:processsysadm_t;type_transitionsudo_tshell_exec_t:processuser_t;It would seem that there are two solutions for this:
1. keep derived types for these affected domains
2. make these applications SELinux awareWe can't collapse user domains because of their vast differences.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I'd vote for (1). Otherwise the application is a trusted subject that can transition to any user role/domain.
Although in this case, hasn't sudo been made SELinux aware lately, including the ability to transition to other roles/domains?
Yes, however, I suppose that we would still want to have a set of
type_transitionsin case sudo doesn't have the SELinux awareness.The final list on domains that have this problem are:
crontab_tsu_tsession_dbusd_tsudo_tssh_agent_tscreen_tuserhelper_tQuoted 4 lines
The crontab one was just executing helper programs in the user domain. I suspect that was a poor choice; my cursory investigation of vixie cron and fcron indicated that it was just the editor that was run for crontab -e. I changed the transition to
exec_no_trans,
Quoted 6 lines
Is that safe? The reason for transitioning back to the user domain upon editor invocation was that the user can shell out of the editor and/or execute commands straight from the editor depending on his choice of editor, and I didn't want those to run with the same permissions as crontab itself (e.g. capabilities, ability to write to crontab spool files, etc).
Well it would gain the capabilities, but the only interesting things that crontab can do is write user temp files and write the cron spool. Since the user can already put whatever he wants into his cron spool either by the text editor or by importing it by crontab <filename>, I don't think that part matters. So would seem that its only a question of how much we care about using capabilities (fowner setuid setgid chown dac_override) to do stuff to user temp files.
Signature · 9 lines
Chris PeBenito Tresys Technology, LLC (410) 290-1411 x150 -- 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 57 lines · Christopher J. PeBenito
Quoted 49 lines · Stephen Smalley
Quoted 43 lines · Christopher J. PeBenito
Quoted 23 lines · Christopher J. PeBenito
Quoted 22 lines · Stephen Smalley
Quoted 21 lines · Stephen Smalley
Quoted 19 lines · Christopher J. PeBenito
I was going through and doing refactoring on the rbacsep with the goal of making the branch compilable again after doing all the derived type collapsing. I ran into a problem with type transition conflicts. There are several domains which have a type transition back to the caller domain, such as su, sudo, (session) dbus, ssh-agent. But now that the derived types are collapsed, we get conflicts such as:
type_transitionsudo_tshell_exec_t:processauditadm_t;type_transitionsudo_tshell_exec_t:processsecadm_t;type_transitionsudo_tshell_exec_t:processstaff_t;type_transitionsudo_tshell_exec_t:processsysadm_t;type_transitionsudo_tshell_exec_t:processuser_t;It would seem that there are two solutions for this:
1. keep derived types for these affected domains
2. make these applications SELinux awareWe can't collapse user domains because of their vast differences.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I'd vote for (1). Otherwise the application is a trusted subject that can transition to any user role/domain.
Although in this case, hasn't sudo been made SELinux aware lately, including the ability to transition to other roles/domains?
Yes, however, I suppose that we would still want to have a set of
type_transitionsin case sudo doesn't have the SELinux awareness.The final list on domains that have this problem are:
crontab_tsu_tsession_dbusd_tsudo_tssh_agent_tscreen_tuserhelper_tQuoted 4 lines
The crontab one was just executing helper programs in the user domain. I suspect that was a poor choice; my cursory investigation of vixie cron and fcron indicated that it was just the editor that was run for crontab -e. I changed the transition to
exec_no_trans,Quoted 6 lines
Is that safe? The reason for transitioning back to the user domain upon editor invocation was that the user can shell out of the editor and/or execute commands straight from the editor depending on his choice of editor, and I didn't want those to run with the same permissions as crontab itself (e.g. capabilities, ability to write to crontab spool files, etc).
Quoted 2 lines
Well it would gain the capabilities, but the only interesting things that crontab can do is write user temp files and write the cron spool.
Injecting commands into another cron spool file would be of concern (e.g. into root or another privileged user's crontab). The crond entrypoint check is supposed to help safeguard against that issue, but if you are collapsing the file types, then we lose that too.
Quoted 5 lines
Since the user can already put whatever he wants into his cron spool either by the text editor or by importing it by crontab <filename>, I don't think that part matters. So would seem that its only a question of how much we care about using capabilities (fowner setuid setgid chown
dac_override) to do stuff to user temp files.
Signature · 8 lines
Stephen Smalley 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.
Quoted 58 lines · Stephen Smalley
Quoted 57 lines · Christopher J. PeBenito
Quoted 55 lines · Stephen Smalley
Quoted 43 lines · Christopher J. PeBenito
Quoted 23 lines · Christopher J. PeBenito
Quoted 22 lines · Stephen Smalley
Quoted 21 lines · Stephen Smalley
Quoted 19 lines · Christopher J. PeBenito
I was going through and doing refactoring on the rbacsep with the goal of making the branch compilable again after doing all the derived type collapsing. I ran into a problem with type transition conflicts. There are several domains which have a type transition back to the caller domain, such as su, sudo, (session) dbus, ssh-agent. But now that the derived types are collapsed, we get conflicts such as:
type_transitionsudo_tshell_exec_t:processauditadm_t;type_transitionsudo_tshell_exec_t:processsecadm_t;type_transitionsudo_tshell_exec_t:processstaff_t;type_transitionsudo_tshell_exec_t:processsysadm_t;type_transitionsudo_tshell_exec_t:processuser_t;It would seem that there are two solutions for this:
1. keep derived types for these affected domains
2. make these applications SELinux awareWe can't collapse user domains because of their vast differences.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I'd vote for (1). Otherwise the application is a trusted subject that can transition to any user role/domain.
Although in this case, hasn't sudo been made SELinux aware lately, including the ability to transition to other roles/domains?
Yes, however, I suppose that we would still want to have a set of
type_transitionsin case sudo doesn't have the SELinux awareness.The final list on domains that have this problem are:
crontab_tsu_tsession_dbusd_tsudo_tssh_agent_tscreen_tuserhelper_tQuoted 4 lines
The crontab one was just executing helper programs in the user domain. I suspect that was a poor choice; my cursory investigation of vixie cron and fcron indicated that it was just the editor that was run for crontab -e. I changed the transition to
exec_no_trans,Is that safe? The reason for transitioning back to the user domain upon editor invocation was that the user can shell out of the editor and/or execute commands straight from the editor depending on his choice of editor, and I didn't want those to run with the same permissions as crontab itself (e.g. capabilities, ability to write to crontab spool files, etc).
Quoted 7 lines
Quoted 2 lines
Well it would gain the capabilities, but the only interesting things that crontab can do is write user temp files and write the cron spool.
Injecting commands into another cron spool file would be of concern (e.g. into root or another privileged user's crontab). The crond entrypoint check is supposed to help safeguard against that issue, but if you are collapsing the file types, then we lose that too.
But that shouldn't be happening due to ubac/rbac separation. Crontab_t isn't exempt from ubac/rbac. I did make an admin_crontab_t that will have the exemption on files so the admin can change other user crontabs. The entrypoint should also be constrained by ubac/rbac.
Quoted 6 lines
Quoted 5 lines
Since the user can already put whatever he wants into his cron spool either by the text editor or by importing it by crontab <filename>, I don't think that part matters. So would seem that its only a question of how much we care about using capabilities (fowner setuid setgid chown
dac_override) to do stuff to user temp files.
Signature · 9 lines
Chris PeBenito Tresys Technology, LLC (410) 290-1411 x150 -- 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 67 lines · Christopher J. PeBenito
Quoted 58 lines · Stephen Smalley
Quoted 57 lines · Christopher J. PeBenito
Quoted 55 lines · Stephen Smalley
Quoted 43 lines · Christopher J. PeBenito
Quoted 23 lines · Christopher J. PeBenito
Quoted 22 lines · Stephen Smalley
Quoted 21 lines · Stephen Smalley
Quoted 19 lines · Christopher J. PeBenito
I was going through and doing refactoring on the rbacsep with the goal of making the branch compilable again after doing all the derived type collapsing. I ran into a problem with type transition conflicts. There are several domains which have a type transition back to the caller domain, such as su, sudo, (session) dbus, ssh-agent. But now that the derived types are collapsed, we get conflicts such as:
type_transitionsudo_tshell_exec_t:processauditadm_t;type_transitionsudo_tshell_exec_t:processsecadm_t;type_transitionsudo_tshell_exec_t:processstaff_t;type_transitionsudo_tshell_exec_t:processsysadm_t;type_transitionsudo_tshell_exec_t:processuser_t;It would seem that there are two solutions for this:
1. keep derived types for these affected domains
2. make these applications SELinux awareWe can't collapse user domains because of their vast differences.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
I'd vote for (1). Otherwise the application is a trusted subject that can transition to any user role/domain.
Although in this case, hasn't sudo been made SELinux aware lately, including the ability to transition to other roles/domains?
Yes, however, I suppose that we would still want to have a set of
type_transitionsin case sudo doesn't have the SELinux awareness.The final list on domains that have this problem are:
crontab_tsu_tsession_dbusd_tsudo_tssh_agent_tscreen_tuserhelper_tQuoted 4 lines
The crontab one was just executing helper programs in the user domain. I suspect that was a poor choice; my cursory investigation of vixie cron and fcron indicated that it was just the editor that was run for crontab -e. I changed the transition to
exec_no_trans,Is that safe? The reason for transitioning back to the user domain upon editor invocation was that the user can shell out of the editor and/or execute commands straight from the editor depending on his choice of editor, and I didn't want those to run with the same permissions as crontab itself (e.g. capabilities, ability to write to crontab spool files, etc).
Quoted 7 lines
Quoted 2 lines
Well it would gain the capabilities, but the only interesting things that crontab can do is write user temp files and write the cron spool.
Injecting commands into another cron spool file would be of concern (e.g. into root or another privileged user's crontab). The crond entrypoint check is supposed to help safeguard against that issue, but if you are collapsing the file types, then we lose that too.
Quoted 4 lines
But that shouldn't be happening due to ubac/rbac separation.
Crontab_tisn't exempt from ubac/rbac. I did make anadmin_crontab_tthat will have the exemption on files so the admin can change other user crontabs. The entrypoint should also be constrained by ubac/rbac.
I see...so you'd have a constraint on entrypoint permission.
That might handle matters when using ubac/rbac separation. Let's consider though any implications for downstream consumers of refpolicy that won't be using ubac/rbac separation on files at all. There they would be relying on DAC for separation, but the crontab program represents a privileged program wrt DAC. I suppose that it already handles switching to the user's identity when invoking the editor and thus DAC should prevent tampering with other user's crontabs or temp files while in the editor. So perhaps it is sufficient.
Signature · 8 lines
Stephen Smalley 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.