Chris PeBenito ab58ad
# DESC - Ethereal  
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Author: Ivan Gyurdiev <ivg2@cornell.edu>
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
#############################################################
Chris PeBenito ab58ad
# ethereal_networking(app_prefix) - 
Chris PeBenito ab58ad
#	restricted ethereal rules (sysadm only)
Chris PeBenito ab58ad
#                               
Chris PeBenito ab58ad
Chris PeBenito ab58ad
define(`ethereal_networking', `
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Create various types of sockets
Chris PeBenito ab58ad
allow $1_t self:netlink_route_socket create_netlink_socket_perms;
Chris PeBenito ab58ad
allow $1_t self:udp_socket create_socket_perms;
Chris PeBenito ab58ad
allow $1_t self:packet_socket create_socket_perms;
Chris PeBenito ab58ad
allow $1_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito ab58ad
allow $1_t self:tcp_socket create_socket_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_t self:capability { dac_override dac_read_search net_raw setgid setuid };
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Resolve names via DNS
Chris PeBenito ab58ad
can_resolve($1_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
') dnl ethereal_networking
Chris PeBenito ab58ad
Chris PeBenito ab58ad
########################################################
Chris PeBenito ab58ad
# Ethereal (GNOME) 
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
Chris PeBenito ab58ad
define(`ethereal_domain', `
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Type for program
Chris PeBenito ab58ad
type $1_ethereal_t, domain, nscd_client_domain;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Transition from sysadm type
Chris PeBenito ab58ad
domain_auto_trans($1_t, ethereal_exec_t, $1_ethereal_t)
Chris PeBenito ab58ad
role $1_r types $1_ethereal_t;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Manual transition from userhelper 
Chris PeBenito ab58ad
ifdef(`userhelper.te', `
Chris PeBenito ab58ad
allow userhelperdomain $1_ethereal_t:process { transition siginh rlimitinh noatsecure };
Chris PeBenito ab58ad
allow $1_ethereal_t userhelperdomain:fd use;
Chris PeBenito ab58ad
allow $1_ethereal_t userhelperdomain:process sigchld;
Chris PeBenito ab58ad
') dnl userhelper
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# X, GNOME
Chris PeBenito ab58ad
x_client_domain($1_ethereal, $1)
Chris PeBenito ab58ad
gnome_application($1_ethereal, $1)
Chris PeBenito ab58ad
gnome_file_dialog($1_ethereal, $1)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Why does it write this?
Chris PeBenito ab58ad
ifdef(`snmpd.te', `
Chris PeBenito ab58ad
dontaudit sysadm_ethereal_t snmpd_var_lib_t:file write;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# /home/.ethereal
Chris PeBenito ab58ad
home_domain($1, ethereal)
Chris PeBenito ab58ad
file_type_auto_trans($1_ethereal_t, $1_home_dir_t, $1_ethereal_home_t, dir)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Enable restricted networking rules for sysadm - this is shared w/ tethereal
Chris PeBenito ab58ad
ifelse($1, `sysadm', `
Chris PeBenito ab58ad
ethereal_networking($1_ethereal) 
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Ethereal tries to write to user terminal
Chris PeBenito ab58ad
dontaudit sysadm_ethereal_t user_tty_type:chr_file { read write };
Chris PeBenito ab58ad
dontaudit sysadm_ethereal_t unpriv_userdomain:fd use;
Chris PeBenito ab58ad
', `')
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Store temporary files
Chris PeBenito ab58ad
tmp_domain($1_ethereal)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Re-execute itself (why?)
Chris PeBenito ab58ad
can_exec($1_ethereal_t, ethereal_exec_t)
Chris PeBenito ab58ad
allow $1_ethereal_t sbin_t:dir search;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Supress .local denials until properly implemented
Chris PeBenito ab58ad
dontaudit $1_ethereal_t $1_home_t:dir search;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# FIXME: policy is incomplete
Chris PeBenito ab58ad
Chris PeBenito ab58ad
') dnl ethereal_domain