policy_module(vnstatd, 1.1.0) ######################################## # # Declarations # attribute_role vnstat_roles; type vnstat_t; type vnstat_exec_t; application_domain(vnstat_t, vnstat_exec_t) role vnstat_roles types vnstat_t; type vnstatd_t; type vnstatd_exec_t; init_daemon_domain(vnstatd_t, vnstatd_exec_t) init_nnp_daemon_domain(vnstatd_t) type vnstatd_initrc_exec_t; init_script_file(vnstatd_initrc_exec_t) type vnstatd_var_lib_t; files_type(vnstatd_var_lib_t) files_mountpoint(vnstatd_var_lib_t) type vnstatd_var_run_t; files_pid_file(vnstatd_var_run_t) ######################################## # # Daemon local policy # allow vnstatd_t self:process signal; allow vnstatd_t self:fifo_file rw_fifo_file_perms; allow vnstatd_t self:unix_stream_socket { accept listen }; manage_dirs_pattern(vnstatd_t, vnstatd_var_lib_t, vnstatd_var_lib_t) manage_files_pattern(vnstatd_t, vnstatd_var_lib_t, vnstatd_var_lib_t) files_var_lib_filetrans(vnstatd_t, vnstatd_var_lib_t, dir) allow vnstatd_t vnstatd_var_lib_t:file map; manage_files_pattern(vnstatd_t, vnstatd_var_run_t, vnstatd_var_run_t) manage_dirs_pattern(vnstatd_t, vnstatd_var_run_t, vnstatd_var_run_t) files_pid_filetrans(vnstatd_t, vnstatd_var_run_t, { dir file }) kernel_read_network_state(vnstatd_t) kernel_read_system_state(vnstatd_t) dev_read_sysfs(vnstatd_t) domain_use_interactive_fds(vnstatd_t) fs_getattr_xattr_fs(vnstatd_t) logging_send_syslog_msg(vnstatd_t) ######################################## # # Client local policy # allow vnstat_t self:process signal; allow vnstat_t self:fifo_file rw_fifo_file_perms; allow vnstat_t self:unix_stream_socket { accept listen }; files_search_var_lib(vnstat_t) manage_dirs_pattern(vnstat_t, vnstatd_var_lib_t, vnstatd_var_lib_t) manage_files_pattern(vnstat_t, vnstatd_var_lib_t, vnstatd_var_lib_t) kernel_read_network_state(vnstat_t) kernel_read_system_state(vnstat_t) domain_use_interactive_fds(vnstat_t) fs_getattr_xattr_fs(vnstat_t) logging_send_syslog_msg(vnstat_t) optional_policy(` cron_system_entry(vnstat_t, vnstat_exec_t) ')