--> answer in your mail body!<br><br><b><i>fedora-selinux-list-request@redhat.com</i></b> a écrit :<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Send fedora-selinux-list mailing list submissions to<br> fedora-selinux-list@redhat.com<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br> https://www.redhat.com/mailman/listinfo/fedora-selinux-list<br>or, via email, send a message with subject or body 'help' to<br> fedora-selinux-list-request@redhat.com<br><br>You can reach the person managing the list at<br> fedora-selinux-list-owner@redhat.com<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of fedora-selinux-list digest..."<br><br><br>Today's Topics:<br><br>   1. using runcon -l s1 (Clarkson, Mike R (US SSA))<br>   2. Re: using runcon -l s1 (Daniel J Walsh)<br>   3. Re: Helper program for a daemon (Al
 Pacifico)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Mon, 23 Apr 2007 10:22:11 -0700<br>From: "Clarkson, Mike R \(US SSA\)" <mike.clarkson@baesystems.com><br>Subject: using runcon -l s1<br>To: <fedora-selinux-list@redhat.com><br>Message-ID:<br> <FB39F4E77226B448BC1388D3BE4E00CD01B8E2EF@blums0008.sd.gd.com><br>Content-Type: text/plain; charset="us-ascii"<br><br>I am trying to figure out how to get "runcon -l s1" to work while having<br>selinux in enforcing mode. So far, I can only use the runcon command<br>successfully with selinux in permissive mode. Here is the error I get<br>when in enforcing mode:<br><br> <br><br>>runcon -l s1 ./SimulatedImport /home/m252/SimulatedImport/output/junk<br><br>execvp: Permission denied<br><br> --> you should know that enforcing mode makes that SELinux will be fully activated that meens policies are respected ans as a user you have a role and this role will assign to you
 specific permissions!!! that's why you get this message your role doesn't give you access to this permission. this the principal way for protection of SELinux.<br><br>My shell is running as root in the unconfined_t domain. Here is the<br>output of id -Z:<br><br>            root:system_r:unconfined_t:s0-s15:c0.c255<br><br> -->this context is assigned to root as défault context. you can modify it with newrole<br><br>The executable that I'm trying to run with runcon is "SimulatedImport".<br>This is a very simple program which simply creates a small text file. I<br>have created a domain named "import_t" for this program.<br><br> <br><br>I have an selinux policy that I built as an mls policy off the targeted<br>policy. <br><br> <br><br>When I run audit2allow I get the following:<br><br> <br><br>audit2allow -i /var/log/audit/audit.log -l -v -r<br><br>require {<br><br>        class dir search;<br><br>        class file { getattr read };<br><br>        class process
 transition;<br><br>        type auditd_log_t;<br><br>        type unconfined_t;<br><br>        role system_r;<br><br>};<br><br> <br><br>allow unconfined_t auditd_log_t:dir search;<br><br>        #TYPE=AVC  MSG=audit(1177347232.381:45684):  COMM="audit2allow"<br>NAME="audit"   : search<br><br>        #TYPE=AVC  MSG=audit(1177347344.098:45698):  COMM="audit2allow"<br>NAME="audit"   : search<br><br>allow unconfined_t auditd_log_t:file { getattr read };<br><br>        #TYPE=AVC  MSG=audit(1177347344.098:45699):  COMM="audit2allow"<br>NAME="audit.log"   : getattr<br><br>        #TYPE=AVC  MSG=audit(1177347344.098:45698):  COMM="audit2allow"<br>NAME="audit.log"   : read<br><br>allow unconfined_t self:process transition;<br><br>        #TYPE=AVC  MSG=audit(1177347223.780:45683):  COMM="runcon"<br>NAME="SimulatedImport"   : transition<br><br> <br><br>Adding "allow unconfined_t self:process transition;" to my "import"<br>module seems to have no effect.<br>-->i think you should
 use allow for transition from a domain to another so i don't thik that this rule you added is right.<br> <br><br>Any help would be appreciated.<br><br> <br><br>Thanks,<br><br>Mike<br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: https://www.redhat.com/archives/fedora-selinux-list/attachments/20070423/f6255682/attachment.html<br><br>------------------------------<br><br>Message: 2<br>Date: Tue, 24 Apr 2007 08:31:49 -0400<br>From: Daniel J Walsh <dwalsh@redhat.com><br>Subject: Re: using runcon -l s1<br>To: "Clarkson, Mike R (US SSA)" <mike.clarkson@baesystems.com><br>Cc: fedora-selinux-list@redhat.com<br>Message-ID: <462DF8B5.5060301@redhat.com><br>Content-Type: text/plain; charset=windows-1252; format=flowed<br><br>Clarkson, Mike R (US SSA) wrote:<br>><br>> I am trying to figure out how to get “runcon –l s1” to work while <br>> having selinux in enforcing mode. So far, I can only use the runcon <br>> command
 successfully with selinux in permissive mode. Here is the <br>> error I get when in enforcing mode:<br>><br>> >runcon -l s1 ./SimulatedImport /home/m252/SimulatedImport/output/junk<br>><br>> execvp: Permission denied<br>><br>> My shell is running as root in the unconfined_t domain. Here is the <br>> output of id –Z:<br>><br>> root:system_r:unconfined_t:s0-s15:c0.c255<br>><br>> The executable that I’m trying to run with runcon is <br>> “SimulatedImport”. This is a very simple program which simply creates <br>> a small text file. I have created a domain named “import_t” for this <br>> program.<br>><br>> I have an selinux policy that I built as an mls policy off the <br>> targeted policy.<br>><br>> When I run audit2allow I get the following:<br>><br>> audit2allow -i /var/log/audit/audit.log -l -v -r<br>><br>> require {<br>><br>> class dir search;<br>><br>> class file { getattr read
 };<br>><br>> class process transition;<br>><br>> type auditd_log_t;<br>><br>> type unconfined_t;<br>><br>> role system_r;<br>><br>> };<br>><br>> allow unconfined_t auditd_log_t:dir search;<br>><br>> #TYPE=AVC MSG=audit(1177347232.381:45684): COMM="audit2allow" <br>> NAME="audit" : search<br>><br>> #TYPE=AVC MSG=audit(1177347344.098:45698): COMM="audit2allow" <br>> NAME="audit" : search<br>><br>> allow unconfined_t auditd_log_t:file { getattr read };<br>><br>> #TYPE=AVC MSG=audit(1177347344.098:45699): COMM="audit2allow" <br>> NAME="audit.log" : getattr<br>><br>> #TYPE=AVC MSG=audit(1177347344.098:45698): COMM="audit2allow" <br>> NAME="audit.log" : read<br>><br>> allow unconfined_t self:process transition;<br>><br>> #TYPE=AVC MSG=audit(1177347223.780:45683): COMM="runcon" <br>> NAME="SimulatedImport" : transition<br>><br>> Adding “allow unconfined_t self:process transition;”
 to my “import” <br>> module seems to have no effect.<br>><br>I think you are being prevented by a constraint of MLS<br><br>As a guess I would suggest trying:<br><br>mls_process_set_level(unconfined_t)<br>><br>><br>> Any help would be appreciated.<br>><br>> Thanks,<br>><br>> Mike<br>><br>> ------------------------------------------------------------------------<br>><br>> --<br>> fedora-selinux-list mailing list<br>> fedora-selinux-list@redhat.com<br>> https://www.redhat.com/mailman/listinfo/fedora-selinux-list<br><br><br><br><br><br>------------------------------<br><br>Message: 3<br>Date: Tue, 24 Apr 2007 08:36:01 -0700<br>From: "Al Pacifico" <adpacifico@users.sourceforge.net><br>Subject: Re: Helper program for a daemon<br>To: fedora-selinux-list@redhat.com<br>Cc: Daniel J Walsh <dwalsh@redhat.com><br>Message-ID:<br> <5d3cd4150704240836q7d6627a0qc931aa67461f9082@mail.gmail.com><br>Content-Type: text/plain;
 charset="iso-8859-1"<br><br>On 4/19/07, Daniel J Walsh <dwalsh@redhat.com> wrote:<br>><br>> Al Pacifico wrote:<br>> > I (a greenhorn with selinux) am writing a policy for a daemon that<br>> > streams music files over my home network to a music player client (a<br>> > Slimdevices Squeezebox). My OS is FC5.<br>> ><br>> > The main daemon (/usr/sbin/slimserver) is a perl script that serves<br>> > the music files and is started with an init script. My questions have<br>> > to do with a secondary program (/usr/sbin/slimserver-scanner, also a<br>> > perl script) that scans the music on the server, reading mp3 tags and<br>> > such, and generates a database of stored music that is stored in a<br>> > MySQL database. /usr/sbin/slimserver-scanner is invoked by the<br>> > /usr/sbin/slimserver daemon and might be invoked by the user (although<br>> > I can't recall ever doing so in several years of owning a
 Squeezebox).<br>> ><br>> > I've been following the example posted by Dan Walsh in a blog at<br>> > http://danwalsh.livejournal.com/8707.html?thread=39171 which has been<br>> > extremely helpful.<br>> ><br>> > My (2) questions:<br>> > 1. What is the appropriate file context for the scanner program?<br>> > system_u:object_r:sbin_t?<br>> > system_u:object_r:slimserver_t?<br>> > system_u:object_r:slimserver_exec_t?<br>> ><br>> That depends on your security goals.  If you want the slimserver-scanner<br>> to have the same privs as slimserver you would label it sbin_t and allow<br>> slimserver to corecmd_exec_sbin().  If you want to go with least privs,<br>> you would create a new policy for slimserver-scanner<br>> (slimserver_scanner_t with file context of slimserver_scanner_exec_t)<br>> and then add a rule to slimserver_t to domtrans<br>>
 slimserver_scanner_domtrans(slimserver_t)<br><br><br>I'm a little confused about this. I want to limit privileges of slimserver<br>and slimserver-scanner to accessing only certain files. If I label<br>slimserver-scanner as 'sbin_t', when a user executes slimserver-scanner,<br>won't he/she have more privileges than slimserver then?<br><br>> The generated slimserver.fc file contains:<br>> > # slimserver executable will have:<br>> > # label: system_u:object_r:slimserver_exec_t<br>> > # MLS sensitivity: s0<br>> > # MCS categories: <none><br>> ><br>> > /usr/sbin/slimserver            --<br>> > gen_context(system_u:object_r:slimserver_exec_t,s0)<br>> > /var/run/slimserver.pid<br>> > gen_context(system_u:object_r:slimserver_var_run_t,s0)<br>> > /var/log/slimserver<br>> > gen_context(system_u:object_r:slimserver_var_log_t,s0)<br>> ><br>> > and the slimserver.if file contains:<br>> >
 interface(`slimserver_domtrans',`<br>> >         gen_require(`<br>> >                 type slimserver_t, slimserver_exec_t;<br>> >         ')<br>> ><br>> >         domain_auto_trans($1,slimserver_exec_t,slimserver_t)<br>> ><br>> >         allow $1 slimserver_t:fd use;<br>> >         allow slimserver_t $1:fd use;<br>> >         allow slimserver_t $1:fifo_file rw_file_perms;<br>> >         allow slimserver_t $1:process sigchld;<br>> > ')<br>> ><br>> > 2. There is no reason to add the scanner program be added to<br>> > slimserver.fc that was generated by policygentool, is there?<br>> Only if you are creating a context for slimserver_scanner_exec_t,<br>> otherwise just let it be labeled sbin_t.<br>> > The file itself just needs to be labeled appropriately, right? Or does<br>> > that file play some role in policy compilation in a step that I did<br>> > not explicitly
 executed when I invoked 'make -f<br>> > /usr/share/selinux/devel/Makefile'?<br>> ><br>> > Thanks in advance.<br>> > -al<br>> > --<br>> > Al Pacifico<br>> > Seattle, WA<br>> > ------------------------------------------------------------------------<br>> ><br>> > --<br>> > fedora-selinux-list mailing list<br>> > fedora-selinux-list@redhat.com<br>> > https://www.redhat.com/mailman/listinfo/fedora-selinux-list<br>><br>><br><br><br>-- <br>Al Pacifico<br>Seattle, WA<br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: https://www.redhat.com/archives/fedora-selinux-list/attachments/20070424/4e25931f/attachment.html<br><br>------------------------------<br><br>--<br>fedora-selinux-list mailing list<br>fedora-selinux-list@redhat.com<br>https://www.redhat.com/mailman/listinfo/fedora-selinux-list<br><br>End of fedora-selinux-list Digest, Vol 38, Issue
 17<br>***************************************************<br></none></dwalsh@redhat.com></dwalsh@redhat.com></adpacifico@users.sourceforge.net></mike.clarkson@baesystems.com></dwalsh@redhat.com></FB39F4E77226B448BC1388D3BE4E00CD01B8E2EF@blums0008.sd.gd.com></fedora-selinux-list@redhat.com></mike.clarkson@baesystems.com></blockquote><br><p>


      

      <hr size="1"> 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur <a href="http://fr.rd.yahoo.com/evt=42054/*http://fr.answers.yahoo.com">Yahoo! Questions/Réponses</a>.