问题原文
原帖链接 · Noodles · CC BY-SA 4.0
We have rsyncd running as a daemon on our frontend web servers. We push web app updates out via rsync.
We're looking at cutting down the noise in auditd and fixing up some of the issues from SELinux (so one day we can turn it on properly).
At the moment we get the following messages when running rsync:
type=AVC msg=audit(1580772908.749:172148): avc: denied { write } for pid=33806 comm="rsync" path="/public_html/docs/cg/html/1/.file.html.o9GVX9" dev="sda3" ino=37341 scontext=system_u:system_r:rsync_t:s0-s0:c0.c1023 tcontext=system_u:object_r:httpd_user_content_t:s0 tclass=file permissive=1
How can I allow rsync to write to these files with SELinux?
已采纳解答
原帖链接 · shodanshok · CC BY-SA 4.0
You have different choices; from easier (but more coarse) to harder (but more specific):
setsebool -P rsync_full_access 1: grant rsync full filesystem access;- change your
httpdfile context topublic_content_rw_t; - write a specific selinux policy patch via
cat audit.log | audit2allow.
Finally, you can also set rsyncd in permissive mode issuing semanage permissive -a rsync_t, but I strongly suggest avoiding that (not last because it does not get rid of selinux audit logs).
I would use the first solution, as changing a selinux boolean is the least invasive, but more obvious and immediate change.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
