Re: Is my SELinux configuration wrong and dangerous?
mailist <[email protected]>
| Newsgroups | gmane.linux.redhat.fedora.selinux |
|---|---|
| Message-ID | <[email protected]> |
Hi Jason, 1. Well just turning on your computer can lead to it beeing hacked... Just remember SELinux is a part of the kernel with some policies defined. You are the one making the rules but by default everything is denied. (fyi would recommend you going through this https://people.redhat.com/duffy/selinux/selinux-coloring-book_A4-Stapled.pdf it is really well explained). well httpd_sys_r_content_r allow only read only access weither httpd_sys_rw_content_t allows also write. What is dangerous is the write one beeing defined everywhere (like in any systems). You can mix both, on the files that wordpress should write:httpd_sys_rw_content_t and the rest httpd_sys_r_content_t. 2. this command is setting a boolean to on that allows any programs under the httpd context to communicate over the internet (yes SELinux controls everything). So as a resume, nothing is either white or black but rather a mix of the 2. And btw if you are really preoccupied about security as a whole just throw away wordpress (or run it as a static website (for example with gaby). Vincent On 9/19/20 11:56 PM, Jason Long wrote: > Hello, > I'm using CentOS 8 as a web server that hosting a WordPress website. I > have two questions. > 1- I defined SELinux for WordPress directory as below: > > # ls -lZ /var/www/ > drwxrwxr-x. 7 apache apache > unconfined_u:object_r:httpd_sys_rw_content_t:s0 4096 Sep 19 23:37 wp > > I created an account for a remote developer that working on WordPress. > On some websites, I saw that the OK permission for > wp directory is "httpd_sys_r_content_t" and not "httpd_sys_rw_content_t" > and someone recommended to back permission via below command: > > # restorecon -rv /var/www/wp > > Is it true? Is "httpd_sys_rw_content_t" a dangerous permission and can > lead to hacking? > > 2- WordPress can't update and showed me "cURL Error (7): couldn't > connect to host" error. I did below command to solve it: > > # setsebool -P httpd_can_network_connect on > > Can this command make Apache insecure and must I turn it to "off" ? > > > Thank you. > > _______________________________________________ > 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] > _______________________________________________ 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]
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEPQQnGFnXxW3e4qocB5HiAjiO2sYFAl9mhpwACgkQB5HiAjiO 2sZveA//Ti6dHbU9M/iDNkXGEVX9yaYUsEXvmU2b6b0ol9eNHvDhbX57M5CfqCFO OpzQJviNa/55msZhn/ajbc0Rb1RqbSQxIEIG0bzV368++hodi8SIyZ2ZSC0ZcH4y FPEfZCOLkyIu8K84WI+GaNvFKi6vRiAq+Q/Al6Ga4llIO66mbISK7iAvAN+o3DVg gjgdbjqqC5EnzV90Kvkznk1Y5FklldCoXYYDd00DyALSpHgl5p8CEsne8xlyJxEB T66BbFkJ3yMEyHHxFyUueYz5EMHNpA2vlvL73/reeUGbPXkQXV6KepKOuyrYiCvO y9/wn4/kYCLNxsH3Hc+OP8UtMZ4Q64Na7M1k69QoZc6Duc0vjieezc7wiV+F6Eap W5IDFbM6tMBmOnX0GlX/TozHNioPEHcU5g+7LeFkZnviMSuFLrrmxOF3DIV7icX8 99rLHSENMJakEdtbanwblZmj0sXbyyz5+TrH4efDRJXgEaG3o1cAdcKWcDLv3oEl g7Jpo80JplVwlfv9qOz+EMutDQzOXpB3m5dvy2wqOmSeHG5FFeJP8iCQeqDDgcLJ G5+y9g2DRb8mVF2jEehkp/gV9JaOCk03C58uUB2zijQkXXjoU+WzIlRFSYMosOON K9rRra3BjLAwRa8pc0ToeX91PFxOIJDknK7Zk6H0cyx/bZWPiLw= =W6tI -----END PGP SIGNATURE-----