Chris PeBenito 31b7c0
#DESC usernetctl - User network interface configuration helper 
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Author: Colin Walters <walters@redhat.com>
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
type usernetctl_exec_t, file_type, sysadmfile, exec_type;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
type usernetctl_t, domain, privfd;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
if (user_net_control) {
Chris PeBenito 31b7c0
domain_auto_trans(userdomain, usernetctl_exec_t, usernetctl_t)
Chris PeBenito 31b7c0
} else {
Chris PeBenito 31b7c0
can_exec(userdomain, usernetctl_exec_t)
Chris PeBenito 31b7c0
}
Chris PeBenito 31b7c0
in_user_role(usernetctl_t)
Chris PeBenito 31b7c0
role sysadm_r types usernetctl_t;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`usernetctl_transition',`
Chris PeBenito 31b7c0
domain_auto_trans(usernetctl_t, $1_exec_t, $1_t)
Chris PeBenito 31b7c0
in_user_role($1_t)
Chris PeBenito 31b7c0
allow $1_t userpty_type:chr_file { getattr read write };
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
ifdef(`ifconfig.te',`
Chris PeBenito 31b7c0
usernetctl_transition(ifconfig)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
ifdef(`iptables.te',`
Chris PeBenito 31b7c0
usernetctl_transition(iptables)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
ifdef(`dhcpc.te',`
Chris PeBenito 31b7c0
usernetctl_transition(dhcpc)
Chris PeBenito 31b7c0
allow usernetctl_t dhcp_etc_t:file ra_file_perms;
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
ifdef(`modutil.te',`
Chris PeBenito 31b7c0
usernetctl_transition(insmod)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
ifdef(`consoletype.te',`
Chris PeBenito 31b7c0
usernetctl_transition(consoletype)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
ifdef(`hostname.te',`
Chris PeBenito 31b7c0
usernetctl_transition(hostname)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow usernetctl_t self:capability { setuid setgid dac_override };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
base_file_read_access(usernetctl_t)
Chris PeBenito 31b7c0
base_pty_perms(usernetctl)
Chris PeBenito 31b7c0
allow usernetctl_t devtty_t:chr_file rw_file_perms;
Chris PeBenito 31b7c0
uses_shlib(usernetctl_t)
Chris PeBenito 31b7c0
read_locale(usernetctl_t)
Chris PeBenito 31b7c0
general_domain_access(usernetctl_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
r_dir_file(usernetctl_t, proc_t)
Chris PeBenito 31b7c0
dontaudit usernetctl_t { domain - usernetctl_t }:dir search;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
allow usernetctl_t userpty_type:chr_file rw_file_perms;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
can_exec(usernetctl_t, { bin_t sbin_t shell_exec_t usernetctl_exec_t})
Chris PeBenito 31b7c0
can_exec(usernetctl_t, etc_t)
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
r_dir_file(usernetctl_t, etc_t)
Chris PeBenito 31b7c0
allow usernetctl_t { var_t var_run_t }:dir { getattr read search };
Chris PeBenito 31b7c0
allow usernetctl_t etc_runtime_t:file r_file_perms;
Chris PeBenito 31b7c0
allow usernetctl_t net_conf_t:file r_file_perms;
Chris PeBenito 31b7c0