Skip to contentSkip to conversation

patch: arpwatch cleanup

PATCH Thomas Bleher 2 participants 2 messages Nov 2, 2004 – Nov 5, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

The following patch cleans up the arpwatch policy. It does not add any new permissions, it just organizes them more cleanly.
It also adds /var/lib/arpwatch to the file_contexts file since this is the place where both SuSE and Debian store arpwatch data.

Please apply.

Thomas

Signature · 2 lines
http://www.cip.ifi.lmu.de/~bleher/selinux/ - my SELinux pages
GPG-Fingerprint: BC4F BB16 30D6 F253 E3EA  D09E C562 2BAE B2F4 ABE7
domains/program/unused/arpwatch.te +13 -12
@@ -10,22 +10,23 @@
 # arpwatch_exec_t is the type of the arpwatch executable.
 #
 daemon_domain(arpwatch, `, privmail')
+
+# for files created by arpwatch
 type arpwatch_data_t, file_type, sysadmfile;
-allow arpwatch_t self:netlink_route_socket r_netlink_socket_perms;
-allow arpwatch_t self:capability { net_admin net_raw };
-allow arpwatch_t self:udp_socket create_socket_perms;
-allow arpwatch_t self:unix_dgram_socket create_socket_perms;
-allow arpwatch_t arpwatch_t:capability { setgid setuid };
-allow arpwatch_t arpwatch_t:packet_socket create_socket_perms;
-allow arpwatch_t arpwatch_t:unix_stream_socket create_stream_socket_perms;
 create_dir_file(arpwatch_t,arpwatch_data_t)
-allow arpwatch_t tmp_t:dir { search };
 tmp_domain(arpwatch)
-allow arpwatch_t net_conf_t:file { getattr read };
-allow arpwatch_t netif_lo_t:netif { udp_send };
-allow arpwatch_t sbin_t:dir { search };
-allow arpwatch_t sbin_t:lnk_file { read };
+
+allow arpwatch_t self:capability { net_admin net_raw setgid setuid };
+
 can_network(arpwatch_t)
+allow arpwatch_t self:netlink_route_socket r_netlink_socket_perms;
+allow arpwatch_t self:udp_socket create_socket_perms;
+allow arpwatch_t self:unix_dgram_socket create_socket_perms;
+allow arpwatch_t self:packet_socket create_socket_perms;
+allow arpwatch_t self:unix_stream_socket create_stream_socket_perms;
+
+allow arpwatch_t sbin_t:dir search;
+allow arpwatch_t sbin_t:lnk_file read;
 can_ypbind(arpwatch_t)
 allow system_mail_t arpwatch_tmp_t:file rw_file_perms;
 ifdef(`postfix.te', `
file_contexts/program/arpwatch.fc +4 -0
@@ -1,3 +1,7 @@
 # arpwatch - keep track of ethernet/ip address pairings
 /usr/sbin/arpwatch	--	system_u:object_r:arpwatch_exec_t
+ifdef(`distro_redhat', `
 /var/arpwatch(/.*)?	system_u:object_r:arpwatch_data_t
+', `
+/var/lib/arpwatch(/.*)?		system_u:object_r:arpwatch_data_t
+')
#1 lore raw

Merged.

Quoted 8 lines · Thomas Bleher

The following patch cleans up the arpwatch policy. It does not add any new permissions, it just organizes them more cleanly.
It also adds /var/lib/arpwatch to the file_contexts file since this is the place where both SuSE and Debian store arpwatch data.

Please apply.

Thomas

Signature · 7 lines
James Carter <[email protected]>
National Security Agency

--
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.