I have an Apache httpd v2.4.57 configured on Rocky9 to connect to Tomcat9 / Java17 over a unix domain socket.
SELinux kicks in and says denied, as follows:
type=AVC msg=audit(1685376249.480:134): avc: denied { connectto } for pid=1769 comm="httpd" path="/run/tomcat-xxx2-yyy/socket" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:tomcat_t:s0 tclass=unix_stream_socket permissive=0
type=SYSCALL msg=audit(1685376249.480:134): arch=c000003e syscall=42 success=no exit=-13 a0=12 a1=7faa3403a050 a2=27 a3=727461702d746163 items=0 ppid=1767 pid=1769 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)^]ARCH=x86_64 SYSCALL=connect AUID="unset" UID="apache" GID="apache" EUID="apache" SUID="apache" FSUID="apache" EGID="apache" SGID="apache" FSGID="apache"
type=PROCTITLE msg=audit(1685376249.480:134): proctitle=2F7573722F7362696E2F6874747064002D44464F524547524F554E44002D6600636F6E662F6465766963652D6D61696E2E636F6E66
What, explicitly, must I change in the SELinux configuration, for this to work?
Do I set the context on the socket? Right now the socket context is as follows, but no luck:
[root@swordfish ~]# ls -alZ /run/tomcat-xxx2-yyy/socket
srw-rw----. 1 fma fma system_u:object_r:httpd_var_run_t:s0 0 May 29 17:56 /run/tomcat-xxx2-yyy/socket
Do I set an selinux boolean? If so, which one, and to what?