I just only want to give permissions for the files that are used. The java application is a server that might be compromised, so if an attacker gains permissions to run arbitrary code, or to read arbitrary files, the  usr_t type files can provide information about the system, so I think that it is not recommendable grant access to all usr_t type files.<br>
<br><div class="gmail_quote">2010/7/15 Dominick Grift <span dir="ltr">&lt;<a href="mailto:domg472@gmail.com">domg472@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thu, Jul 15, 2010 at 12:10:18PM +0200, giovanni testing wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;ve fixed it (thanks to &quot;/sbin/ausearch -i | grep nano | grep avc&quot;), and<br>
&gt; the allow lines needed are:<br>
&gt;<br>
&gt; allow MyPolicy_t bin_t:file entrypoint;<br>
&gt; allow MyPolicy_t usr_t:file { read open };<br>
<br>
</div>corecmd_bin_entry_type(MyPolicy_t)<br>
files_read_usr_files(MyPolicy_t)<br>
<div class="im"><br>
&gt;<br>
&gt; I think that the second one is not appropiated, because MyPolicy now can<br>
&gt; access to every &quot;usr_t&quot; file (but is only needed to access to<br>
&gt; &quot;/usr/share/terminfo/x/xterm&quot;).<br>
<br>
</div>What is the problem with it? Do you have any special reason for now wanting to allow it to read usr_t files?<br>
<div class="im"><br>
&gt; To fix that, I&#39;m thinking in a solution that I don&#39;t know if is possible:<br>
&gt; label the file &quot;/usr/share/terminfo/x/xterm&quot; with &quot;xterm_t&quot; instead of<br>
&gt; &quot;usr_t&quot;, but maybe it can block other applications to use<br>
&gt; &quot;/usr/share/terminfo/x/xterm&quot;, so the &quot;xterm_t&quot; needs to be equivalent to<br>
&gt; &quot;usr_t&quot;. To do it I&#39;m thinking to use an alias, but if is bidirectional it<br>
&gt; will be insecure again. As these lines can seem a bit confusing, there is a<br>
&gt; little scheme:<br>
&gt;<br>
&gt; I need:<br>
&gt; - &quot;MyPolicy_t&quot; can use &quot;xterm_t&quot;<br>
&gt; - &quot;MyPolicy_t&quot; cannot &quot;usr_t&quot;<br>
&gt; - Other policies continue being able to use &quot;/usr/share/terminfo/x/xterm&quot;<br>
&gt; while they allow use &quot;usr_t&quot; and they have not specified to allow &quot;xterm_t&quot;.<br>
&gt;<br>
&gt; So accessing to &quot;usr_t&quot; needs to be able to access to &quot;xterm_t&quot;, but<br>
&gt; accessing to &quot;xterm_t&quot; not needs to be able to access to &quot;usr_t&quot; (this is<br>
&gt; what I say that it not needs to be bidirectional). Maybe it can be done that<br>
&gt; way (putting the following lines instead the two before):<br>
&gt;<br>
&gt; allow MyPolicy_t bin_t:file entrypoint;<br>
&gt; allow usr_t xterm_t:file manage_file_perms;<br>
&gt; allow MyPolicy_t xterm_t:file { read open };<br>
<br>
</div>usr_t is a file type. file_types cannot be a source of an interacting.<br>
<br>
Again, what security benefit does labeling /usr/share/terminfo/x/xterm type xterm_t provide? What is so important that you do not want MyPolicy_t to be able to read files with type etc_t?<br>
<br>
If you really want to do it then just label it that type and give everything that needs to be able to interact with it the permissions they need.<br>
<div class="im"><br>
&gt; 2010/7/14 Stephen Smalley &lt;<a href="mailto:sds@tycho.nsa.gov">sds@tycho.nsa.gov</a>&gt;<br>
&gt;<br>
&gt; &gt; On Wed, 2010-07-14 at 17:47 +0200, giovanni testing wrote:<br>
&gt; &gt; &gt; Thank you for reply so fast.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; I&#39;m trying runcon but throws &quot;Permission denied&quot; and no AVC appears (I<br>
&gt; &gt; &gt; dont know how to fix it).<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; This happens when applying the command &quot;runcon -t MyPolicy_t<br>
&gt; &gt; &gt; nano&quot; (nano is executed to make easier the task of probe the file<br>
&gt; &gt; &gt; permissions of the policy (try to open files of MyPolicy and verify<br>
&gt; &gt; &gt; that they are read only, read and write or no accessible)).<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; What should I do to fix it?<br>
&gt; &gt;<br>
&gt; &gt; Post your .te file.<br>
&gt; &gt; Also, run:<br>
&gt; &gt; /sbin/ausearch -i | grep nano<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Stephen Smalley<br>
&gt; &gt; National Security Agency<br>
&gt; &gt;<br>
&gt; &gt;<br>
<br>
</div><div><div></div><div class="h5">&gt; --<br>
&gt; selinux mailing list<br>
&gt; <a href="mailto:selinux@lists.fedoraproject.org">selinux@lists.fedoraproject.org</a><br>
&gt; <a href="https://admin.fedoraproject.org/mailman/listinfo/selinux" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/selinux</a><br>
<br>
</div></div><br>--<br>
selinux mailing list<br>
<a href="mailto:selinux@lists.fedoraproject.org">selinux@lists.fedoraproject.org</a><br>
<a href="https://admin.fedoraproject.org/mailman/listinfo/selinux" target="_blank">https://admin.fedoraproject.org/mailman/listinfo/selinux</a><br></blockquote></div><br>