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