Chris PeBenito 0fbfa5
#DESC Oav - Anti-virus update program
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
# Author:  Brian May <bam@snoopy.apana.org.au>
Chris PeBenito 0fbfa5
# X-Debian-Packages:
Chris PeBenito 0fbfa5
#
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
type oav_update_var_lib_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
type oav_update_exec_t, file_type, sysadmfile, exec_type;
Chris PeBenito 0fbfa5
type oav_update_etc_t, file_type, sysadmfile;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Derived domain based on the calling user domain and the program.
Chris PeBenito 0fbfa5
type oav_update_t, domain, privlog;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Transition from the sysadm domain to the derived domain.
Chris PeBenito 0fbfa5
role sysadm_r types oav_update_t;
Chris PeBenito 0fbfa5
domain_auto_trans(sysadm_t, oav_update_exec_t, oav_update_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Transition from the sysadm domain to the derived domain.
Chris PeBenito 0fbfa5
role system_r types oav_update_t;
Chris PeBenito 0fbfa5
system_crond_entry(oav_update_exec_t, oav_update_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Uses shared librarys
Chris PeBenito 0fbfa5
uses_shlib(oav_update_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Run helper programs.
Chris PeBenito 0fbfa5
can_exec_any(oav_update_t,bin_t)
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Can read /etc/oav-update/* files
Chris PeBenito 0fbfa5
allow oav_update_t oav_update_etc_t:dir r_dir_perms;
Chris PeBenito 0fbfa5
allow oav_update_t oav_update_etc_t:file r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Can read /var/lib/oav-update/current
Chris PeBenito 0fbfa5
allow oav_update_t oav_update_var_lib_t:dir create_dir_perms;
Chris PeBenito 0fbfa5
allow oav_update_t oav_update_var_lib_t:file create_file_perms;
Chris PeBenito 0fbfa5
allow oav_update_t oav_update_var_lib_t:lnk_file r_file_perms;
Chris PeBenito 0fbfa5
Chris PeBenito 0fbfa5
# Can download via network
Chris PeBenito 0fbfa5
can_network_server(oav_update_t)