{"id":181,"date":"2006-09-22T10:08:30","date_gmt":"2006-09-22T10:08:30","guid":{"rendered":"http:\/\/dhoytt.com\/mainblog\/2006\/09\/22\/selinux-selinux-policy-setting\/"},"modified":"2006-09-22T10:08:30","modified_gmt":"2006-09-22T10:08:30","slug":"selinux-selinux-policy-setting","status":"publish","type":"post","link":"http:\/\/dhoytt.com\/mainblog\/2006\/09\/selinux-selinux-policy-setting\/","title":{"rendered":"SELinux SELinux Policy Settings HTTP Requests From Fedora 5 Web Server"},"content":{"rendered":"<p class=\"MsoNormal\">&nbsp;<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:.5in\">I\u2019m trying to live with the<br \/>\nbenefits of <b>SELinux <\/b>instead of disabling it every time I discover find it<br \/>\ndisallows the action I\u2019m trying. I am testing a demo version of an application<br \/>\nI\u2019m thinking about using on my <b>Radio Blog <\/b>that allows users to make<br \/>\nrequests and dedications. I\u2019m testing it on one of my other Linux backup systems<br \/>\nnot published to the public of course.<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:.5in\">&nbsp;Oh today I don\u2019t feel like using<br \/>\nspecific ports and application names since I don\u2019t know if I will used the<br \/>\napplication. I still have a bit more testing and configuring to do with this<br \/>\napplication.<\/p>\n<p class=\"MsoNormal\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The requests mechanism is <b>HTTP<\/b> generated<br \/>\nand uses a specific port. Well using <b>Webmin<\/b> tool I believe I successfully<br \/>\nadded a rule allowing for this port to be accessed. The issue now that I\u2019m<br \/>\nwriting about it may be in the functions of the application itself.<\/p>\n<p class=\"MsoNormal\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A bit of background: The application runs on<br \/>\nWindows with a <b>MySQL<\/b> database instance on that Windows system. I have<br \/>\nanother <b>MySQL<\/b> database instance running on my Linux web server system<br \/>\nthat gets the updates via a utility from the other <b>MySQL<\/b> instance on the<br \/>\nWindows system. That works fine and the information on the two <b>MySQL<\/b><br \/>\ninstances is identical and my Linux web server can access its local <b>MySQL<\/b><br \/>\ninstance to draw its information to run the website. I also have some <b>PHP<\/b><br \/>\nfiles I ftp\u2019d over to my Linux system that runs my<b> PHP<\/b> generated web site<br \/>\nand performs various functions such as the <b>HTTP<\/b> requests and dedications.<\/p>\n<p class=\"MsoNormal\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The request and dedications via<b> HTTP<\/b> are<br \/>\nthe issue here and wait to be received via<b> \u201cthe request line port\u201d<\/b> on my<br \/>\nWindows server that runs the application. Well I kept getting permission denied<br \/>\nerrors when trying to make requests. I confirmed that this port was open on my<br \/>\nrouter, that it showed with \u201cnetstat\u201d as listening on that port on the Windows<br \/>\nsystem waiting to hear the request. I was even able to successfully telnet to <b><br \/>\n\u201cthe request line port\u201d<\/b> on that system. I then went and looked at where the<br \/>\nrequest would be coming from, my Linux Web Server, and insured it had<br \/>\npermissions in the allow file of the application from the LAN (both NIC\u2019s) and<br \/>\nthe WAN. The WAN I knew worked since the alternative method of asking for<br \/>\nrequest worked fine from another source on the WAN.<\/p>\n<p class=\"MsoNormal\">&nbsp;<\/p>\n<p class=\"MsoNormal\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; So now the issue was what is blocking the<br \/>\nrequests from my Linux system! Well I started looking around and of course the<br \/>\nrequests go through just fine with <b>SELinux<\/b> in permissive mode or<br \/>\ndisabled. I had the <b>\u201cthe request line port\u201d<\/b> enabled but then I started<br \/>\nthinking what if the request which are handled via a PHP file aren\u2019t going out<br \/>\nvia <b>\u201cthe request line port\u201d<\/b>! <\/p>\n<p class=\"MsoNormal\" style=\"text-indent:.5in\">Plus the fact that the <b><br \/>\n\u201csystem-config-securitylevel\u201d<\/b> utility didn\u2019t allow me to add that port the<br \/>\nsame way I added the port for MySQL. I believe this is because that port is not<br \/>\nlistening or running any application on my Linux server and mysql is running on<br \/>\nmy Linux system.<\/p>\n<p class=\"MsoNormal\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; So now I\u2019m completely up against it I cannot<br \/>\nadd the port and the policies I added in <b>SELinux<\/b> via Webmin for that <b><br \/>\n\u201cthe request line port\u201d<\/b> is not having any affect. Then considering that the<br \/>\n<b>\u201cthe request line port\u201d<\/b> may not be applicable from my Linux web server<br \/>\nand using a totally different port I started looking at the other <b>SELinux<\/b><br \/>\npolicy settings in the <b>\u201csystem-config-securitylevel\u201d<\/b> utility. &nbsp;Since this<br \/>\nwas an <b>HTTP<\/b> request looked in the <b>\u201cHTTPD Service\u201d<\/b> section where I<br \/>\nchecked <b>\u201cAllow HTTPD scripts and modules to connect to the network\u201d<\/b> and<br \/>\nnow all my requests work!<\/p>\n<p class=\"MsoNormal\">&nbsp;<\/p>\n<p class=\"MsoNormal\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; What does this mean? The PHP requests may go to<br \/>\n<b>\u201cthe request line port\u201d<\/b> the Windows system where the application resides<br \/>\nbut from the requesting system which will always be where the web server resides<br \/>\nit doesn\u2019t use the <b>\u201cthe request line port\u201d<\/b>. In the <b>SELinux<\/b> policy<br \/>\nsettings I have to I checked <b>\u201cAllow HTTPD scripts and modules to connect to<br \/>\nthe network\u201d<\/b> to allow request to propagate from the Linux web server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; I\u2019m trying to live with the benefits of SELinux instead of disabling it every time I discover find it disallows the action I\u2019m trying. I am testing a demo version of an application I\u2019m thinking about using on my &hellip; <a href=\"http:\/\/dhoytt.com\/mainblog\/2006\/09\/selinux-selinux-policy-setting\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"wprm-recipe-roundup-name":"","wprm-recipe-roundup-description":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-181","post","type-post","status-publish","format-standard","hentry","category-whole-site-development"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/comments?post=181"}],"version-history":[{"count":0,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/posts\/181\/revisions"}],"wp:attachment":[{"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/media?parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/categories?post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dhoytt.com\/mainblog\/wp-json\/wp\/v2\/tags?post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}