Chris PeBenito 31b7c0
#DESC Ifconfig - Configure network interfaces
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Authors:  Stephen Smalley <sds@epoch.ncsc.mil> and Timothy Fraser  
Chris PeBenito 31b7c0
# X-Debian-Packages: net-tools
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#################################
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Rules for the ifconfig_t domain.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# ifconfig_t is the domain for the ifconfig program.
Chris PeBenito 31b7c0
# ifconfig_exec_t is the type of the corresponding program.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
type ifconfig_t, domain, privlog, privmodule;
Chris PeBenito 31b7c0
type ifconfig_exec_t, file_type, sysadmfile, exec_type;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
role system_r types ifconfig_t;
Chris PeBenito 31b7c0
role sysadm_r types ifconfig_t;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
uses_shlib(ifconfig_t)
Chris PeBenito 31b7c0
general_domain_access(ifconfig_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
domain_auto_trans(initrc_t, ifconfig_exec_t, ifconfig_t)
Chris PeBenito 31b7c0
ifdef(`targeted_policy', `', `
Chris PeBenito 31b7c0
domain_auto_trans(sysadm_t, ifconfig_exec_t, ifconfig_t)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# for /sbin/ip
Chris PeBenito 31b7c0
allow ifconfig_t self:packet_socket create_socket_perms;
Chris PeBenito 31b7c0
allow ifconfig_t self:netlink_route_socket rw_netlink_socket_perms;
Chris PeBenito 31b7c0
allow ifconfig_t self:tcp_socket { create ioctl };
Chris PeBenito 31b7c0
allow ifconfig_t etc_t:file { getattr read };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow ifconfig_t self:socket create_socket_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Use capabilities.
Chris PeBenito 31b7c0
allow ifconfig_t self:capability { net_raw net_admin };
Chris PeBenito 31b7c0
dontaudit ifconfig_t self:capability sys_module;
Chris PeBenito 31b7c0
allow ifconfig_t self:capability sys_tty_config;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Inherit and use descriptors from init.
Chris PeBenito 31b7c0
allow ifconfig_t { kernel_t init_t }:fd use;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Access /proc
Chris PeBenito 31b7c0
r_dir_file(ifconfig_t, proc_t)
Chris PeBenito 31b7c0
r_dir_file(ifconfig_t, proc_net_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow ifconfig_t privfd:fd use;
Chris PeBenito 31b7c0
allow ifconfig_t run_init_t:fd use;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Create UDP sockets, necessary when called from dhcpc
Chris PeBenito 31b7c0
allow ifconfig_t self:udp_socket create_socket_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Access terminals.
Chris PeBenito 31b7c0
can_access_pty(ifconfig_t, initrc)
Chris PeBenito 31b7c0
allow ifconfig_t { user_tty_type admin_tty_type }:chr_file rw_file_perms;
Chris PeBenito 31b7c0
ifdef(`gnome-pty-helper.te', `allow ifconfig_t sysadm_gph_t:fd use;')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow ifconfig_t tun_tap_device_t:chr_file { read write };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# ifconfig attempts to search some sysctl entries.
Chris PeBenito 31b7c0
# Do not audit those attempts; comment out these rules if it is desired to
Chris PeBenito 31b7c0
# see the denials.
Chris PeBenito 31b7c0
allow ifconfig_t { sysctl_t sysctl_net_t }:dir search;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow ifconfig_t fs_t:filesystem getattr;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
read_locale(ifconfig_t)
Chris PeBenito 31b7c0
allow ifconfig_t lib_t:file { getattr read };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
rhgb_domain(ifconfig_t)
Chris PeBenito 31b7c0
allow ifconfig_t userdomain:fd use;
Chris PeBenito 31b7c0
dontaudit ifconfig_t root_t:file read;
Chris PeBenito 31b7c0
r_dir_file(ifconfig_t, sysfs_t)