2005-09-16 14:54:36 +00:00
|
|
|
|
2006-08-15 20:00:58 +00:00
|
|
|
policy_module(snmp,1.1.3)
|
2005-09-16 14:54:36 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
type snmpd_t;
|
|
|
|
type snmpd_exec_t;
|
|
|
|
init_daemon_domain(snmpd_t,snmpd_exec_t)
|
|
|
|
|
2005-10-24 18:40:24 +00:00
|
|
|
type snmpd_etc_t;
|
|
|
|
files_config_file(snmpd_etc_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
|
|
|
|
type snmpd_log_t;
|
|
|
|
logging_log_file(snmpd_log_t)
|
|
|
|
|
|
|
|
type snmpd_var_run_t;
|
|
|
|
files_pid_file(snmpd_var_run_t)
|
|
|
|
|
|
|
|
type snmpd_var_lib_t;
|
|
|
|
files_type(snmpd_var_lib_t)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Local policy
|
|
|
|
#
|
|
|
|
allow snmpd_t self:capability { dac_override kill net_admin sys_nice sys_tty_config };
|
2005-11-01 15:34:00 +00:00
|
|
|
dontaudit snmpd_t self:capability sys_tty_config;
|
2005-09-16 14:54:36 +00:00
|
|
|
allow snmpd_t self:fifo_file rw_file_perms;
|
|
|
|
allow snmpd_t self:unix_dgram_socket create_socket_perms;
|
2005-10-13 20:59:36 +00:00
|
|
|
allow snmpd_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow snmpd_t self:tcp_socket create_stream_socket_perms;
|
2005-10-24 17:06:34 +00:00
|
|
|
allow snmpd_t self:udp_socket connected_stream_socket_perms;
|
2005-09-16 14:54:36 +00:00
|
|
|
|
|
|
|
allow snmpd_t snmpd_etc_t:file { getattr read };
|
|
|
|
|
|
|
|
allow snmpd_t snmpd_log_t:file create_file_perms;
|
2006-03-02 23:41:11 +00:00
|
|
|
logging_log_filetrans(snmpd_t,snmpd_log_t,file)
|
2005-09-16 14:54:36 +00:00
|
|
|
|
|
|
|
allow snmpd_t snmpd_var_lib_t:file create_file_perms;
|
2005-10-13 20:59:36 +00:00
|
|
|
allow snmpd_t snmpd_var_lib_t:sock_file create_file_perms;
|
2005-09-16 14:54:36 +00:00
|
|
|
allow snmpd_t snmpd_var_lib_t:dir create_dir_perms;
|
2006-03-02 23:41:11 +00:00
|
|
|
files_usr_filetrans(snmpd_t,snmpd_var_lib_t,file)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_var_filetrans(snmpd_t,snmpd_var_lib_t,{ file dir sock_file })
|
2006-03-02 23:41:11 +00:00
|
|
|
files_var_lib_filetrans(snmpd_t,snmpd_var_lib_t,file)
|
2005-09-16 14:54:36 +00:00
|
|
|
|
|
|
|
allow snmpd_t snmpd_var_run_t:file create_file_perms;
|
|
|
|
allow snmpd_t snmpd_var_run_t:dir rw_dir_perms;
|
2006-03-02 23:41:11 +00:00
|
|
|
files_pid_filetrans(snmpd_t,snmpd_var_run_t,file)
|
2005-09-16 14:54:36 +00:00
|
|
|
|
2006-04-12 15:04:28 +00:00
|
|
|
kernel_read_device_sysctls(snmpd_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(snmpd_t)
|
|
|
|
kernel_read_net_sysctls(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
kernel_read_proc_symlinks(snmpd_t)
|
|
|
|
kernel_read_system_state(snmpd_t)
|
|
|
|
kernel_read_network_state(snmpd_t)
|
|
|
|
|
2005-12-02 22:06:05 +00:00
|
|
|
corecmd_exec_bin(snmpd_t)
|
|
|
|
corecmd_exec_sbin(snmpd_t)
|
|
|
|
corecmd_exec_shell(snmpd_t)
|
|
|
|
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_non_ipsec_sendrecv(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
corenet_tcp_sendrecv_all_if(snmpd_t)
|
2005-10-24 17:06:34 +00:00
|
|
|
corenet_udp_sendrecv_all_if(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
corenet_tcp_sendrecv_all_nodes(snmpd_t)
|
2005-10-24 17:06:34 +00:00
|
|
|
corenet_udp_sendrecv_all_nodes(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
corenet_tcp_sendrecv_all_ports(snmpd_t)
|
2005-10-24 17:06:34 +00:00
|
|
|
corenet_udp_sendrecv_all_ports(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
corenet_tcp_bind_all_nodes(snmpd_t)
|
2005-10-24 17:06:34 +00:00
|
|
|
corenet_udp_bind_all_nodes(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
corenet_tcp_bind_snmp_port(snmpd_t)
|
|
|
|
corenet_udp_bind_snmp_port(snmpd_t)
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_sendrecv_snmp_server_packets(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
|
|
|
|
dev_list_sysfs(snmpd_t)
|
|
|
|
dev_read_sysfs(snmpd_t)
|
|
|
|
dev_read_urand(snmpd_t)
|
|
|
|
dev_read_rand(snmpd_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(snmpd_t)
|
2005-10-13 20:59:36 +00:00
|
|
|
domain_signull_all_domains(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
domain_read_all_domains_state(snmpd_t)
|
|
|
|
|
|
|
|
files_read_etc_files(snmpd_t)
|
|
|
|
files_read_usr_files(snmpd_t)
|
|
|
|
files_read_etc_runtime_files(snmpd_t)
|
|
|
|
files_search_home(snmpd_t)
|
|
|
|
|
2005-12-02 22:06:05 +00:00
|
|
|
fs_getattr_all_fs(snmpd_t)
|
|
|
|
fs_getattr_rpc_dirs(snmpd_t)
|
|
|
|
fs_search_auto_mountpoints(snmpd_t)
|
|
|
|
|
|
|
|
storage_dontaudit_read_fixed_disk(snmpd_t)
|
|
|
|
storage_dontaudit_read_removable_device(snmpd_t)
|
|
|
|
|
|
|
|
term_dontaudit_use_console(snmpd_t)
|
|
|
|
|
2006-01-18 18:08:39 +00:00
|
|
|
init_read_utmp(snmpd_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(snmpd_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(snmpd_t)
|
2006-01-18 18:08:39 +00:00
|
|
|
init_dontaudit_write_utmp(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
|
|
|
|
libs_use_ld_so(snmpd_t)
|
|
|
|
libs_use_shared_libs(snmpd_t)
|
|
|
|
|
|
|
|
logging_send_syslog_msg(snmpd_t)
|
|
|
|
|
|
|
|
miscfiles_read_localization(snmpd_t)
|
|
|
|
|
|
|
|
seutil_dontaudit_search_config(snmpd_t)
|
|
|
|
|
|
|
|
sysnet_read_config(snmpd_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(snmpd_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_dontaudit_search_sysadm_home_dirs(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
|
|
|
|
ifdef(`distro_redhat', `
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-16 14:54:36 +00:00
|
|
|
rpm_read_db(snmpd_t)
|
2005-12-01 22:53:20 +00:00
|
|
|
rpm_dontaudit_manage_db(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
')
|
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`targeted_policy', `
|
2006-02-02 21:08:12 +00:00
|
|
|
term_dontaudit_use_unallocated_ttys(snmpd_t)
|
|
|
|
term_dontaudit_use_generic_ptys(snmpd_t)
|
2006-01-31 19:21:01 +00:00
|
|
|
files_dontaudit_read_root_files(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-12-01 22:53:20 +00:00
|
|
|
amanda_dontaudit_read_dumpdates(snmpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-12-02 22:06:05 +00:00
|
|
|
cups_read_rw_config(snmpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-23 21:20:03 +00:00
|
|
|
nis_use_ypbind(snmpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use(snmpd_t)
|
2005-09-16 14:54:36 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-12-02 22:06:05 +00:00
|
|
|
rpc_search_nfs_state_data(snmpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-16 14:54:36 +00:00
|
|
|
seutil_sigchld_newrole(snmpd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-09-16 14:54:36 +00:00
|
|
|
udev_read_db(snmpd_t)
|
|
|
|
')
|