-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issues when the host is running SELinux #12
Comments
Interesting, thanks! I'm not using SELinux on my machine so I never saw this. Would you like to add a paragraph to the README, to explain that if you get this error with SELinux, then you might need to set permissive mode and explain how? |
Dan Walsh will probably cringe hearing that 😄 There's a WIP documentation for working with SELinux and Docker; moby/moby#11396 There are some hints and links from Dan in there that may help trying to solve this in an "approved" way. I'm no SELinux expert myself, but perhaps it's useful. (Don't want to "ping" Dan for each SELinux question, but he's quite helpful) |
Hi, I revisited this today. The specific selinux error is 'execmod' was denied for the squid3 binary. The following policy fixes this (but it's quite a wide additional permission and a better policy can probably be crafted)
(install with However, for my own purposes I solved this by rebasing on RHEL, which doesn't seem to trigger the same problem (CentOS is probably OK too, haven't tried): https://github.com/jmtd/squid-in-a-can/tree/rhel |
Thanks for reporting your findings! I'll close this issue, and I hope that if others have a similar problem, they'll be able to find it along with your solution :-) |
I know this issue is long closed but I think there is a better answer for it. I believe this issue is that the stock squid image contains text relocations. Selinux configurations consider that this is a programming error and block it with the execmod option. execmod can prevent certain types of exploit and is worth having enabled. This can be fixed in squid with -fPIC like the patch centos uses when compiling squid: You can test a binary for text relocations like so: readelf -d squid | fgrep TEXTREL Rather than disable this security protection in selinux, it may be preferable to compile squid in a way which allows it to take advantage of the security mechanisms selinux provides. |
@jamorham: excellent investigation, thanks for finding this out! I'm not maintaining this image anymore, but if someone wants to submit a PR (e.g. to switch to CentOS or any other build that avoids text relocations) or even take over maintenance, I'll be happy to help. |
Not advocating SELinux here, but
Setting permissive mode on the host let's the container start up.
The text was updated successfully, but these errors were encountered: