|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
policy_module(psad, 1.0.0)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
########################################
|
|
Chris PeBenito |
a5ef55 |
#
|
|
Chris PeBenito |
a5ef55 |
# Declarations
|
|
Chris PeBenito |
a5ef55 |
#
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
type psad_t;
|
|
Chris PeBenito |
a5ef55 |
type psad_exec_t;
|
|
Chris PeBenito |
a5ef55 |
init_daemon_domain(psad_t, psad_exec_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# config files
|
|
Chris PeBenito |
a5ef55 |
type psad_etc_t;
|
|
Chris PeBenito |
a5ef55 |
files_type(psad_etc_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
type psad_initrc_exec_t;
|
|
Chris PeBenito |
a5ef55 |
init_script_file(psad_initrc_exec_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# var/lib files
|
|
Chris PeBenito |
a5ef55 |
type psad_var_lib_t;
|
|
Chris PeBenito |
a5ef55 |
files_type(psad_var_lib_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# log files
|
|
Chris PeBenito |
a5ef55 |
type psad_var_log_t;
|
|
Chris PeBenito |
a5ef55 |
logging_log_file(psad_var_log_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# pid files
|
|
Chris PeBenito |
a5ef55 |
type psad_var_run_t;
|
|
Chris PeBenito |
a5ef55 |
files_pid_file(psad_var_run_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# tmp files
|
|
Chris PeBenito |
a5ef55 |
type psad_tmp_t;
|
|
Chris PeBenito |
a5ef55 |
files_tmp_file(psad_tmp_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
########################################
|
|
Chris PeBenito |
a5ef55 |
#
|
|
Chris PeBenito |
a5ef55 |
# psad local policy
|
|
Chris PeBenito |
a5ef55 |
#
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
allow psad_t self:capability { net_admin net_raw setuid setgid dac_override };
|
|
Chris PeBenito |
a5ef55 |
dontaudit psad_t self:capability sys_tty_config;
|
|
Chris PeBenito |
a5ef55 |
allow psad_t self:process signull;
|
|
Chris PeBenito |
a5ef55 |
allow psad_t self:fifo_file rw_fifo_file_perms;
|
|
Chris PeBenito |
a5ef55 |
allow psad_t self:rawip_socket create_socket_perms;
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# config files
|
|
Chris PeBenito |
a5ef55 |
read_files_pattern(psad_t, psad_etc_t, psad_etc_t)
|
|
Chris PeBenito |
a5ef55 |
list_dirs_pattern(psad_t, psad_etc_t, psad_etc_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# log files
|
|
Chris PeBenito |
a5ef55 |
manage_files_pattern(psad_t, psad_var_log_t, psad_var_log_t)
|
|
Chris PeBenito |
a5ef55 |
manage_dirs_pattern(psad_t, psad_var_log_t, psad_var_log_t)
|
|
Chris PeBenito |
a5ef55 |
logging_log_filetrans(psad_t, psad_var_log_t, { file dir })
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# pid file
|
|
Chris PeBenito |
a5ef55 |
manage_files_pattern(psad_t, psad_var_run_t, psad_var_run_t)
|
|
Chris PeBenito |
a5ef55 |
manage_sock_files_pattern(psad_t, psad_var_run_t, psad_var_run_t)
|
|
Chris PeBenito |
a5ef55 |
files_pid_filetrans(psad_t, psad_var_run_t, { file sock_file })
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# tmp files
|
|
Chris PeBenito |
a5ef55 |
manage_dirs_pattern(psad_t, psad_tmp_t, psad_tmp_t)
|
|
Chris PeBenito |
a5ef55 |
manage_files_pattern(psad_t, psad_tmp_t, psad_tmp_t)
|
|
Chris PeBenito |
a5ef55 |
files_tmp_filetrans(psad_t, psad_tmp_t, { file dir })
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
# /var/lib files
|
|
Chris PeBenito |
a5ef55 |
search_dirs_pattern(psad_t, psad_var_lib_t, psad_var_lib_t)
|
|
Chris PeBenito |
a5ef55 |
manage_fifo_files_pattern(psad_t, psad_var_lib_t, psad_var_lib_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
kernel_read_system_state(psad_t)
|
|
Chris PeBenito |
a5ef55 |
kernel_read_network_state(psad_t)
|
|
Chris PeBenito |
a5ef55 |
kernel_read_net_sysctls(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
corecmd_exec_shell(psad_t)
|
|
Chris PeBenito |
a5ef55 |
corecmd_exec_bin(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
corenet_all_recvfrom_unlabeled(psad_t)
|
|
Chris PeBenito |
a5ef55 |
corenet_all_recvfrom_netlabel(psad_t)
|
|
Chris PeBenito |
a5ef55 |
corenet_tcp_sendrecv_generic_if(psad_t)
|
|
Chris PeBenito |
a5ef55 |
corenet_tcp_sendrecv_generic_node(psad_t)
|
|
Chris PeBenito |
a5ef55 |
corenet_tcp_bind_generic_node(psad_t)
|
|
Chris PeBenito |
a5ef55 |
corenet_tcp_sendrecv_all_ports(psad_t)
|
|
Chris PeBenito |
a5ef55 |
corenet_tcp_connect_whois_port(psad_t)
|
|
Chris PeBenito |
a5ef55 |
corenet_sendrecv_whois_client_packets(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
dev_read_urand(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
files_read_etc_runtime_files(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
fs_getattr_all_fs(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
auth_use_nsswitch(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
iptables_domtrans(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
logging_read_generic_logs(psad_t)
|
|
Chris PeBenito |
a5ef55 |
logging_read_syslog_config(psad_t)
|
|
Chris PeBenito |
a5ef55 |
logging_send_syslog_msg(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
miscfiles_read_localization(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
sysnet_exec_ifconfig(psad_t)
|
|
Chris PeBenito |
a5ef55 |
|
|
Chris PeBenito |
a5ef55 |
optional_policy(`
|
|
Chris PeBenito |
3f67f7 |
mta_send_mail(psad_t)
|
|
Chris PeBenito |
a5ef55 |
mta_read_queue(psad_t)
|
|
Chris PeBenito |
a5ef55 |
')
|