At my organization, we use a piece of software for instrumenting and monitoring our servers. Since this piece of software neither supports SELinux nor SystemD, we are currently working on improving its compatibility with CentOS/RHEL 7 by developing a SELinux policy module for it and exploring our options with SystemD.

SELinux comes first, and we need to allow this application to bind to a specific port or group of ports. Rather than simply hardcode a port that it's allowed to bind to, we'd like to follow the pattern of the reference implementation and define a mymonitoringservice_port_t and allow our running process to bind to any port with that type defined for it.

The difficulty that I'm having is that I can't seem to find how to define a port mapping type and a set of default values for it. Out of the box, the targeted policy defines the following for the httpd_port_t:

$ sudo semanage port -l | grep http_port_t
http_port_t                    tcp      80, 81, 443, 488, 8008, 8009, 8443, 9000

I did not define these default port values, but somehow the policy did. I know that I can manage these port definitions by appending to and removing from this list, but as a policy maintainer, how can I "ship" the defaults to my servers? Is there a de-facto way of defining these port lists?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.