112 lines
2.8 KiB
Plaintext
112 lines
2.8 KiB
Plaintext
|
|
policy_module(ccs,1.0.1)
|
|
|
|
########################################
|
|
#
|
|
# Declarations
|
|
#
|
|
|
|
type ccs_t;
|
|
type ccs_exec_t;
|
|
init_daemon_domain(ccs_t, ccs_exec_t)
|
|
|
|
# pid files
|
|
type cluster_conf_t;
|
|
files_type(cluster_conf_t)
|
|
|
|
# log files
|
|
type ccs_var_log_t;
|
|
logging_log_file(ccs_var_log_t)
|
|
|
|
# var lib files
|
|
type ccs_var_lib_t;
|
|
logging_log_file(ccs_var_lib_t)
|
|
|
|
# pid files
|
|
type ccs_var_run_t;
|
|
files_pid_file(ccs_var_run_t)
|
|
|
|
########################################
|
|
#
|
|
# ccs local policy
|
|
#
|
|
|
|
allow ccs_t self:capability { ipc_lock sys_nice sys_resource sys_admin };
|
|
allow ccs_t self:process { signal setrlimit setsched };
|
|
allow ccs_t self:fifo_file { read write };
|
|
allow ccs_t self:unix_stream_socket { connectto create_stream_socket_perms };
|
|
allow ccs_t self:unix_dgram_socket create_socket_perms;
|
|
allow ccs_t self:netlink_route_socket r_netlink_socket_perms;
|
|
allow ccs_t self:tcp_socket create_stream_socket_perms;
|
|
allow ccs_t self:udp_socket { create_socket_perms listen recv_msg send_msg };
|
|
# cjp: this needs to be fixed to be specific
|
|
allow ccs_t self:socket create_socket_perms;
|
|
|
|
manage_files_pattern(ccs_t,cluster_conf_t,cluster_conf_t)
|
|
|
|
# log files
|
|
manage_files_pattern(ccs_t,ccs_var_log_t,ccs_var_log_t)
|
|
manage_sock_files_pattern(ccs_t,ccs_var_log_t,ccs_var_log_t)
|
|
allow ccs_t ccs_var_log_t:dir setattr;
|
|
logging_log_filetrans(ccs_t,ccs_var_log_t,{ sock_file file dir })
|
|
|
|
# var lib files
|
|
manage_dirs_pattern(ccs_t,ccs_var_lib_t,ccs_var_lib_t)
|
|
manage_files_pattern(ccs_t,ccs_var_lib_t,ccs_var_lib_t)
|
|
files_var_lib_filetrans(ccs_t,ccs_var_lib_t,{ file dir })
|
|
|
|
# pid file
|
|
manage_dirs_pattern(ccs_t,ccs_var_run_t,ccs_var_run_t)
|
|
manage_files_pattern(ccs_t,ccs_var_run_t,ccs_var_run_t)
|
|
manage_sock_files_pattern(ccs_t,ccs_var_run_t,ccs_var_run_t)
|
|
files_pid_filetrans(ccs_t,ccs_var_run_t, { dir file sock_file })
|
|
|
|
kernel_read_kernel_sysctls(ccs_t)
|
|
|
|
corecmd_list_sbin(ccs_t)
|
|
corecmd_exec_bin(ccs_t)
|
|
|
|
corenet_non_ipsec_sendrecv(ccs_t)
|
|
corenet_tcp_sendrecv_all_if(ccs_t)
|
|
corenet_udp_sendrecv_all_if(ccs_t)
|
|
corenet_tcp_sendrecv_all_nodes(ccs_t)
|
|
corenet_udp_sendrecv_all_nodes(ccs_t)
|
|
corenet_tcp_sendrecv_all_ports(ccs_t)
|
|
corenet_udp_sendrecv_all_ports(ccs_t)
|
|
corenet_tcp_bind_all_nodes(ccs_t)
|
|
corenet_udp_bind_all_nodes(ccs_t)
|
|
corenet_tcp_bind_cluster_port(ccs_t)
|
|
corenet_udp_bind_cluster_port(ccs_t)
|
|
corenet_udp_bind_netsupport_port(ccs_t)
|
|
|
|
dev_read_urand(ccs_t)
|
|
|
|
files_read_etc_files(ccs_t)
|
|
files_read_etc_runtime_files(ccs_t)
|
|
|
|
init_dontaudit_use_fds(ccs_t)
|
|
init_rw_script_tmp_files(ccs_t)
|
|
|
|
libs_use_ld_so(ccs_t)
|
|
libs_use_shared_libs(ccs_t)
|
|
|
|
logging_send_syslog_msg(ccs_t)
|
|
|
|
miscfiles_read_localization(ccs_t)
|
|
|
|
sysnet_dns_name_resolve(ccs_t)
|
|
|
|
ifdef(`hide_broken_symptoms', `
|
|
corecmd_dontaudit_write_sbin_dirs(ccs_t)
|
|
files_manage_isid_type_files(ccs_t)
|
|
')
|
|
|
|
ifdef(`targeted_policy',`
|
|
term_dontaudit_use_generic_ptys(ccs_t)
|
|
term_dontaudit_use_unallocated_ttys(ccs_t)
|
|
')
|
|
|
|
optional_policy(`
|
|
unconfined_use_fds(ccs_t)
|
|
')
|