Re:Stop Disabling SELinux: A Real-World Guide
by obelix150 on Thursday February 02, 2017 @08:10AM
(#13550240)
"audit2allow -a" or "audit2why" will tell you what the reason for a denial is and potentially how to fix it. Pretty sure it will tell you to run setsebool to allow httpd_can_network_connect in this instance.
Re:Stop Disabling SELinux: A Real-World Guide
by snuxoll on Thursday February 02, 2017 @11:25AM
(#13551713)
audit2allow is the single greatest tool I've ever used for dealing with SELinux, people need to hear it's name sung from the mountains.
I actually write SELinux policies for software I develop, first thing I do is put them in the most restrictive context imaginable with no permissions, set SELinux in permissive mode and run the application through it's paces, at the end run audit2allow and there's 90% of the work done for you outside of defining fcontext's.
Re:Stop Disabling SELinux: A Real-World Guide
by blockoperation on Thursday February 02, 2017 @12:24PM
(#13552317)
It must be used with care though, otherwise you'll end up with so many holes in your policy that you defeat whole point of using SELinux in the first place. Definitely don't use the output directly.
Re:Stop Disabling SELinux: A Real-World Guide
by snuxoll on Thursday February 02, 2017 @12:26PM
(#13552348)
Certainly not, but it's a great first step.
Re:Stop Disabling SELinux: A Real-World Guide
by s_kilk on Thursday February 02, 2017 @11:43AM
(#13551906)
This is doubly annoying when you're on a fresh install of some distro (in my case, Fedora) and it just starts whinging about files and services you've never heard of, before I've had a chance to do anything with the system.
"This service did the bad thing, supposedly", ok, so what am I supposed to do with that? Is the service at fault? or is the default SElinux config borked? or both?
If the answer is actually "no that's fine", then why am I being alerted about it?
Re:Stop Disabling SELinux: A Real-World Guide
by lima on Thursday February 02, 2017 @10:00AM
(#13550923)
This is exactly why setroubleshootd exists. It literally does what you suggest :-)
Re:Stop Disabling SELinux: A Real-World Guide
by reitanqild on Thursday February 02, 2017 @09:59AM
(#13550910)
Learning .Net now and this is one of the things that that I like about it: sometimes the error messages is a lot clearer and sometimes they include suggested solutions.
I think one reason security programs are sometime ineffective and end up being disabled is that they give problems to developers and sysadmin but no solutions.
I wish that rather than messages like "doesn't work - too bad", these programs would output a solution as well, such as "consider setting `httpd_can_network_connect` to `true` to allow it".
In some cases it might be tricky to propose a solution, in which case even a link to the doc would be useful like "check http://example.com/doc#456 for more information". That would go a long way towards making security software issues less of a pain for those who aren't expert in the topic.