|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
policy_module(nsd,1.0.1)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Declarations
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nsd_t;
|
|
Chris PeBenito |
17de1b |
type nsd_exec_t;
|
|
Chris PeBenito |
17de1b |
init_daemon_domain(nsd_t,nsd_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# A type for configuration files of nsd
|
|
Chris PeBenito |
17de1b |
type nsd_conf_t;
|
|
Chris PeBenito |
17de1b |
files_type(nsd_conf_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nsd_crond_t;
|
|
Chris PeBenito |
17de1b |
domain_type(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
domain_entry_file(nsd_crond_t,nsd_exec_t)
|
|
Chris PeBenito |
17de1b |
role system_r types nsd_crond_t;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# a type for nsd.db
|
|
Chris PeBenito |
17de1b |
type nsd_db_t;
|
|
Chris PeBenito |
17de1b |
files_type(nsd_db_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
type nsd_var_run_t;
|
|
Chris PeBenito |
17de1b |
files_pid_file(nsd_var_run_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# A type for zone files
|
|
Chris PeBenito |
17de1b |
type nsd_zone_t;
|
|
Chris PeBenito |
17de1b |
files_type(nsd_zone_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# NSD Local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nsd_t self:capability { dac_override chown setuid setgid };
|
|
Chris PeBenito |
17de1b |
dontaudit nsd_t self:capability sys_tty_config;
|
|
Chris PeBenito |
17de1b |
allow nsd_t self:process signal_perms;
|
|
Chris PeBenito |
17de1b |
allow nsd_t self:tcp_socket create_stream_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow nsd_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nsd_t nsd_conf_t:dir r_dir_perms;
|
|
Chris PeBenito |
17de1b |
allow nsd_t nsd_conf_t:file r_file_perms;
|
|
Chris PeBenito |
17de1b |
allow nsd_t nsd_conf_t:lnk_file { getattr read };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nsd_t nsd_db_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
type_transition nsd_t nsd_zone_t:file nsd_db_t;
|
|
Chris PeBenito |
17de1b |
allow nsd_t nsd_zone_t:dir rw_dir_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nsd_t nsd_var_run_t:file create_file_perms;
|
|
Chris PeBenito |
17de1b |
allow nsd_t nsd_var_run_t:dir rw_dir_perms;
|
|
Chris PeBenito |
17de1b |
files_pid_filetrans(nsd_t,nsd_var_run_t,file)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nsd_t nsd_zone_t:dir r_dir_perms;
|
|
Chris PeBenito |
17de1b |
allow nsd_t nsd_zone_t:file r_file_perms;
|
|
Chris PeBenito |
17de1b |
allow nsd_t nsd_zone_t:lnk_file { getattr read };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
can_exec(nsd_t,nsd_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(nsd_t)
|
|
Chris PeBenito |
17de1b |
kernel_read_kernel_sysctls(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corenet_non_ipsec_sendrecv(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_generic_if(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_generic_if(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_nodes(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_nodes(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_ports(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_bind_all_nodes(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_bind_all_nodes(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_bind_dns_port(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_bind_dns_port(nsd_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_dns_server_packets(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
dev_read_sysfs(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_use_interactive_fds(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(nsd_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
fs_getattr_all_fs(nsd_t)
|
|
Chris PeBenito |
17de1b |
fs_search_auto_mountpoints(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_console(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
init_use_fds(nsd_t)
|
|
Chris PeBenito |
17de1b |
init_use_script_ptys(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(nsd_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
sysnet_read_config(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_use_unpriv_user_fds(nsd_t)
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_search_sysadm_home_dirs(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
ifdef(`targeted_policy',`
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_unallocated_ttys(nsd_t)
|
|
Chris PeBenito |
17de1b |
term_dontaudit_use_generic_ptys(nsd_t)
|
|
Chris PeBenito |
17de1b |
files_dontaudit_read_root_files(nsd_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nis_use_ypbind(nsd_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
seutil_sigchld_newrole(nsd_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
udev_read_db(nsd_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
########################################
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
# Zone update cron job local policy
|
|
Chris PeBenito |
17de1b |
#
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# kill capability for root cron job and non-root daemon
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t self:capability { dac_override kill };
|
|
Chris PeBenito |
17de1b |
dontaudit nsd_crond_t self:capability sys_nice;
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t self:process { setsched signal_perms };
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t self:fifo_file rw_file_perms;
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t self:tcp_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t self:udp_socket create_socket_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t nsd_conf_t:file { getattr read ioctl };
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t nsd_db_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
type_transition nsd_crond_t nsd_zone_t:file nsd_db_t;
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t nsd_zone_t:dir rw_dir_perms;
|
|
Chris PeBenito |
17de1b |
files_search_var_lib(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t nsd_t:process signal;
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t nsd_t:dir { search getattr read };
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t nsd_t:{ file lnk_file } { read getattr };
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t nsd_t:process getattr;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t nsd_zone_t:file manage_file_perms;
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t nsd_zone_t:dir rw_dir_perms;
|
|
Chris PeBenito |
17de1b |
type_transition nsd_crond_t nsd_conf_t:file nsd_zone_t;
|
|
Chris PeBenito |
17de1b |
allow nsd_crond_t nsd_conf_t:dir rw_dir_perms;
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
can_exec(nsd_crond_t,nsd_exec_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
kernel_read_system_state(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corecmd_exec_bin(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
corecmd_exec_sbin(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
corecmd_exec_shell(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
corenet_non_ipsec_sendrecv(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_generic_if(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_generic_if(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_nodes(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_nodes(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_sendrecv_all_ports(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_udp_sendrecv_all_ports(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_tcp_connect_all_ports(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
corenet_sendrecv_all_client_packets(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
# for SSP
|
|
Chris PeBenito |
17de1b |
dev_read_urand(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
domain_dontaudit_read_all_domains_state(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
files_read_etc_files(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
files_read_etc_runtime_files(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
files_search_var_lib(nsd_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
libs_use_ld_so(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
libs_use_shared_libs(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
logging_send_syslog_msg(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
miscfiles_read_localization(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
sysnet_read_config(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
userdom_dontaudit_search_sysadm_home_dirs(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
cron_system_entry(nsd_crond_t,nsd_exec_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nis_use_ypbind(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
')
|
|
Chris PeBenito |
17de1b |
|
|
Chris PeBenito |
17de1b |
optional_policy(`
|
|
Chris PeBenito |
17de1b |
nscd_read_pid(nsd_crond_t)
|
|
Chris PeBenito |
17de1b |
')
|