Oops, sorry,<div><br></div><div>Is this what you want?</div><div><br></div><div>#</div><div><div>policy_module(couchdb, 1.0.0)</div><div><br></div><div>########################################</div><div>#</div><div># Declarations</div>
<div>#</div><div><br></div><div>permissive couchdb_t;</div><div><br></div><div>type couchdb_t;</div><div>type couchdb_exec_t;</div><div>init_daemon_domain(couchdb_t, couchdb_exec_t)</div><div><br></div><div>type couchdb_initrc_exec_t;</div>
<div>init_script_file(couchdb_initrc_exec_t)</div><div><br></div><div>type couchdb_etc_t;</div><div>files_config_file(couchdb_etc_t)</div><div><br></div><div>type couchdb_tmp_t;</div><div>files_tmp_file(couchdb_tmp_t)</div>
<div><br></div><div>type couchdb_var_lib_t;</div><div>files_type(couchdb_var_lib_t)</div><div><br></div><div>type couchdb_var_log_t;</div><div>logging_log_file(couchdb_var_log_t)</div><div><br></div><div>type couchdb_var_run_t;</div>
<div>files_pid_file(couchdb_var_run_t)</div><div><br></div><div>########################################</div><div>#</div><div># Local policy</div><div>#</div><div><br></div><div>allow couchdb_t self:process { setsched signal signull sigkill };</div>
<div>allow couchdb_t self:fifo_file rw_fifo_file_perms;</div><div>allow couchdb_t self:tcp_socket create_stream_socket_perms;</div><div>allow couchdb_t self:udp_socket create_socket_perms;</div><div><br></div><div>allow couchdb_t couchdb_etc_t:dir list_dir_perms;</div>
<div>read_files_pattern(couchdb_t, couchdb_etc_t, couchdb_etc_t)</div><div><br></div><div>manage_files_pattern(couchdb_t, couchdb_tmp_t, couchdb_tmp_t)</div><div>files_tmp_filetrans(couchdb_t, couchdb_tmp_t, file)</div><div>
<br></div><div>manage_dirs_pattern(couchdb_t, couchdb_var_lib_t, couchdb_var_lib_t)</div><div>manage_files_pattern(couchdb_t, couchdb_var_lib_t, couchdb_var_lib_t)</div><div><br></div><div>create_files_pattern(couchdb_t, couchdb_var_log_t, couchdb_var_log_t)</div>
<div>append_files_pattern(couchdb_t, couchdb_var_log_t, couchdb_var_log_t)</div><div><br></div><div>manage_files_pattern(couchdb_t, couchdb_var_run_t, couchdb_var_run_t)</div><div><br></div><div>can_exec(couchdb_t, couchdb_exec_t)</div>
<div><br></div><div>kernel_read_system_state(couchdb_t)</div><div><br></div><div># 5984</div><div>corenet_sendrecv_vnc_server_packets(couchdb_t)</div><div>corenet_tcp_bind_generic_node(couchdb_t)</div><div>corenet_tcp_bind_vnc_port(couchdb_t)</div>
<div>corenet_tcp_sendrecv_vnc_port(couchdb_t)</div><div>corenet_udp_bind_generic_node(couchdb_t)</div><div><br></div><div># basename, /usr/lib/erlang/erts-5.8.3/bin/erl</div><div>corecmd_exec_bin(couchdb_t)</div><div>corecmd_exec_shell(couchdb_t)</div>
<div><br></div><div>dev_read_sysfs(couchdb_t)</div><div>dev_read_urand(couchdb_t)</div><div><br></div><div># /usr/share/couchdb/www/index.html</div><div>files_read_usr_files(couchdb_t)</div><div><br></div><div># /</div><div>
fs_getattr_xattr_fs(couchdb_t)</div><div><br></div><div>miscfiles_read_localization(couchdb_t)</div><div><br></div><div>optional_policy(`</div><div><span class="Apple-tab-span" style="white-space:pre">        </span># /usr/lib/erlang/erts-5.8.3/bin/beam.smp</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>execmem_exec(couchdb_t)</div><div>&#39;)</div><br><div class="gmail_quote">On Tue, Mar 13, 2012 at 10:07 PM, Daniel J Walsh <span dir="ltr">&lt;<a href="mailto:dwalsh@redhat.com">dwalsh@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
</div><div class="im">On 03/13/2012 10:04 AM, Michael Milverton wrote:<br>
&gt; Thanks Dan,<br>
&gt;<br>
&gt; I don&#39;t have access to Fedora 17 at the moment so I can&#39;t test it<br>
&gt; but I will write a small python script this weekend so you can test<br>
&gt; it if you like. My feeling is that it  won&#39;t work properly like it<br>
&gt; is because the fc file doesn&#39;t include couchjs, the JavaScript<br>
&gt; compiler. I think that was the main issue I had if I remember<br>
&gt; correctly.<br>
&gt;<br>
&gt; Could you test the policy I attached as that seemed to work on<br>
&gt; Fedora 15 or is it too outdated? It was for couchdb 1.0.2.<br>
&gt;<br>
&gt; P.S If you can wait a couple of weeks I should be able to get<br>
&gt; Fedora 17 running. It takes time because I have limited bandwidth<br>
&gt; (wireless) at the moment.<br>
&gt;<br>
&gt; Thanks Michael<br>
&gt;<br>
&gt; On 12/03/2012, at 21:54, Daniel J Walsh &lt;<a href="mailto:dwalsh@redhat.com">dwalsh@redhat.com</a>&gt; wrote:<br>
&gt;<br>
</div><div class="im">&gt; I wrote my own policy for couchdb using sepolgen for Fedora 17.<br>
&gt;<br>
&gt; Totally untested, since I have no idea how to use couchdb.<br>
&gt;<br>
&gt; Fixed avc&#39;s created by starting and stopping the service.<br>
&gt;<br>
&gt; ps -eZ | grep couch system_u:system_r:couchdb_t:s0   4103 ?<br>
&gt; 00:00:00 couchdb system_u:system_r:couchdb_t:s0   4113 ?<br>
&gt; 00:00:00 couchdb system_u:system_r:couchdb_t:s0   4114 ?<br>
&gt; 00:00:00 beam.smp system_u:system_r:couchdb_t:s0   4130 ?<br>
&gt; 00:00:00 heart<br>
&gt;<br>
&gt; Might want to write separate polciy for heart?  beam.smp?<br>
&gt;<br>
&gt; I added port definitions for tcp port couchdb_port_t 5984 and<br>
&gt; 6984.<br>
</div>&gt;&gt; &lt;couchdb.te&gt; &lt;couchdb.if&gt; &lt;couchdb.fc&gt; &lt;couchdb.sh&gt;<br>
<div class="im">&gt; -- selinux mailing list <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>The policy you attached did not include any allow rules.  Could you<br>
mail me the original source, te file.<br>
<div class="im">-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.12 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org/" target="_blank">http://enigmail.mozdev.org/</a><br>
<br>
</div>iEYEARECAAYFAk9fVKEACgkQrlYvE4MpobOUEgCg296xb2E45lvFOO4kS1vYDq44<br>
hJsAn0A5YF19vItKoLibqKUG7mZm6FZi<br>
=LrXW<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div><br></div>