2005-09-16 14:54:36 +00:00
|
|
|
## <summary>Simple network management protocol services</summary>
|
2005-10-22 22:51:01 +00:00
|
|
|
|
2010-01-07 14:00:48 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Connect to snmpd using a unix domain stream socket.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`snmp_stream_connect',`
|
|
|
|
gen_require(`
|
|
|
|
type snmpd_t, snmpd_var_lib_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_var_lib($1)
|
|
|
|
stream_connect_pattern($1, snmpd_var_lib_t, snmpd_var_lib_t, snmpd_t)
|
|
|
|
')
|
|
|
|
|
2005-10-22 22:51:01 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2006-08-15 20:00:58 +00:00
|
|
|
## Use snmp over a TCP connection. (Deprecated)
|
2005-10-22 22:51:01 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-10-22 22:51:01 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-10-22 22:51:01 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-01-31 21:43:09 +00:00
|
|
|
interface(`snmp_tcp_connect',`
|
2006-08-15 20:00:58 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated.')
|
2005-10-22 22:51:01 +00:00
|
|
|
')
|
2006-01-31 21:43:09 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2006-08-15 20:00:58 +00:00
|
|
|
## Send and receive UDP traffic to SNMP (Deprecated)
|
2006-01-31 21:43:09 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-31 21:43:09 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-31 21:43:09 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`snmp_udp_chat',`
|
2006-08-15 20:00:58 +00:00
|
|
|
refpolicywarn(`$0($*) has been deprecated.')
|
2006-01-31 21:43:09 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read snmpd libraries.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-31 21:43:09 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-31 21:43:09 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`snmp_read_snmp_var_lib_files',`
|
2006-01-31 21:43:09 +00:00
|
|
|
gen_require(`
|
|
|
|
type snmpd_var_lib_t;
|
|
|
|
')
|
2006-12-12 20:08:08 +00:00
|
|
|
|
|
|
|
allow $1 snmpd_var_lib_t:dir list_dir_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
read_files_pattern($1, snmpd_var_lib_t, snmpd_var_lib_t)
|
|
|
|
read_lnk_files_pattern($1, snmpd_var_lib_t, snmpd_var_lib_t)
|
2006-01-31 21:43:09 +00:00
|
|
|
')
|
2006-09-22 17:14:35 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## dontaudit Read snmpd libraries.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2007-02-16 23:01:42 +00:00
|
|
|
## Domain to not audit.
|
2006-09-22 17:14:35 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`snmp_dontaudit_read_snmp_var_lib_files',`
|
|
|
|
gen_require(`
|
|
|
|
type snmpd_var_lib_t;
|
|
|
|
')
|
2006-12-12 20:08:08 +00:00
|
|
|
dontaudit $1 snmpd_var_lib_t:dir list_dir_perms;
|
|
|
|
dontaudit $1 snmpd_var_lib_t:file read_file_perms;
|
2006-09-22 17:14:35 +00:00
|
|
|
dontaudit $1 snmpd_var_lib_t:lnk_file { getattr read };
|
|
|
|
')
|
2007-02-16 23:01:42 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## dontaudit write snmpd libraries files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain to not audit.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`snmp_dontaudit_write_snmp_var_lib_files',`
|
|
|
|
gen_require(`
|
|
|
|
type snmpd_var_lib_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 snmpd_var_lib_t:file write;
|
|
|
|
')
|
2008-02-07 16:37:47 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
2010-01-07 14:00:48 +00:00
|
|
|
## All of the rules required to administrate
|
2008-02-07 16:37:47 +00:00
|
|
|
## an snmp environment
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2008-12-03 15:21:33 +00:00
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
|
|
|
## The role to be allowed to manage the snmp domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
2008-02-07 16:37:47 +00:00
|
|
|
## <rolecap/>
|
|
|
|
#
|
|
|
|
interface(`snmp_admin',`
|
|
|
|
gen_require(`
|
2008-05-15 13:10:34 +00:00
|
|
|
type snmpd_t, snmpd_log_t;
|
|
|
|
type snmpd_var_lib_t, snmpd_var_run_t;
|
2008-12-03 15:21:33 +00:00
|
|
|
type snmpd_initrc_exec_t;
|
2008-02-07 16:37:47 +00:00
|
|
|
')
|
|
|
|
|
2008-05-15 13:10:34 +00:00
|
|
|
allow $1 snmpd_t:process { ptrace signal_perms getattr };
|
|
|
|
ps_process_pattern($1, snmpd_t)
|
2008-10-17 15:52:39 +00:00
|
|
|
|
2008-12-03 15:21:33 +00:00
|
|
|
init_labeled_script_domtrans($1, snmpd_initrc_exec_t)
|
|
|
|
domain_system_change_exemption($1)
|
|
|
|
role_transition $2 snmpd_initrc_exec_t system_r;
|
|
|
|
allow $2 system_r;
|
|
|
|
|
2008-02-07 16:37:47 +00:00
|
|
|
logging_list_logs($1)
|
2008-12-03 15:21:33 +00:00
|
|
|
admin_pattern($1, snmpd_log_t)
|
2008-02-07 16:37:47 +00:00
|
|
|
|
|
|
|
files_list_var_lib($1)
|
2008-12-03 15:21:33 +00:00
|
|
|
admin_pattern($1, snmpd_var_lib_t)
|
2008-02-07 16:37:47 +00:00
|
|
|
|
|
|
|
files_list_pids($1)
|
2008-12-03 15:21:33 +00:00
|
|
|
admin_pattern($1, snmpd_var_run_t)
|
2008-02-07 16:37:47 +00:00
|
|
|
')
|