[PATCH] Added SElinux module for running syslog-ng on RHEL5.
Here's a small patch adding a small SElinux module that makes it possible to run syslog-ng on RHEL5 with SElinux in default enforcing mode. --- contrib/rhel-packaging/syslog_ng.te | 20 ++++++++++++++++++++ contrib/rhel-packaging/syslog_ng.te.README | 14 ++++++++++++++ 2 files changed, 34 insertions(+), 0 deletions(-) create mode 100644 contrib/rhel-packaging/syslog_ng.te create mode 100644 contrib/rhel-packaging/syslog_ng.te.README diff --git a/contrib/rhel-packaging/syslog_ng.te b/contrib/rhel-packaging/syslog_ng.te new file mode 100644 index 0000000..449756c --- /dev/null +++ b/contrib/rhel-packaging/syslog_ng.te @@ -0,0 +1,20 @@ +module syslog_ng 1.0; + +require { + class sock_file { getattr unlink }; + class tcp_socket { create bind setopt name_bind node_bind listen }; + class dir { write add_name }; + class file { create write getattr read }; + type device_t; + type syslogd_t; + type rsh_port_t; + type inaddr_any_node_t; + type var_t; +}; + +allow syslogd_t device_t:sock_file { getattr unlink }; +allow syslogd_t rsh_port_t:tcp_socket name_bind; +allow syslogd_t inaddr_any_node_t:tcp_socket node_bind; +allow syslogd_t self:tcp_socket { create listen bind setopt }; +allow syslogd_t var_t:dir { write add_name }; +allow syslogd_t var_t:file { create write getattr read }; diff --git a/contrib/rhel-packaging/syslog_ng.te.README b/contrib/rhel-packaging/syslog_ng.te.README new file mode 100644 index 0000000..df316a1 --- /dev/null +++ b/contrib/rhel-packaging/syslog_ng.te.README @@ -0,0 +1,14 @@ +"syslog_ng.te" is the necessary selinux module to allow syslog-ng +running on RHEL5 (with selinux in default enforcing mode). It's +necessary for up for letting the syslogd_t domain access /proc/kmsg, +listen on 514/tcp and write /var/syslog-ng.persist. + +To build and load it, execute: + + checkmodule -M -m -o syslog_ng.mod syslog_ng.te + semodule_package -o syslog_ng.pp -m syslog_ng.mod + semodule -i ./syslog_ng.pp + +The module can be removed from the system by executing: + + semodule --remove=syslog_ng -- 1.5.1
On Sun, 2007-05-20 at 16:45 +0200, Jan-Frode Myklebust wrote:
Here's a small patch adding a small SElinux module that makes it possible to run syslog-ng on RHEL5 with SElinux in default enforcing mode.
Thanks for your contribution.
diff --git a/contrib/rhel-packaging/syslog_ng.te.README b/contrib/rhel-packaging/syslog_ng.te.README new file mode 100644 index 0000000..df316a1 --- /dev/null +++ b/contrib/rhel-packaging/syslog_ng.te.README @@ -0,0 +1,14 @@ +"syslog_ng.te" is the necessary selinux module to allow syslog-ng +running on RHEL5 (with selinux in default enforcing mode). It's +necessary for up for letting the syslogd_t domain access /proc/kmsg, +listen on 514/tcp and write /var/syslog-ng.persist.
/var/syslog-ng.persist should rather be created in /var/lib/syslog-ng/syslog-ng.persist. It's a packaging problem if it isn't. (previously no files were used in localstatedir, that's the reason it is unspecified in packaging files).
+ +To build and load it, execute: + + checkmodule -M -m -o syslog_ng.mod syslog_ng.te + semodule_package -o syslog_ng.pp -m syslog_ng.mod + semodule -i ./syslog_ng.pp + +The module can be removed from the system by executing: + + semodule --remove=syslog_ng
-- Bazsi
On Sun, 2007-05-20 at 16:45 +0200, Jan-Frode Myklebust wrote:
Here's a small patch adding a small SElinux module that makes it possible to run syslog-ng on RHEL5 with SElinux in default enforcing mode.
thanks. I've added these files to the contrib subdirectory. -- Bazsi
On Mon, May 21, 2007 at 07:57:17PM +0200, Balazs Scheidler wrote:
On Sun, 2007-05-20 at 16:45 +0200, Jan-Frode Myklebust wrote:
Here's a small patch adding a small SElinux module that makes it possible to run syslog-ng on RHEL5 with SElinux in default enforcing mode.
thanks. I've added these files to the contrib subdirectory.
Cool, thanks.. I've changed the policy to reflect that syslog-ng.persist should be located in /var/lib/syslog-ng/syslog-ng.persist, so maybe you could: git pull http://tanso.net/git/syslog-ng-2.0.git selinux -jf
On Tue, May 22, 2007 at 12:02:19AM +0200, Jan-Frode Myklebust wrote:
Cool, thanks.. I've changed the policy to reflect that syslog-ng.persist should be located in /var/lib/syslog-ng/syslog-ng.persist, so maybe you could:
git pull http://tanso.net/git/syslog-ng-2.0.git selinux
It would also be great if you could pull: git pull http://tanso.net/git/syslog-ng-2.0.git rhelspecfile That will pull in a contrib/rhel-packaging/syslog-ng.spec that can be used for building RPMs for RHEL: http://git.tanso.net/syslog-ng-2.0.git/?p=syslog-ng-2.0.git;a=blob;f=contrib... It will build both a normal package for the base syslog-ng, and a separate RPM for the selinux module: http://tanso.net/yum/repodata/repoview/syslog-ng-0-2.0.4-8.el5.html http://tanso.net/yum/repodata/repoview/syslog-ng-selinux-0-2.0.4-8.el5.html The base syslog-ng should work on any RHEL, while the syslog-ng-selinux will only work on RHEL5, FC6 or similar with the new modular SELinux policy. BTW: any hints for how to get a @VERSION@ replaced like you do for automatic conversion from syslog-ng.spec.bb.in to syslog-ng.spec.bb ? Currently I have the version number hard-coded.. -jf
On Tue, 2007-05-22 at 22:46 +0200, Jan-Frode Myklebust wrote:
On Tue, May 22, 2007 at 12:02:19AM +0200, Jan-Frode Myklebust wrote:
Cool, thanks.. I've changed the policy to reflect that syslog-ng.persist should be located in /var/lib/syslog-ng/syslog-ng.persist, so maybe you could:
git pull http://tanso.net/git/syslog-ng-2.0.git selinux
It would also be great if you could pull:
git pull http://tanso.net/git/syslog-ng-2.0.git rhelspecfile
That will pull in a contrib/rhel-packaging/syslog-ng.spec that can be used for building RPMs for RHEL:
http://git.tanso.net/syslog-ng-2.0.git/?p=syslog-ng-2.0.git;a=blob;f=contrib...
It will build both a normal package for the base syslog-ng, and a separate RPM for the selinux module:
http://tanso.net/yum/repodata/repoview/syslog-ng-0-2.0.4-8.el5.html http://tanso.net/yum/repodata/repoview/syslog-ng-selinux-0-2.0.4-8.el5.html
The base syslog-ng should work on any RHEL, while the syslog-ng-selinux will only work on RHEL5, FC6 or similar with the new modular SELinux policy.
I'll ask the collegue doing the packaging work review your changes, and possibly integrate it into the specfile in the root of the distribution.
BTW: any hints for how to get a @VERSION@ replaced like you do for automatic conversion from syslog-ng.spec.bb.in to syslog-ng.spec.bb ? Currently I have the version number hard-coded..
It needs to be added to AC_OUTPUT in configure.in -- Bazsi
participants (2)
-
Balazs Scheidler
-
Jan-Frode Myklebust