|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
policy_module(kerberos,1.0)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
########################################
|
|
Chris PeBenito |
5e1ed4 |
#
|
|
Chris PeBenito |
5e1ed4 |
# Declarations
|
|
Chris PeBenito |
5e1ed4 |
#
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
type kadmind_t;
|
|
Chris PeBenito |
5e1ed4 |
type kadmind_exec_t;
|
|
Chris PeBenito |
5e1ed4 |
init_daemon_domain(kadmind_t,kadmind_exec_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
type kadmind_log_t;
|
|
Chris PeBenito |
5e1ed4 |
logging_log_file(kadmind_log_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
type kadmind_tmp_t;
|
|
Chris PeBenito |
5e1ed4 |
files_tmp_file(kadmind_tmp_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
type kadmind_var_run_t;
|
|
Chris PeBenito |
5e1ed4 |
files_pid_file(kadmind_var_run_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
type krb5_conf_t;
|
|
Chris PeBenito |
5e1ed4 |
files_type(krb5_conf_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
# types for general configuration files in /etc
|
|
Chris PeBenito |
5e1ed4 |
type krb5_keytab_t; #, secure_file_type;
|
|
Chris PeBenito |
5e1ed4 |
files_type(krb5_keytab_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
# types for KDC configs and principal file(s)
|
|
Chris PeBenito |
5e1ed4 |
type krb5kdc_conf_t;
|
|
Chris PeBenito |
5e1ed4 |
files_type(krb5kdc_conf_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
# types for KDC principal file(s)
|
|
Chris PeBenito |
5e1ed4 |
type krb5kdc_principal_t;
|
|
Chris PeBenito |
5e1ed4 |
files_type(krb5kdc_principal_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
type krb5kdc_t;
|
|
Chris PeBenito |
5e1ed4 |
type krb5kdc_exec_t;
|
|
Chris PeBenito |
5e1ed4 |
init_daemon_domain(krb5kdc_t,krb5kdc_exec_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
type krb5kdc_log_t;
|
|
Chris PeBenito |
5e1ed4 |
logging_log_file(krb5kdc_log_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
type krb5kdc_tmp_t;
|
|
Chris PeBenito |
5e1ed4 |
files_tmp_file(krb5kdc_tmp_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
type krb5kdc_var_run_t;
|
|
Chris PeBenito |
5e1ed4 |
files_pid_file(krb5kdc_var_run_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
########################################
|
|
Chris PeBenito |
5e1ed4 |
#
|
|
Chris PeBenito |
5e1ed4 |
# kadmind local policy
|
|
Chris PeBenito |
5e1ed4 |
#
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
# Use capabilities. Surplus capabilities may be allowed.
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t self:capability { setuid setgid chown fowner dac_override sys_nice };
|
|
Chris PeBenito |
5e1ed4 |
dontaudit kadmind_t self:capability sys_tty_config;
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t self:tcp_socket connected_stream_socket_perms;
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t self:netlink_route_socket r_netlink_socket_perms;
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t self:unix_dgram_socket { connect create write };
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t kadmind_log_t:file create_file_perms;
|
|
Chris PeBenito |
5e1ed4 |
logging_create_log(kadmind_t,kadmind_log_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t krb5_conf_t:file r_file_perms;
|
|
Chris PeBenito |
5e1ed4 |
dontaudit kadmind_t krb5_conf_t:file write;
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t krb5kdc_conf_t:dir search;
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t krb5kdc_conf_t:file r_file_perms;
|
|
Chris PeBenito |
5e1ed4 |
dontaudit kadmind_t krb5kdc_conf_t:file write;
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t krb5kdc_principal_t:file { getattr lock read write setattr };
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
can_exec(kadmind_t, kadmind_exec_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t kadmind_tmp_t:dir create_dir_perms;
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t kadmind_tmp_t:file create_file_perms;
|
|
Chris PeBenito |
5e1ed4 |
files_create_tmp_files(kadmind_t, kadmind_tmp_t, { file dir })
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow kadmind_t kadmind_var_run_t:file { getattr create read write append setattr unlink };
|
|
Chris PeBenito |
5e1ed4 |
files_create_pid(kadmind_t,kadmind_var_run_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
kernel_read_kernel_sysctl(kadmind_t)
|
|
Chris PeBenito |
b24f35 |
kernel_list_proc(kadmind_t)
|
|
Chris PeBenito |
b24f35 |
kernel_read_proc_symlinks(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_sendrecv_all_if(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_raw_sendrecv_all_if(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_sendrecv_all_nodes(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_raw_sendrecv_all_nodes(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_sendrecv_all_ports(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_bind_all_nodes(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_bind_kerberos_admin_port(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_udp_bind_kerberos_admin_port(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_bind_reserved_port(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_dontaudit_tcp_bind_all_reserved_ports(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
dev_read_sysfs(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
dev_read_rand(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
dev_read_urand(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
fs_getattr_all_fs(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
fs_search_auto_mountpoints(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
term_dontaudit_use_console(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
domain_use_wide_inherit_fd(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
files_read_etc_files(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
init_use_fd(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
init_use_script_pty(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
libs_use_ld_so(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
libs_use_shared_libs(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
logging_send_syslog_msg(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
miscfiles_read_localization(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
sysnet_read_config(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
userdom_dontaudit_use_unpriv_user_fd(kadmind_t)
|
|
Chris PeBenito |
b24f35 |
userdom_dontaudit_search_sysadm_home_dir(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
ifdef(`targeted_policy', `
|
|
Chris PeBenito |
5e1ed4 |
term_dontaudit_use_unallocated_tty(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
term_dontaudit_use_generic_pty(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
files_dontaudit_read_root_file(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
')
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
optional_policy(`nis.te',`
|
|
Chris PeBenito |
5e1ed4 |
nis_use_ypbind(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
')
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
ae9e27 |
optional_policy(`selinuxutil.te',`
|
|
Chris PeBenito |
5e1ed4 |
seutil_sigchld_newrole(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
')
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
optional_policy(`udev.te', `
|
|
Chris PeBenito |
5e1ed4 |
udev_read_db(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
')
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
ifdef(`TODO',`
|
|
Chris PeBenito |
5e1ed4 |
optional_policy(`rhgb.te',`
|
|
Chris PeBenito |
5e1ed4 |
rhgb_domain(kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
')
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
# cjp: not sure, but I think this has no effect
|
|
Chris PeBenito |
5e1ed4 |
can_tcp_connect(kerberos_admin_port_t, kadmind_t)
|
|
Chris PeBenito |
5e1ed4 |
') dnl end TODO
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
########################################
|
|
Chris PeBenito |
5e1ed4 |
#
|
|
Chris PeBenito |
5e1ed4 |
# Krb5kdc local policy
|
|
Chris PeBenito |
5e1ed4 |
#
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
# Use capabilities. Surplus capabilities may be allowed.
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t self:capability { setuid setgid net_admin chown fowner dac_override sys_nice };
|
|
Chris PeBenito |
5e1ed4 |
dontaudit krb5kdc_t self:capability sys_tty_config;
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t self:tcp_socket connected_stream_socket_perms;
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t self:netlink_route_socket r_netlink_socket_perms;
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t krb5_conf_t:file r_file_perms;
|
|
Chris PeBenito |
5e1ed4 |
dontaudit krb5kdc_t krb5_conf_t:file write;
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
can_exec(krb5kdc_t, krb5kdc_exec_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t krb5kdc_conf_t:dir search;
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t krb5kdc_conf_t:file r_file_perms;
|
|
Chris PeBenito |
5e1ed4 |
dontaudit krb5kdc_t krb5kdc_conf_t:file write;
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t krb5kdc_log_t:file create_file_perms;
|
|
Chris PeBenito |
5e1ed4 |
logging_create_log(krb5kdc_t,krb5kdc_log_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t krb5kdc_principal_t:file r_file_perms;
|
|
Chris PeBenito |
5e1ed4 |
dontaudit krb5kdc_t krb5kdc_principal_t:file write;
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t krb5kdc_tmp_t:dir create_dir_perms;
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t krb5kdc_tmp_t:file create_file_perms;
|
|
Chris PeBenito |
5e1ed4 |
files_create_tmp_files(krb5kdc_t, krb5kdc_tmp_t, { file dir })
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t krb5kdc_var_run_t:file { getattr create read write append setattr unlink };
|
|
Chris PeBenito |
5e1ed4 |
files_create_pid(krb5kdc_t,krb5kdc_var_run_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
kernel_read_system_state(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
kernel_read_kernel_sysctl(krb5kdc_t)
|
|
Chris PeBenito |
b24f35 |
kernel_list_proc(krb5kdc_t)
|
|
Chris PeBenito |
b24f35 |
kernel_read_proc_symlinks(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_sendrecv_all_if(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_raw_sendrecv_all_if(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_sendrecv_all_nodes(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_raw_sendrecv_all_nodes(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_sendrecv_all_ports(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_bind_all_nodes(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_tcp_bind_kerberos_port(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
corenet_udp_bind_kerberos_port(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
dev_read_sysfs(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
dev_read_urand(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
fs_getattr_all_fs(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
fs_search_auto_mountpoints(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
term_dontaudit_use_console(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
domain_use_wide_inherit_fd(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
files_read_etc_files(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
init_use_fd(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
init_use_script_pty(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
libs_use_ld_so(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
libs_use_shared_libs(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
logging_send_syslog_msg(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
miscfiles_read_localization(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
sysnet_read_config(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
userdom_dontaudit_use_unpriv_user_fd(krb5kdc_t)
|
|
Chris PeBenito |
b24f35 |
userdom_dontaudit_search_sysadm_home_dir(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
ifdef(`targeted_policy', `
|
|
Chris PeBenito |
5e1ed4 |
term_dontaudit_use_unallocated_tty(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
term_dontaudit_use_generic_pty(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
files_dontaudit_read_root_file(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
')
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
optional_policy(`nis.te',`
|
|
Chris PeBenito |
5e1ed4 |
nis_use_ypbind(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
')
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
ae9e27 |
optional_policy(`selinuxutil.te',`
|
|
Chris PeBenito |
5e1ed4 |
seutil_sigchld_newrole(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
')
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
optional_policy(`udev.te', `
|
|
Chris PeBenito |
5e1ed4 |
udev_read_db(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
')
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
ifdef(`TODO',`
|
|
Chris PeBenito |
5e1ed4 |
optional_policy(`rhgb.te',`
|
|
Chris PeBenito |
5e1ed4 |
rhgb_domain(krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
')
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
# Allow user programs to talk to KDC
|
|
Chris PeBenito |
5e1ed4 |
allow krb5kdc_t userdomain:udp_socket recvfrom;
|
|
Chris PeBenito |
5e1ed4 |
allow userdomain krb5kdc_t:udp_socket recvfrom;
|
|
Chris PeBenito |
5e1ed4 |
|
|
Chris PeBenito |
5e1ed4 |
# cjp: not sure, but I think these have no effect
|
|
Chris PeBenito |
5e1ed4 |
can_udp_send(kerberos_port_t, krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
can_udp_send(krb5kdc_t, kerberos_port_t)
|
|
Chris PeBenito |
5e1ed4 |
can_tcp_connect(kerberos_port_t, krb5kdc_t)
|
|
Chris PeBenito |
5e1ed4 |
') dnl end TODO
|