add oav, bug 1536
This commit is contained in:
parent
6714c268a5
commit
2e9cd95e07
|
@ -64,6 +64,7 @@
|
|||
nessus
|
||||
nsd
|
||||
ntop
|
||||
oav
|
||||
openca
|
||||
openvpn (Petre Rodan)
|
||||
perdition
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
/etc/oav-update(/.*)? gen_context(system_u:object_r:oav_update_etc_t,s0)
|
||||
/etc/scannerdaemon/scannerdaemon\.conf -- gen_context(system_u:object_r:scannerdaemon_etc_t,s0)
|
||||
|
||||
/usr/sbin/oav-update -- gen_context(system_u:object_r:oav_update_exec_t,s0)
|
||||
/usr/sbin/scannerdaemon -- gen_context(system_u:object_r:scannerdaemon_exec_t,s0)
|
||||
|
||||
/var/lib/oav-virussignatures -- gen_context(system_u:object_r:oav_update_var_lib_t,s0)
|
||||
/var/lib/oav-update(/.*)? gen_context(system_u:object_r:oav_update_var_lib_t,s0)
|
||||
/var/log/scannerdaemon\.log -- gen_context(system_u:object_r:scannerdaemon_log_t,s0)
|
|
@ -0,0 +1,56 @@
|
|||
## <summary>Open AntiVirus scannerdaemon and signature update</summary>
|
||||
|
||||
########################################
|
||||
## <summary>
|
||||
## Execute oav_update in the oav_update domain.
|
||||
## </summary>
|
||||
## <param name="domain">
|
||||
## <summary>
|
||||
## Domain allowed access.
|
||||
## </summary>
|
||||
## </param>
|
||||
#
|
||||
interface(`oav_domtrans_update',`
|
||||
gen_require(`
|
||||
type oav_update_t, oav_update_exec_t;
|
||||
')
|
||||
|
||||
corecmd_search_sbin($1)
|
||||
domain_auto_trans($1,oav_update_exec_t,oav_update_t)
|
||||
|
||||
allow $1 oav_update_t:fd use;
|
||||
allow oav_update_t $1:fd use;
|
||||
allow oav_update_t $1:fifo_file rw_file_perms;
|
||||
allow oav_update_t $1:process sigchld;
|
||||
')
|
||||
|
||||
########################################
|
||||
## <summary>
|
||||
## Execute oav_update in the oav_update domain, and
|
||||
## allow the specified role the oav_update domain.
|
||||
## </summary>
|
||||
## <param name="domain">
|
||||
## <summary>
|
||||
## Domain allowed access.
|
||||
## </summary>
|
||||
## </param>
|
||||
## <param name="role">
|
||||
## <summary>
|
||||
## The role to be allowed the oav_update domain.
|
||||
## </summary>
|
||||
## </param>
|
||||
## <param name="terminal">
|
||||
## <summary>
|
||||
## The type of the terminal allow the oav_update domain to use.
|
||||
## </summary>
|
||||
## </param>
|
||||
#
|
||||
interface(`oav_run_update',`
|
||||
gen_require(`
|
||||
type oav_update_t;
|
||||
')
|
||||
|
||||
oav_domtrans_update($1)
|
||||
role $2 types oav_update_t;
|
||||
allow oav_update_t $3:chr_file rw_term_perms;
|
||||
')
|
|
@ -0,0 +1,172 @@
|
|||
|
||||
policy_module(oav,1.0.0)
|
||||
|
||||
########################################
|
||||
#
|
||||
# Declarations
|
||||
#
|
||||
|
||||
type oav_update_t;
|
||||
type oav_update_exec_t;
|
||||
domain_type(oav_update_t)
|
||||
domain_entry_file(oav_update_t,oav_update_exec_t)
|
||||
|
||||
# cjp: may be collapsable to etc_t
|
||||
type oav_update_etc_t;
|
||||
files_type(oav_update_etc_t)
|
||||
|
||||
type oav_update_var_lib_t;
|
||||
files_type(oav_update_var_lib_t)
|
||||
|
||||
type scannerdaemon_t;
|
||||
type scannerdaemon_exec_t;
|
||||
init_daemon_domain(scannerdaemon_t,scannerdaemon_exec_t)
|
||||
|
||||
type scannerdaemon_etc_t;
|
||||
files_type(scannerdaemon_etc_t)
|
||||
|
||||
type scannerdaemon_log_t;
|
||||
logging_log_file(scannerdaemon_log_t)
|
||||
|
||||
type scannerdaemon_var_run_t;
|
||||
files_pid_file(scannerdaemon_var_run_t)
|
||||
|
||||
########################################
|
||||
#
|
||||
# OAV update local policy
|
||||
#
|
||||
|
||||
allow oav_update_t self:tcp_socket create_stream_socket_perms;
|
||||
allow oav_update_t self:udp_socket create_socket_perms;
|
||||
|
||||
# Can read /etc/oav-update/* files
|
||||
allow oav_update_t oav_update_etc_t:dir r_dir_perms;
|
||||
allow oav_update_t oav_update_etc_t:file r_file_perms;
|
||||
|
||||
# Can read /var/lib/oav-update/current
|
||||
allow oav_update_t oav_update_var_lib_t:dir manage_dir_perms;
|
||||
allow oav_update_t oav_update_var_lib_t:file manage_file_perms;
|
||||
allow oav_update_t oav_update_var_lib_t:lnk_file r_file_perms;
|
||||
|
||||
corecmd_exec_all_executables(oav_update_t)
|
||||
|
||||
corenet_tcp_sendrecv_generic_if(oav_update_t)
|
||||
corenet_udp_sendrecv_generic_if(oav_update_t)
|
||||
corenet_raw_sendrecv_generic_if(oav_update_t)
|
||||
corenet_tcp_sendrecv_all_nodes(oav_update_t)
|
||||
corenet_udp_sendrecv_all_nodes(oav_update_t)
|
||||
corenet_raw_sendrecv_all_nodes(oav_update_t)
|
||||
corenet_tcp_sendrecv_all_ports(oav_update_t)
|
||||
corenet_udp_sendrecv_all_ports(oav_update_t)
|
||||
corenet_non_ipsec_sendrecv(oav_update_t)
|
||||
corenet_tcp_bind_all_nodes(oav_update_t)
|
||||
corenet_udp_bind_all_nodes(oav_update_t)
|
||||
|
||||
files_exec_etc_files(oav_update_t)
|
||||
|
||||
libs_use_ld_so(oav_update_t)
|
||||
libs_use_shared_libs(oav_update_t)
|
||||
libs_exec_ld_so(oav_update_t)
|
||||
libs_exec_lib_files(oav_update_t)
|
||||
libs_use_ld_so(oav_update_t)
|
||||
libs_use_shared_libs(oav_update_t)
|
||||
|
||||
logging_send_syslog_msg(oav_update_t)
|
||||
|
||||
sysnet_read_config(oav_update_t)
|
||||
|
||||
optional_policy(`
|
||||
cron_system_entry(oav_update_t,oav_update_exec_t)
|
||||
')
|
||||
|
||||
########################################
|
||||
#
|
||||
# Scannerdaemon local policy
|
||||
#
|
||||
|
||||
dontaudit scannerdaemon_t self:capability sys_tty_config;
|
||||
allow scannerdaemon_t self:process signal_perms;
|
||||
allow scannerdaemon_t self:fifo_file { read write };
|
||||
allow scannerdaemon_t self:tcp_socket create_stream_socket_perms;
|
||||
allow scannerdaemon_t self:udp_socket create_socket_perms;
|
||||
|
||||
allow scannerdaemon_t oav_update_var_lib_t:dir r_dir_perms;
|
||||
allow scannerdaemon_t oav_update_var_lib_t:file r_file_perms;
|
||||
files_search_var_lib(scannerdaemon_t)
|
||||
|
||||
allow scannerdaemon_t scannerdaemon_etc_t:file r_file_perms;
|
||||
|
||||
allow scannerdaemon_t scannerdaemon_log_t:file create_file_perms;
|
||||
logging_log_filetrans(scannerdaemon_t,scannerdaemon_log_t,file)
|
||||
|
||||
allow scannerdaemon_t scannerdaemon_var_run_t:file create_file_perms;
|
||||
allow scannerdaemon_t scannerdaemon_var_run_t:dir rw_dir_perms;
|
||||
files_pid_filetrans(scannerdaemon_t,scannerdaemon_var_run_t,file)
|
||||
|
||||
kernel_read_system_state(scannerdaemon_t)
|
||||
kernel_read_kernel_sysctls(scannerdaemon_t)
|
||||
|
||||
# Can run kaffe
|
||||
corecmd_exec_all_executables(scannerdaemon_t)
|
||||
|
||||
corenet_tcp_sendrecv_generic_if(scannerdaemon_t)
|
||||
corenet_udp_sendrecv_generic_if(scannerdaemon_t)
|
||||
corenet_raw_sendrecv_generic_if(scannerdaemon_t)
|
||||
corenet_tcp_sendrecv_all_nodes(scannerdaemon_t)
|
||||
corenet_udp_sendrecv_all_nodes(scannerdaemon_t)
|
||||
corenet_raw_sendrecv_all_nodes(scannerdaemon_t)
|
||||
corenet_tcp_sendrecv_all_ports(scannerdaemon_t)
|
||||
corenet_udp_sendrecv_all_ports(scannerdaemon_t)
|
||||
corenet_non_ipsec_sendrecv(scannerdaemon_t)
|
||||
corenet_tcp_bind_all_nodes(scannerdaemon_t)
|
||||
corenet_udp_bind_all_nodes(scannerdaemon_t)
|
||||
|
||||
dev_read_sysfs(scannerdaemon_t)
|
||||
|
||||
domain_use_interactive_fds(scannerdaemon_t)
|
||||
|
||||
files_read_etc_files(scannerdaemon_t)
|
||||
files_read_etc_runtime_files(scannerdaemon_t)
|
||||
# Can run kaffe
|
||||
files_exec_etc_files(scannerdaemon_t)
|
||||
|
||||
fs_getattr_all_fs(scannerdaemon_t)
|
||||
fs_search_auto_mountpoints(scannerdaemon_t)
|
||||
|
||||
term_dontaudit_use_console(scannerdaemon_t)
|
||||
|
||||
auth_dontaudit_read_shadow(scannerdaemon_t)
|
||||
|
||||
init_use_fds(scannerdaemon_t)
|
||||
init_use_script_ptys(scannerdaemon_t)
|
||||
|
||||
libs_use_ld_so(scannerdaemon_t)
|
||||
libs_use_shared_libs(scannerdaemon_t)
|
||||
# Can run kaffe
|
||||
libs_use_ld_so(scannerdaemon_t)
|
||||
libs_use_shared_libs(scannerdaemon_t)
|
||||
libs_exec_ld_so(scannerdaemon_t)
|
||||
libs_exec_lib_files(scannerdaemon_t)
|
||||
|
||||
logging_send_syslog_msg(scannerdaemon_t)
|
||||
|
||||
miscfiles_read_localization(scannerdaemon_t)
|
||||
|
||||
sysnet_read_config(scannerdaemon_t)
|
||||
|
||||
userdom_dontaudit_use_unpriv_user_fds(scannerdaemon_t)
|
||||
userdom_dontaudit_search_sysadm_home_dirs(scannerdaemon_t)
|
||||
|
||||
ifdef(`targeted_policy',`
|
||||
term_dontaudit_use_unallocated_ttys(scannerdaemon_t)
|
||||
term_dontaudit_use_generic_ptys(scannerdaemon_t)
|
||||
files_dontaudit_read_root_files(scannerdaemon_t)
|
||||
')
|
||||
|
||||
optional_policy(`
|
||||
seutil_sigchld_newrole(scannerdaemon_t)
|
||||
')
|
||||
|
||||
optional_policy(`
|
||||
udev_read_db(scannerdaemon_t)
|
||||
')
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
policy_module(userdomain,1.3.21)
|
||||
policy_module(userdomain,1.3.22)
|
||||
|
||||
gen_require(`
|
||||
role sysadm_r, staff_r, user_r;
|
||||
|
@ -346,6 +346,10 @@ ifdef(`targeted_policy',`
|
|||
corenet_udp_bind_ntp_port(sysadm_t)
|
||||
')
|
||||
|
||||
optional_policy(`
|
||||
oav_run_update(sysadm_t,sysadm_r,admin_terminal)
|
||||
')
|
||||
|
||||
optional_policy(`
|
||||
pcmcia_run_cardctl(sysadm_t,sysadm_r,admin_terminal)
|
||||
')
|
||||
|
|
Loading…
Reference in New Issue