Skip to contentSkip to conversation

RADIUS and SNMP patch

PATCH Russell Coker 2 participants 2 messages Aug 26, 2002 SELinux security module

lore
Share & tools
lore
#0 lore raw

I've attached a policy patch that labels the ports used by snmp, has many changes to snmp policy, allows a RADIUS server to talk to an SNMP server, and adds an extra cron job patch for RADIUS too.

Signature · 3 lines
I do not get viruses because I do not use MS software.
If you use Outlook then please do not put my email address in your
address-book so that WHEN you get a virus it won't use my address in the
Quoted 1 line

From field.

domains/program/radius.te renamed from tmp/selinux/policy/domains/program/radius.te +4 -0
diff -ruN /tmp/selinux/policy/domains/program/radius.te ./domains/program/radius.te
@@ -17,6 +17,7 @@
 type var_log_radiusd_t, file_type, sysadmfile, logfile;
 
 domain_auto_trans(system_crond_t, radiusd_exec_t, radiusd_t)
+allow radiusd_t crond_t:fifo_file { read ioctl };
 
 allow radiusd_t self:process setsched;
 
@@ -51,5 +52,8 @@
 
 can_network(radiusd_t)
 allow radiusd_t { radius_port_t radacct_port_t }:udp_socket name_bind;
+ifdef(`snmpd.te', `
+can_tcp_connect(radiusd_t, snmpd_t)
+')
 
 allow radiusd_t self:unix_stream_socket create_stream_socket_perms;
domains/program/snmpd.te renamed from tmp/selinux/policy/domains/program/snmpd.te +18 -3
diff -ruN /tmp/selinux/policy/domains/program/snmpd.te ./domains/program/snmpd.te
@@ -9,21 +9,36 @@
 #
 daemon_domain(snmpd)
 
-#allow snmpd_t etc_t:file r_file_perms;
+#temp
+allow snmpd_t var_t:dir getattr;
+
 can_network(snmpd_t)
 
+dontaudit snmpd_t { sysadm_tty_device_t sysadm_devpts_t }:chr_file { read write };
+
+
+type snmp_port_t, port_type;
+allow snmpd_t snmp_port_t:{ udp_socket tcp_socket } name_bind;
+
+type etc_snmpd_t, file_type, sysadmfile;
+allow snmpd_t etc_snmpd_t:file { getattr read };
+
 type var_lib_snmpd_t, file_type, sysadmfile;
-rw_dir_create_file(snmpd_t, var_lib_snmpd_t)
+file_type_auto_trans(snmpd_t, var_lib_t, var_lib_snmpd_t)
+
+can_udp_send(sysadm_t, snmpd_t)
+can_udp_send(snmpd_t, sysadm_t)
 
 allow snmpd_t self:unix_dgram_socket create_socket_perms;
 allow snmpd_t self:unix_stream_socket create_socket_perms;
 allow snmpd_t etc_t:lnk_file read;
-allow snmpd_t { etc_t etc_runtime_t resolv_conf_t }:file r_file_perms;
+allow snmpd_t { etc_t etc_runtime_t resolv_conf_t }:file { getattr read };
 allow snmpd_t random_device_t:chr_file read;
 allow snmpd_t self:capability net_bind_service;
 
 allow snmpd_t proc_t:dir search;
 allow snmpd_t proc_t:file r_file_perms;
 allow snmpd_t fs_t:filesystem getattr;
+allow snmpd_t self:file { getattr read };
 
 allow snmpd_t var_lib_t:dir r_dir_perms;
file_contexts/program/snmpd.fc renamed from tmp/selinux/policy/file_contexts/program/snmpd.fc +1 -0
diff -ruN /tmp/selinux/policy/file_contexts/program/snmpd.fc ./file_contexts/program/snmpd.fc
@@ -1,3 +1,4 @@
 # snmpd
 /usr/sbin/snmp(trap)?d		system_u:object_r:snmpd_exec_t
 /var/lib/snmp(/.*)?		system_u:object_r:var_lib_snmpd_t
+/etc/snmp/snmp(trap)?d.conf	system_u:object_r:etc_snmpd_t
net_contexts renamed from tmp/selinux/policy/net_contexts +9 -2
diff -ruN /tmp/selinux/policy/net_contexts ./net_contexts
@@ -24,12 +24,19 @@
 portcon tcp 53 system_u:object_r:named_port_t')
 ifdef(`fingerd.te', `portcon tcp 79  system_u:object_r:fingerd_port_t')
 ifdef(`apache.te', `portcon tcp 80  system_u:object_r:http_port_t')
-ifdef(`samba.te', `portcon tcp 137 system_u:object_r:smbd_port_t
+ifdef(`samba.te', `
+portcon tcp 137 system_u:object_r:smbd_port_t
 portcon udp 137 system_u:object_r:nmbd_port_t
 portcon tcp 138 system_u:object_r:smbd_port_t
 portcon udp 138 system_u:object_r:nmbd_port_t
 portcon tcp 139 system_u:object_r:smbd_port_t
-portcon udp 139 system_u:object_r:nmbd_port_t')
+portcon udp 139 system_u:object_r:nmbd_port_t
+')
+ifdef(`snmpd.te', `
+portcon udp 161 system_u:object_r:snmp_port_t
+portcon udp 162 system_u:object_r:snmp_port_t
+portcon tcp 199 system_u:object_r:snmp_port_t
+')
 ifdef(`slapd.te', `portcon tcp 389 system_u:object_r:ldap_port_t')
 ifdef(`rlogind.te', `portcon tcp 513 system_u:object_r:rlogin_port_t')
 ifdef(`rshd.te', `portcon tcp 514 system_u:object_r:rsh_port_t')
#1 lore raw
Quoted 3 lines · Russell Coker

I've attached a policy patch that labels the ports used by snmp, has many changes to snmp policy, allows a RADIUS server to talk to an SNMP server, and adds an extra cron job patch for RADIUS too.

Thanks, merged and available in the sourceforge CVS.

--
Stephen D. Smalley, NAI Labs
[email protected]

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.