All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] policy for nrpe
@ 2004-05-23 21:44 Thomas Bleher
  2004-05-24  0:56 ` Russell Coker
  2004-05-25  2:48 ` Russell Coker
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Bleher @ 2004-05-23 21:44 UTC (permalink / raw)
  To: SELinux ML


[-- Attachment #1.1: Type: text/plain, Size: 363 bytes --]

The attached patch adds policy support for nrpe.
(nrpe stands for Nagios Remote Plugin Execution and is a client called
from inetd which performs checks on a client on behalf of a Nagios
server)

Please apply.
Thomas

-- 
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages
GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA  D09E C562 2BAE B2F4 ABE7

[-- Attachment #1.2: nrpe.patch --]
[-- Type: text/plain, Size: 2598 bytes --]

--- orig/domains/program/unused/nrpe.te	1970-01-01 01:00:00.000000000 +0100
+++ mod/domains/program/unused/nrpe.te	2004-05-23 23:28:33.000000000 +0200
@@ -0,0 +1,39 @@
+# DESC nrpe - Nagios Remote Plugin Execution
+#
+# Author: Thomas Bleher <ThomasBleher@gmx.de>
+#
+# Depends: tcpd.te
+# X-Debian-Packages: nagios-nrpe-server
+#
+# This policy assumes that nrpe is called from inetd
+
+type nrpe_port_t, port_type;
+
+daemon_base_domain(nrpe)
+domain_auto_trans(tcpd_t, nrpe_exec_t, nrpe_t)
+
+allow nrpe_t urandom_device_t:chr_file { getattr ioctl read };
+
+allow nrpe_t self:fifo_file rw_file_perms;
+# use sockets inherited from inetd
+allow nrpe_t inetd_t:tcp_socket { ioctl read write };
+allow nrpe_t inetd_t:fd { use };
+allow nrpe_t inetd_t:process { sigchld };
+allow nrpe_t devtty_t:chr_file { read write };
+
+allow nrpe_t self:process setpgid;
+
+etc_domain(nrpe)
+
+# permissions for the scripts executed by nrpe
+#
+# call shell programs
+can_exec(nrpe_t, { bin_t shell_exec_t ls_exec_t })
+allow nrpe_t { bin_t sbin_t }:dir search;
+# for /bin/sh
+allow nrpe_t bin_t:lnk_file read;
+
+# read /proc/meminfo, /proc/self/mounts and /etc/mtab
+allow nrpe_t { self proc_t etc_runtime_t }:file { getattr read };
+
+# you will have to add more permissions here, depending on the scripts you call!
--- orig/file_contexts/program/nrpe.fc	1970-01-01 01:00:00.000000000 +0100
+++ mod/file_contexts/program/nrpe.fc	2004-05-23 23:28:13.000000000 +0200
@@ -0,0 +1,5 @@
+# nrpe
+/usr/bin/nrpe		--	system_u:object_r:nrpe_exec_t
+/etc/nagios/nrpe.cfg	--	system_u:object_r:nrpe_etc_t
+/usr/lib/netsaint/plugins(/.*)?	--	system_u:object_r:bin_t
+/usr/lib/nagios/plugins(/.*)?	--	system_u:object_r:bin_t
--- orig/net_contexts
+++ mod/net_contexts
@@ -142,6 +142,7 @@
 portcon tcp 5269 system_u:object_r:jabber_interserver_port_t
 ')
 ifdef(`postgresql.te', `portcon tcp 5432 system_u:object_r:postgresql_port_t')
+ifdef(`nrpe.te', `portcon tcp 5666 system_u:object_r:nrpe_port_t')
 ifdef(`use_x_ports', `
 portcon tcp 6000  system_u:object_r:xserver_port_t
 portcon tcp 6001  system_u:object_r:xserver_port_t
--- orig/domains/program/unused/inetd.te
+++ mod/domains/program/inetd.te
@@ -54,6 +54,7 @@
 ifdef(`rshd.te', `allow inetd_t rsh_port_t:tcp_socket name_bind;')
 ifdef(`amanda.te', `allow inetd_t amanda_port_t:tcp_socket name_bind;')
 ifdef(`swat.te', `allow inetd_t swat_port_t:tcp_socket name_bind;')
+ifdef(`nrpe.te', `allow inetd_t nrpe_port_t:tcp_socket name_bind;')
 ifdef(`amanda.te', `
 allow inetd_t biff_port_t:tcp_socket name_bind;
 allow inetd_t biff_port_t:udp_socket name_bind;

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-05-25  9:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-23 21:44 [patch] policy for nrpe Thomas Bleher
2004-05-24  0:56 ` Russell Coker
2004-05-24  9:09   ` Thomas Bleher
2004-05-25  2:41     ` Russell Coker
2004-05-25  2:48 ` Russell Coker
2004-05-25  9:03   ` Thomas Bleher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.