2005-06-30 21:11:54 +00:00
|
|
|
## <summary>MIT Kerberos admin and KDC</summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## This policy supports:
|
|
|
|
## </p>
|
|
|
|
## <p>
|
|
|
|
## Servers:
|
|
|
|
## <ul>
|
|
|
|
## <li>kadmind</li>
|
|
|
|
## <li>krb5kdc</li>
|
|
|
|
## </ul>
|
2005-07-01 13:10:57 +00:00
|
|
|
## </p>
|
2005-06-30 21:11:54 +00:00
|
|
|
## <p>
|
|
|
|
## Clients:
|
|
|
|
## <ul>
|
|
|
|
## <li>kinit</li>
|
|
|
|
## <li>kdestroy</li>
|
|
|
|
## <li>klist</li>
|
|
|
|
## <li>ksu (incomplete)</li>
|
|
|
|
## </ul>
|
2005-07-01 13:10:57 +00:00
|
|
|
## </p>
|
2005-06-30 21:11:54 +00:00
|
|
|
## </desc>
|
|
|
|
|
2008-10-09 14:01:53 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute kadmind in the current domain
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`kerberos_exec_kadmind',`
|
|
|
|
gen_require(`
|
|
|
|
type kadmind_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
can_exec($1, kadmind_exec_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute a domain transition to run kpropd.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed to transition.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`kerberos_domtrans_kpropd',`
|
|
|
|
gen_require(`
|
|
|
|
type kpropd_t, kpropd_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
domtrans_pattern($1, kpropd_exec_t, kpropd_t)
|
|
|
|
')
|
|
|
|
|
2005-06-30 21:11:54 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Use kerberos services
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-30 21:11:54 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-30 21:11:54 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`kerberos_use',`
|
|
|
|
gen_require(`
|
2008-07-23 21:38:39 +00:00
|
|
|
type krb5_conf_t, krb5kdc_conf_t;
|
2005-06-30 21:11:54 +00:00
|
|
|
')
|
|
|
|
|
2005-08-31 15:25:12 +00:00
|
|
|
files_search_etc($1)
|
|
|
|
allow $1 krb5_conf_t:file { getattr read };
|
|
|
|
dontaudit $1 krb5_conf_t:file write;
|
2007-02-16 23:01:42 +00:00
|
|
|
dontaudit $1 krb5kdc_conf_t:dir list_dir_perms;
|
2007-02-26 17:04:56 +00:00
|
|
|
dontaudit $1 krb5kdc_conf_t:file rw_file_perms;
|
2005-08-31 15:25:12 +00:00
|
|
|
|
2008-10-09 14:01:53 +00:00
|
|
|
#kerberos libraries are attempting to set the correct file context
|
|
|
|
dontaudit $1 self:process setfscreate;
|
|
|
|
selinux_dontaudit_validate_context($1)
|
|
|
|
seutil_dontaudit_read_file_contexts($1)
|
|
|
|
|
2005-06-30 21:11:54 +00:00
|
|
|
tunable_policy(`allow_kerberos',`
|
2005-08-31 15:25:12 +00:00
|
|
|
allow $1 self:tcp_socket create_socket_perms;
|
|
|
|
allow $1 self:udp_socket create_socket_perms;
|
2006-05-30 19:46:34 +00:00
|
|
|
|
2007-06-27 15:23:21 +00:00
|
|
|
corenet_all_recvfrom_unlabeled($1)
|
|
|
|
corenet_all_recvfrom_netlabel($1)
|
2005-06-30 21:11:54 +00:00
|
|
|
corenet_tcp_sendrecv_all_if($1)
|
|
|
|
corenet_udp_sendrecv_all_if($1)
|
|
|
|
corenet_tcp_sendrecv_all_nodes($1)
|
|
|
|
corenet_udp_sendrecv_all_nodes($1)
|
|
|
|
corenet_tcp_sendrecv_kerberos_port($1)
|
|
|
|
corenet_udp_sendrecv_kerberos_port($1)
|
|
|
|
corenet_tcp_bind_all_nodes($1)
|
|
|
|
corenet_udp_bind_all_nodes($1)
|
2005-09-16 19:36:10 +00:00
|
|
|
corenet_tcp_connect_kerberos_port($1)
|
2006-12-04 20:10:56 +00:00
|
|
|
corenet_tcp_connect_ocsp_port($1)
|
2006-05-30 19:46:34 +00:00
|
|
|
corenet_sendrecv_kerberos_client_packets($1)
|
2006-12-04 20:10:56 +00:00
|
|
|
corenet_sendrecv_ocsp_client_packets($1)
|
2005-06-30 21:11:54 +00:00
|
|
|
')
|
2007-02-16 23:01:42 +00:00
|
|
|
|
|
|
|
optional_policy(`
|
|
|
|
tunable_policy(`allow_kerberos',`
|
|
|
|
pcscd_stream_connect($1)
|
|
|
|
')
|
|
|
|
')
|
2005-06-30 21:11:54 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read the kerberos configuration file (/etc/krb5.conf).
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-06-30 21:11:54 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-06-30 21:11:54 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-06-30 21:11:54 +00:00
|
|
|
#
|
2005-08-17 14:14:07 +00:00
|
|
|
interface(`kerberos_read_config',`
|
2005-06-30 21:11:54 +00:00
|
|
|
gen_require(`
|
|
|
|
type krb5_conf_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_etc($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 krb5_conf_t:file read_file_perms;
|
2005-06-30 21:11:54 +00:00
|
|
|
')
|
2005-08-17 14:14:07 +00:00
|
|
|
|
2005-09-20 18:49:13 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to write the kerberos
|
|
|
|
## configuration file (/etc/krb5.conf).
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-20 18:49:13 +00:00
|
|
|
## Domain to not audit.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-20 18:49:13 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`kerberos_dontaudit_write_config',`
|
|
|
|
gen_require(`
|
|
|
|
type krb5_conf_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 krb5_conf_t:file write;
|
|
|
|
')
|
|
|
|
|
2005-08-17 14:14:07 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read and write the kerberos configuration file (/etc/krb5.conf).
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-08-17 14:14:07 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-08-17 14:14:07 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-08-17 14:14:07 +00:00
|
|
|
#
|
|
|
|
interface(`kerberos_rw_config',`
|
|
|
|
gen_require(`
|
|
|
|
type krb5_conf_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_etc($1)
|
|
|
|
allow $1 krb5_conf_t:file rw_file_perms;
|
|
|
|
')
|
2005-09-20 17:11:53 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read the kerberos key table.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-09-20 17:11:53 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-09-20 17:11:53 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2005-09-20 17:11:53 +00:00
|
|
|
#
|
|
|
|
interface(`kerberos_read_keytab',`
|
|
|
|
gen_require(`
|
|
|
|
type krb5_keytab_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_etc($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 krb5_keytab_t:file read_file_perms;
|
2005-09-20 17:11:53 +00:00
|
|
|
')
|
2007-04-10 17:20:07 +00:00
|
|
|
|
2008-10-09 14:01:53 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create a derived type for kerberos keytab
|
|
|
|
## </summary>
|
|
|
|
## <param name="prefix">
|
|
|
|
## <summary>
|
|
|
|
## The prefix to be used for deriving type names.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
template(`kerberos_keytab_template',`
|
|
|
|
type $1_keytab_t;
|
|
|
|
files_type($1_keytab_t)
|
|
|
|
|
|
|
|
allow $2 $1_keytab_t:file read_file_perms;
|
|
|
|
|
|
|
|
kerberos_read_keytab($2)
|
|
|
|
kerberos_use($2)
|
|
|
|
')
|
|
|
|
|
2007-04-10 17:20:07 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read the kerberos kdc configuration file (/etc/krb5kdc.conf).
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <rolecap/>
|
|
|
|
#
|
|
|
|
interface(`kerberos_read_kdc_config',`
|
|
|
|
gen_require(`
|
|
|
|
type krb5kdc_conf_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_etc($1)
|
2008-10-09 14:01:53 +00:00
|
|
|
read_files_pattern($1, krb5kdc_conf_t, krb5kdc_conf_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read the kerberos kdc configuration file (/etc/krb5kdc.conf).
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <rolecap/>
|
|
|
|
#
|
|
|
|
interface(`kerberos_manage_host_rcache',`
|
|
|
|
gen_require(`
|
|
|
|
type krb5_host_rcache_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
# creates files as system_u no matter what the selinux user
|
|
|
|
# cjp: should be in the below tunable but typeattribute
|
|
|
|
# does not work in conditionals
|
|
|
|
domain_obj_id_change_exemption($1)
|
|
|
|
|
|
|
|
tunable_policy(`allow_kerberos',`
|
|
|
|
allow $1 self:process setfscreate;
|
|
|
|
|
|
|
|
selinux_validate_context($1)
|
|
|
|
|
|
|
|
seutil_read_file_contexts($1)
|
|
|
|
|
|
|
|
allow $1 krb5_host_rcache_t:file manage_file_perms;
|
|
|
|
files_search_tmp($1)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Connect to krb524 service
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`kerberos_connect_524',`
|
|
|
|
tunable_policy(`allow_kerberos',`
|
|
|
|
allow $1 self:udp_socket create_socket_perms;
|
|
|
|
|
|
|
|
corenet_all_recvfrom_unlabeled($1)
|
|
|
|
corenet_udp_sendrecv_generic_if($1)
|
|
|
|
corenet_udp_sendrecv_all_nodes($1)
|
|
|
|
corenet_udp_sendrecv_kerberos_master_port($1)
|
|
|
|
corenet_sendrecv_kerberos_master_client_packets($1)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## All of the rules required to administrate
|
|
|
|
## an kerberos environment
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
|
|
|
## The role to be allowed to manage the kerberos domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <rolecap/>
|
|
|
|
#
|
|
|
|
interface(`kerberos_admin',`
|
|
|
|
gen_require(`
|
|
|
|
type kadmind_t, krb5kdc_t, kerberos_initrc_exec_t;
|
|
|
|
type kadmind_log_t, kadmind_tmp_t, kadmind_var_run_t;
|
|
|
|
type krb5_conf_t, krb5_keytab_t, krb5kdc_conf_t;
|
|
|
|
type krb5kdc_principal_t, krb5kdc_tmp_t;
|
|
|
|
type krb5kdc_var_run_t, krb5_host_rcache_t;
|
|
|
|
type kadmind_spool_t, kadmind_var_lib_t, kpropd_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 kadmind_t:process { ptrace signal_perms };
|
|
|
|
ps_process_pattern($1, kadmind_t)
|
|
|
|
|
|
|
|
allow $1 krb5kdc_t:process { ptrace signal_perms };
|
|
|
|
ps_process_pattern($1, krb5kdc_t)
|
|
|
|
|
|
|
|
allow $1 kpropd_t:process { ptrace signal_perms };
|
|
|
|
ps_process_pattern($1, kpropd_t)
|
|
|
|
|
|
|
|
init_labeled_script_domtrans($1, kerberos_initrc_exec_t)
|
|
|
|
domain_system_change_exemption($1)
|
|
|
|
role_transition $2 kerberos_initrc_exec_t system_r;
|
|
|
|
allow $2 system_r;
|
|
|
|
|
|
|
|
logging_list_logs($1)
|
|
|
|
admin_pattern($1, kadmind_log_t)
|
|
|
|
|
|
|
|
files_list_spool($1)
|
|
|
|
admin_pattern($1, kadmind_spool_t)
|
|
|
|
|
|
|
|
files_list_tmp($1)
|
|
|
|
admin_pattern($1, kadmind_tmp_t)
|
|
|
|
|
|
|
|
files_list_var_lib($1)
|
|
|
|
admin_pattern($1, kadmind_var_lib_t)
|
|
|
|
|
|
|
|
files_list_pids($1)
|
|
|
|
admin_pattern($1, kadmind_var_run_t)
|
|
|
|
|
|
|
|
admin_pattern($1, krb5_conf_t)
|
|
|
|
|
|
|
|
admin_pattern($1, krb5_host_rcache_t)
|
|
|
|
|
|
|
|
admin_pattern($1, krb5_keytab_t)
|
|
|
|
|
|
|
|
admin_pattern($1, krb5kdc_principal_t)
|
|
|
|
|
|
|
|
admin_pattern($1, krb5kdc_tmp_t)
|
2007-04-10 17:20:07 +00:00
|
|
|
|
2008-10-09 14:01:53 +00:00
|
|
|
admin_pattern($1, krb5kdc_var_run_t)
|
2007-04-10 17:20:07 +00:00
|
|
|
')
|