Description of problem: Running rsyncd that serves an automounted nfs directory. I get: type=AVC msg=audit(1354228225.755:130885): avc: denied { search } for pid=5424 comm="rsync" name="/" dev=autofs ino=12652 scontext=system_u:system_r:rsync_t:s0-s0:c0.c1023 tcontext=system_u:object_r:autofs_t:s0 tclass=dir Version-Release number of selected component (if applicable): selinux-policy-3.7.19-155.el6_3.8.noarch rsync_use_nfs is on.
Also, how do I get it to be able to write to the nfs directory? type=AVC msg=audit(1354230531.020:131120): avc: denied { write } for pid=6958 comm="rsync" name="METEORS" dev=0:1c ino=251527171 scontext=system_u:system_r:rsync_t:s0-s0:c0.c1023 tcontext=system_u:object_r:nfs_t:s0 tclass=dir allow_rsync_anon_write --> on rsync_client --> off rsync_export_all_ro --> off rsync_use_cifs --> off rsync_use_nfs --> on I tried turning on allow_rsync_anon_write but that didn't help.
Eventually needed to add exceptions for: module rsync-server 1.0; require { type autofs_t; type rsync_t; type nfs_t; class file create; class dir { write search add_name }; } #============= rsync_t ============== #!!!! This avc can be allowed using the boolean 'rsync_export_all_ro' allow rsync_t autofs_t:dir search; #!!!! This avc is allowed in the current policy allow rsync_t nfs_t:dir { write search add_name }; #!!!! This avc is allowed in the current policy allow rsync_t nfs_t:file create;
I made rsync as userdom_home_manager to fix these issues. Will backport.
(In reply to comment #4) > I made rsync as userdom_home_manager to fix these issues. I meant in Fedora.
I eventually had to disable dontaudit rules to be able to see: type=AVC msg=audit(1354294154.636:548): avc: denied { write } for pid=14828 comm="rsync" name=".blah.cp9LNd" dev=0:21 ino=580976863 scontext=system_u:system_r:rsync_t:s0-s0:c0.c1023 tcontext=system_u:object_r:nfs_t:s0 tclass=file module rsync-server 1.0; require { type autofs_t; type rsync_t; type nfs_t; class file { write rename create unlink setattr }; class dir { write search setattr remove_name create add_name }; } #============= rsync_t ============== #!!!! This avc is allowed in the current policy allow rsync_t autofs_t:dir search; #!!!! This avc is allowed in the current policy allow rsync_t nfs_t:dir { write search setattr remove_name create add_name }; allow rsync_t nfs_t:file write; #!!!! This avc is allowed in the current policy allow rsync_t nfs_t:file { rename create unlink setattr };
Yes, it will be covered by new rules.
Looks good to me. Thanks!
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0314.html