Is there a way in SELinux to force linux to allow a program to be able to bind to a port number lower than 1024.
feedback
|
|
Run it as root or | |||||||||||||
feedback
|
|
Assuming you have a proper policy module for the application (let's call your app "foo") in place, you can do one of two things. You either define a
and the use something like this to label the actual port
This will claim TCP port 803 for your application. Most ports below 1023 already have labels on them though and you cannot label a port, file, whatever multiple times. So option two: you can allow your app to bind to a port that has a different label, by putting lines like this into your policy module:
This would allow you app to bind to any port that has
| |||
|
feedback
|
|
It is not SELinux that does not allow your program to bind on privileged ports, it is the Linux kernel. You can do a port forwarding from the desired port to an unprivileged port and run the application on an unprivileged port. This is secure and allowed by SELinux. | |||
|
feedback
|
|
In our shop and experience, we have found it best to disable SELinux. I know that some people have found it useful but we have not. We disable the entire thing in /etc/sysconfig/selinux (or /etc/selinux/config) with SELINUX=disabled The problems we have had regarding SELinux have been so numerous and caused so many extra hours that it is just not worth it. | |||
|
feedback
|