Re: Relocating mysql

Casper <[email protected]> Thu, 18 May 2023 09:14:15 +0200
Newsgroups gmane.linux.redhat.fedora.selinux
Message-ID <[email protected]>
What is the connection between httpd and mariadb server? Is it Unix
socket file? Or TCP socket?

In the case of TCP socket (port + host), it looks weird for httpd
going to read /var/lib/mysql/

Gionatan Danti a écrit :
> Hi all,
> I have a question about mysql relocation.
> 
> I already created an equivalency rule such as "semanage fcontext --list -C"
> returns the following:
> SELinux Local fcontext Equivalence
> /mnt/lv_data/var/lib/mysql = /var/lib/mysql
> 
> Then I created a symlink in /var/lib:
> system_u:object_r:mysqld_db_t:s0    26 May 17 14:39 mysql ->
> /mnt/lv_data/var/lib/mysql
> 
> However, httpd/php can not connect to the database. The following message is
> logged in audit.log:
> type=AVC msg=audit(1684352064.936:232): avc:  denied  { read } for  pid=8558
> comm="httpd" name="mysql" dev="sda4" ino=147925
> scontext=system_u:system_r:httpd_t:s0
> tcontext=system_u:object_r:mysqld_db_t:s0 tclass=lnk_file permissive=0
> 
> My understanding is that httpd can not read the symlink. I expected to find
> a boolean to allow this kind of access, to no avail.
> 
> So my question is: can I allow httpd symlink access without manually
> modifying the actual policy (ie: using audit2allow and the likes)?
> 
> Thanks.
> 
> -- 
> Danti Gionatan
> Supporto Tecnico
> Assyoma S.r.l. - www.assyoma.it
> email: [email protected] - [email protected]
> GPG public key ID: FF5F32A8
> _______________________________________________
> selinux mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: https://lists.fedoraproject.org/archives/list/[email protected]
> Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue

-- 
GnuPG: AE157E0B29F0BEF2 at keys.openpgp.org
CA Cert: https://dl.casperlefantom.net/pub/ssl/root.der
Jabber/XMPP Messaging: [email protected]

_______________________________________________
selinux mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
signature.asc (application/pgp-signature, 870 B)
-----BEGIN PGP SIGNATURE-----

iQJOBAEBCAA4FiEEcNWpsYTrRfLHoxirrhV+CynwvvIFAmRl0EIaGGh0dHBzOi8v
a2V5cy5vcGVucGdwLm9yZy8ACgkQrhV+CynwvvLRaw//Qku2MC6voG//gtdZJ+2u
Q2+f9T82VoCpOnKVrEDrMCNNffKw+OwmztNiOUoLORFAl8Ho1Yaha+4AOLtL2Ssm
vEgKGHQgieF1gjO6q755vlG7N37tjJp1GugUsf/R825StmEIrEfSbq2+ciLo/HKy
HTj8UxfAMIi3jpM0B+duKdTX3z1+uWcAoZlZxCRI8et/FUyR+JbxshLDkchImo35
luNqywgApeSk6QccFTOrD5M/GCd2B3QJXzXu/3OYfFthMStMqLAQs82GVaRsciEK
PnhdivaVTZWGrSEJDiKqwqYVp6ek9c53fFCEtAliF1xQNLU7ohRqQ0UKZzg9RiQi
gcYQh1p7Y1nKK3RMeuNBFa3zVT6EoDNRlXZ52hKbxVnyadJFQvIjbdoyqjt7Ej1F
qZ69KjCNc6Gp7UZI1VEgRBjdjhqCkD17k9QYeO96pkzEoCPkVdcbT7UBZ2Vf+xhu
xgnAHWmEj8eU7GsQYHMOyp6BJASAdwK2CN/n4bh1xGCVjeQstyTmbI1uDr81pLGh
L7kyKQLxQPzag2jRfUDXryXFM44vJlV68rCyahJrepkZKmwvgUc2Di0j+iRmZzYI
E9+vBFSeF4HBAtPz0fjaoml/pJ2lHGyX2mm0mzeXfgDIOrKHjPFTqRzFsVqXn0P3
RFrcTYX2esDdChQ5px1WEKw=
=jd2R
-----END PGP SIGNATURE-----