123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- policy_module(clamav, 1.11.1)
- ## <desc>
- ## <p>
- ## Determine whether clamscan can
- ## read user content files.
- ## </p>
- ## </desc>
- gen_tunable(clamav_read_user_content_files_clamscan, false)
- ## <desc>
- ## <p>
- ## Determine whether clamscan can read
- ## all non-security files.
- ## </p>
- ## </desc>
- gen_tunable(clamav_read_all_non_security_files_clamscan, false)
- ## <desc>
- ## <p>
- ## Determine whether can clamd use JIT compiler.
- ## </p>
- ## </desc>
- gen_tunable(clamd_use_jit, false)
- ########################################
- #
- # Declarations
- #
- type clamd_t;
- type clamd_exec_t;
- init_daemon_domain(clamd_t, clamd_exec_t)
- type clamd_etc_t;
- files_config_file(clamd_etc_t)
- type clamd_initrc_exec_t;
- init_script_file(clamd_initrc_exec_t)
- type clamd_unit_file_t;
- systemd_unit_file(clamd_unit_file_t)
- type clamd_tmp_t;
- files_tmp_file(clamd_tmp_t)
- type clamd_var_log_t;
- logging_log_file(clamd_var_log_t)
- type clamd_var_lib_t;
- files_type(clamd_var_lib_t)
- type clamd_var_run_t;
- files_pid_file(clamd_var_run_t)
- typealias clamd_var_run_t alias clamd_sock_t;
- type clamscan_t;
- type clamscan_exec_t;
- init_daemon_domain(clamscan_t, clamscan_exec_t)
- type clamscan_tmp_t;
- files_tmp_file(clamscan_tmp_t)
- type freshclam_t;
- type freshclam_exec_t;
- init_daemon_domain(freshclam_t, freshclam_exec_t)
- type freshclam_var_log_t;
- logging_log_file(freshclam_var_log_t)
- ########################################
- #
- # Clamd local policy
- #
- allow clamd_t self:capability { kill setgid setuid dac_override };
- dontaudit clamd_t self:capability sys_tty_config;
- allow clamd_t self:process signal;
- allow clamd_t self:fifo_file rw_fifo_file_perms;
- allow clamd_t self:unix_stream_socket { accept connectto listen };
- allow clamd_t self:tcp_socket { listen accept };
- allow clamd_t clamd_etc_t:dir list_dir_perms;
- read_files_pattern(clamd_t, clamd_etc_t, clamd_etc_t)
- read_lnk_files_pattern(clamd_t, clamd_etc_t, clamd_etc_t)
- manage_dirs_pattern(clamd_t, clamd_tmp_t, clamd_tmp_t)
- manage_files_pattern(clamd_t, clamd_tmp_t, clamd_tmp_t)
- files_tmp_filetrans(clamd_t, clamd_tmp_t, { file dir })
- manage_dirs_pattern(clamd_t, clamd_var_lib_t, clamd_var_lib_t)
- manage_files_pattern(clamd_t, clamd_var_lib_t, clamd_var_lib_t)
- manage_sock_files_pattern(clamd_t, clamd_var_lib_t, clamd_var_lib_t)
- manage_dirs_pattern(clamd_t, clamd_var_log_t, clamd_var_log_t)
- append_files_pattern(clamd_t, clamd_var_log_t, clamd_var_log_t)
- create_files_pattern(clamd_t, clamd_var_log_t, clamd_var_log_t)
- setattr_files_pattern(clamd_t, clamd_var_log_t, clamd_var_log_t)
- logging_log_filetrans(clamd_t, clamd_var_log_t, { dir file })
- manage_dirs_pattern(clamd_t, clamd_var_run_t, clamd_var_run_t)
- manage_files_pattern(clamd_t, clamd_var_run_t, clamd_var_run_t)
- manage_sock_files_pattern(clamd_t, clamd_var_run_t, clamd_var_run_t)
- files_pid_filetrans(clamd_t, clamd_var_run_t, { dir file sock_file })
- kernel_dontaudit_list_proc(clamd_t)
- kernel_read_sysctl(clamd_t)
- kernel_read_kernel_sysctls(clamd_t)
- kernel_read_system_state(clamd_t)
- kernel_read_vm_sysctls(clamd_t)
- corecmd_exec_shell(clamd_t)
- corenet_all_recvfrom_unlabeled(clamd_t)
- corenet_all_recvfrom_netlabel(clamd_t)
- corenet_tcp_sendrecv_generic_if(clamd_t)
- corenet_tcp_sendrecv_generic_node(clamd_t)
- corenet_tcp_sendrecv_all_ports(clamd_t)
- corenet_tcp_bind_generic_node(clamd_t)
- corenet_sendrecv_generic_server_packets(clamd_t)
- corenet_tcp_bind_generic_port(clamd_t)
- corenet_sendrecv_generic_client_packets(clamd_t)
- corenet_tcp_connect_generic_port(clamd_t)
- corenet_sendrecv_clamd_server_packets(clamd_t)
- corenet_tcp_bind_clamd_port(clamd_t)
- dev_read_rand(clamd_t)
- dev_read_urand(clamd_t)
- domain_use_interactive_fds(clamd_t)
- files_read_etc_runtime_files(clamd_t)
- files_search_spool(clamd_t)
- auth_use_nsswitch(clamd_t)
- logging_send_syslog_msg(clamd_t)
- miscfiles_read_localization(clamd_t)
- tunable_policy(`clamd_use_jit',`
- allow clamd_t self:process execmem;
- ',`
- dontaudit clamd_t self:process execmem;
- ')
- optional_policy(`
- amavis_read_lib_files(clamd_t)
- amavis_read_spool_files(clamd_t)
- amavis_spool_filetrans(clamd_t, clamd_var_run_t, sock_file)
- amavis_create_pid_files(clamd_t)
- ')
- optional_policy(`
- cron_use_fds(clamd_t)
- cron_use_system_job_fds(clamd_t)
- cron_rw_pipes(clamd_t)
- ')
- optional_policy(`
- exim_read_spool_files(clamd_t)
- ')
- optional_policy(`
- mta_read_config(clamd_t)
- mta_send_mail(clamd_t)
- ')
- ########################################
- #
- # Freshclam local policy
- #
- allow freshclam_t self:capability { setgid setuid dac_override };
- allow freshclam_t self:fifo_file rw_fifo_file_perms;
- allow freshclam_t self:unix_stream_socket { accept listen };
- allow freshclam_t self:tcp_socket { accept listen };
- allow freshclam_t clamd_etc_t:dir list_dir_perms;
- read_files_pattern(freshclam_t, clamd_etc_t, clamd_etc_t)
- read_lnk_files_pattern(freshclam_t, clamd_etc_t, clamd_etc_t)
- manage_dirs_pattern(freshclam_t, clamd_var_lib_t, clamd_var_lib_t)
- manage_files_pattern(freshclam_t, clamd_var_lib_t, clamd_var_lib_t)
- manage_files_pattern(freshclam_t, clamd_var_run_t, clamd_var_run_t)
- files_pid_filetrans(freshclam_t, clamd_var_run_t, file)
- append_files_pattern(freshclam_t, freshclam_var_log_t, freshclam_var_log_t)
- create_files_pattern(freshclam_t, freshclam_var_log_t, freshclam_var_log_t)
- setattr_files_pattern(freshclam_t, freshclam_var_log_t, freshclam_var_log_t)
- logging_log_filetrans(freshclam_t, freshclam_var_log_t, file)
- stream_connect_pattern(freshclam_t, clamd_var_run_t, clamd_var_run_t, clamd_t)
- read_files_pattern(freshclam_t, clamd_var_log_t, clamd_var_log_t)
- kernel_dontaudit_list_proc(freshclam_t)
- kernel_read_kernel_sysctls(freshclam_t)
- kernel_read_network_state(freshclam_t)
- kernel_read_system_state(freshclam_t)
- corenet_all_recvfrom_unlabeled(freshclam_t)
- corenet_all_recvfrom_netlabel(freshclam_t)
- corenet_tcp_sendrecv_generic_if(freshclam_t)
- corenet_tcp_sendrecv_generic_node(freshclam_t)
- corenet_sendrecv_clamd_client_packets(freshclam_t)
- corenet_tcp_connect_clamd_port(freshclam_t)
- corenet_tcp_sendrecv_clamd_port(freshclam_t)
- corenet_sendrecv_http_client_packets(freshclam_t)
- corenet_tcp_connect_http_port(freshclam_t)
- corenet_tcp_sendrecv_http_port(freshclam_t)
- corenet_sendrecv_http_cache_client_packets(freshclam_t)
- corenet_tcp_connect_http_cache_port(freshclam_t)
- corenet_tcp_sendrecv_http_cache_port(freshclam_t)
- corenet_sendrecv_squid_client_packets(freshclam_t)
- corenet_tcp_connect_squid_port(freshclam_t)
- corenet_tcp_sendrecv_squid_port(freshclam_t)
- dev_read_rand(freshclam_t)
- dev_read_urand(freshclam_t)
- domain_use_interactive_fds(freshclam_t)
- files_read_etc_runtime_files(freshclam_t)
- files_search_var_lib(freshclam_t)
- auth_use_nsswitch(freshclam_t)
- logging_send_syslog_msg(freshclam_t)
- miscfiles_read_localization(freshclam_t)
- tunable_policy(`clamd_use_jit',`
- allow freshclam_t self:process execmem;
- ',`
- dontaudit freshclam_t self:process execmem;
- ')
- optional_policy(`
- amavis_manage_spool_files(freshclam_t)
- ')
- optional_policy(`
- cron_system_entry(freshclam_t, freshclam_exec_t)
- ')
- ########################################
- #
- # Clamscam local policy
- #
- allow clamscan_t self:capability { setgid setuid dac_override };
- allow clamscan_t self:fifo_file rw_fifo_file_perms;
- allow clamscan_t self:unix_stream_socket create_stream_socket_perms;
- allow clamscan_t self:unix_dgram_socket create_socket_perms;
- allow clamscan_t self:tcp_socket { accept listen };
- allow clamscan_t clamd_etc_t:dir list_dir_perms;
- read_files_pattern(clamscan_t, clamd_etc_t, clamd_etc_t)
- read_lnk_files_pattern(clamscan_t, clamd_etc_t, clamd_etc_t)
- manage_dirs_pattern(clamscan_t, clamscan_tmp_t, clamscan_tmp_t)
- manage_files_pattern(clamscan_t, clamscan_tmp_t, clamscan_tmp_t)
- files_tmp_filetrans(clamscan_t, clamscan_tmp_t, { dir file })
- allow clamscan_t clamd_var_lib_t:dir list_dir_perms;
- manage_files_pattern(clamscan_t, clamd_var_lib_t, clamd_var_lib_t)
- allow clamscan_t clamd_var_run_t:dir list_dir_perms;
- read_files_pattern(clamscan_t, clamd_var_run_t, clamd_var_run_t)
- stream_connect_pattern(clamscan_t, clamd_var_run_t, clamd_var_run_t, clamd_t)
- kernel_dontaudit_list_proc(clamscan_t)
- kernel_read_kernel_sysctls(clamscan_t)
- kernel_read_system_state(clamscan_t)
- corenet_all_recvfrom_unlabeled(clamscan_t)
- corenet_all_recvfrom_netlabel(clamscan_t)
- corenet_tcp_sendrecv_generic_if(clamscan_t)
- corenet_tcp_sendrecv_generic_node(clamscan_t)
- corenet_sendrecv_clamd_client_packets(clamscan_t)
- corenet_tcp_connect_clamd_port(clamscan_t)
- corenet_tcp_sendrecv_clamd_port(clamscan_t)
- corecmd_read_all_executables(clamscan_t)
- files_read_etc_files(clamscan_t)
- files_read_etc_runtime_files(clamscan_t)
- files_search_var_lib(clamscan_t)
- init_read_utmp(clamscan_t)
- init_dontaudit_write_utmp(clamscan_t)
- miscfiles_read_localization(clamscan_t)
- miscfiles_read_public_files(clamscan_t)
- sysnet_dns_name_resolve(clamscan_t)
- tunable_policy(`clamav_read_user_content_files_clamscan',`
- userdom_read_user_home_content_files(clamscan_t)
- userdom_dontaudit_read_user_home_content_files(clamscan_t)
- ')
- tunable_policy(`clamav_read_all_non_security_files_clamscan',`
- files_read_non_security_files(clamscan_t)
- files_getattr_all_pipes(clamscan_t)
- files_getattr_all_sockets(clamscan_t)
- ')
- optional_policy(`
- amavis_read_spool_files(clamscan_t)
- ')
- optional_policy(`
- apache_read_sys_content(clamscan_t)
- ')
- optional_policy(`
- mta_send_mail(clamscan_t)
- mta_read_queue(clamscan_t)
- ')
|