<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
This seems to be a bit complicated.<br>As a start I'm trying to create new role and new types, I want the new role to be accessed by unconfined_r, having problem since my last email:<br>Compiling targeted new module<br>/usr/bin/checkmodule:&nbsp; loading policy configuration from tmp/new.tmp<br>new.te":6:ERROR 'unknown role unconfined_r' at token ';' on line 3189:<br>allow unconfined_r new_r; <br>role new_r types example_t;<br>/usr/bin/checkmodule:&nbsp; error(s) encountered while parsing configuration<br>make: *** [tmp/new.mod] Error 1<br><br>the file used: new.te<br>policy_module(new, 0.0.1)<br><br>role new_r;<br>type example_t;<br>role new_r types example_t;<br>allow unconfined_r new_r; <br>&nbsp;(both allow or role causing the same problem).<br><br><br><br>&gt; Subject: Re: su or sudo from unconfined user to confined user<br>&gt; From: sds@tycho.nsa.gov<br>&gt; To: domg472@gmail.com<br>&gt; CC: mrowais@hotmail.com; fedora-selinux-list@redhat.com<br>&gt; Date: Tue, 23 Jun 2009 12:20:38 -0400<br>&gt; <br>&gt; On Tue, 2009-06-23 at 17:17 +0200, Dominick Grift wrote:<br>&gt; &gt; It is possible i think yes.<br>&gt; <br>&gt; I could be wrong, but I think the original poster wanted a way he could<br>&gt; switch to another user's security context in its entirety using su or<br>&gt; sudo.  Which today we do not support.<br>&gt; <br>&gt; The original (and current) view is that the SELinux user field should<br>&gt; only get set when a session is created, and only role, type, and level<br>&gt; can change within a session and only then if within the authorized roles<br>&gt; and levels for the user.  That bounds access escalation within a login<br>&gt; session.  su doesn't affect the SELinux security context, and<br>&gt; newrole/sudo are limited to changing role, type, or level.<br>&gt; <br>&gt; In early Fedora and RHEL 4, there was support for switching the entire<br>&gt; security context upon su, but that was removed.  To re-instate it, you<br>&gt; would need to do two things:<br>&gt; 1) Add the necessary policy rules to allow su to switch the entire<br>&gt; context.  Look at the rules under an ifdef distro_rhel4 in su.if in the<br>&gt; refpolicy for example.  You could add those as a local policy module<br>&gt; rather than rebuilding the base policy.<br>&gt; 2) Add pam_selinux entries to /etc/pam.d/su.  Look in /etc/pam.d/login<br>&gt; for an example of how to do so.<br>&gt; <br>&gt; And I can't guarantee it will still work, as no one uses it that way<br>&gt; anymore.<br>&gt; <br>&gt; &gt; As far as i know there are two requirements (example unconfined_r to<br>&gt; &gt; confined_r)<br>&gt; &gt; <br>&gt; &gt; 1. Your SELinux User must be mapped to both roles.<br>&gt; &gt; semanage user -a -L s0 -r s0-s0 -R "unconfined_r confined_r" -P user<br>&gt; &gt; special_u<br>&gt; &gt; <br>&gt; &gt; 2. Your source role must have access to your target role<br>&gt; &gt; allow unconfined_r confined_r;<br>&gt; &gt; <br>&gt; &gt; (also make default context in /etc/selinux/targeted/contexts/users for<br>&gt; &gt; special_u)<br>&gt; &gt; <br>&gt; &gt; The reason that this is supported by default is because it does not make<br>&gt; &gt; sense to transition from a unconfined domain to a confined domain. It<br>&gt; &gt; defeats the purpose of the unconfined domain.<br>&gt; &gt; <br>&gt; &gt; Unconfined environments are used by processes that are exempted from<br>&gt; &gt; much of the policy enforcement.<br>&gt; &gt; <br>&gt; &gt; In rare cases unconfined domain transition to restricted domains. For<br>&gt; &gt; example: one can toggle a boolean to force unconfined_t to transition to<br>&gt; &gt; nsplugin_t when the process runs nsplugin. <br>&gt; &gt; <br>&gt; &gt; <br>&gt; &gt; On Tue, 2009-06-23 at 15:58 +0100, Mohamed Aburowais wrote:<br>&gt; &gt; &gt; Hello, <br>&gt; &gt; &gt; I've a requirement to use a system as a root, but I need to move so<br>&gt; &gt; &gt; offen to other users and be able to move to their default SELinux user<br>&gt; &gt; &gt; and roles.<br>&gt; &gt; &gt; As it appears to be, it is no a common thing to do, but is it possible<br>&gt; &gt; &gt; without implementing a new policy?<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; Regards<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; <br>&gt; &gt; &gt; ______________________________________________________________________<br>&gt; &gt; &gt; Beyond Hotmail - see what else you can do with Windows Live. Find out<br>&gt; &gt; &gt; more.<br>&gt; &gt; &gt; --<br>&gt; &gt; &gt; fedora-selinux-list mailing list<br>&gt; &gt; &gt; fedora-selinux-list@redhat.com<br>&gt; &gt; &gt; https://www.redhat.com/mailman/listinfo/fedora-selinux-list<br>&gt; &gt; --<br>&gt; &gt; fedora-selinux-list mailing list<br>&gt; &gt; fedora-selinux-list@redhat.com<br>&gt; &gt; https://www.redhat.com/mailman/listinfo/fedora-selinux-list<br>&gt; -- <br>&gt; Stephen Smalley<br>&gt; National Security Agency<br>&gt; <br><br /><hr />View your Twitter and Flickr updates from one place – <a href='http://clk.atdmt.com/UKM/go/137984870/direct/01/' target='_new'>Learn more!</a></body>
</html>