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