Blob Blame History Raw

policy_module(ifplugd, 1.0.0)

########################################
#
# Declarations
#

type ifplugd_t;
type ifplugd_exec_t;
init_daemon_domain(ifplugd_t, ifplugd_exec_t)

# config files
type ifplugd_etc_t;
files_type(ifplugd_etc_t)

type ifplugd_initrc_exec_t;
init_script_file(ifplugd_initrc_exec_t)

# pid files
type ifplugd_var_run_t;
files_pid_file(ifplugd_var_run_t)

########################################
#
# ifplugd local policy
#

allow ifplugd_t self:capability { net_admin sys_nice net_bind_service };
dontaudit ifplugd_t self:capability { sys_tty_config sys_ptrace };
allow ifplugd_t self:process { signal signull };
allow ifplugd_t self:fifo_file rw_fifo_file_perms;
allow ifplugd_t self:tcp_socket create_stream_socket_perms;
allow ifplugd_t self:udp_socket create_socket_perms;
allow ifplugd_t self:packet_socket create_socket_perms;
allow ifplugd_t self:netlink_route_socket create_netlink_socket_perms;

# pid file
manage_files_pattern(ifplugd_t, ifplugd_var_run_t, ifplugd_var_run_t)
manage_sock_files_pattern(ifplugd_t, ifplugd_var_run_t, ifplugd_var_run_t)
files_pid_filetrans(ifplugd_t, ifplugd_var_run_t, { file sock_file })

# config files
read_files_pattern(ifplugd_t, ifplugd_etc_t, ifplugd_etc_t)
exec_files_pattern(ifplugd_t, ifplugd_etc_t, ifplugd_etc_t)

kernel_read_system_state(ifplugd_t)
kernel_read_network_state(ifplugd_t)
kernel_rw_net_sysctls(ifplugd_t)
kernel_read_kernel_sysctls(ifplugd_t)

corecmd_exec_shell(ifplugd_t)
corecmd_exec_bin(ifplugd_t)

# reading of hardware information
dev_read_sysfs(ifplugd_t)

domain_read_confined_domains_state(ifplugd_t)
domain_dontaudit_read_all_domains_state(ifplugd_t)

auth_use_nsswitch(ifplugd_t)

logging_send_syslog_msg(ifplugd_t)

miscfiles_read_localization(ifplugd_t)

netutils_domtrans(ifplugd_t)
# transition to ifconfig & dhcpc
sysnet_domtrans_ifconfig(ifplugd_t)
sysnet_domtrans_dhcpc(ifplugd_t)
sysnet_delete_dhcpc_pid(ifplugd_t)
sysnet_read_dhcpc_pid(ifplugd_t)
sysnet_signal_dhcpc(ifplugd_t)

optional_policy(`
	consoletype_exec(ifplugd_t)
')