Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
policy_module(openca,1.0.0)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
########################################
Chris PeBenito 5bd9fd
#
Chris PeBenito 5bd9fd
# Declarations
Chris PeBenito 5bd9fd
#
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
type openca_ca_t;
Chris PeBenito 5bd9fd
type openca_ca_exec_t;
Chris PeBenito 5bd9fd
domain_type(openca_ca_t)
Chris PeBenito 5bd9fd
domain_entry_file(openca_ca_t,openca_ca_exec_t)
Chris PeBenito 5bd9fd
role system_r types openca_ca_t;
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# cjp: seems like some of these types
Chris PeBenito 5bd9fd
# can be removed and replaced with generic
Chris PeBenito 5bd9fd
# etc or usr files.
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# /etc/openca standard files
Chris PeBenito 5bd9fd
type openca_etc_t;
Chris PeBenito 5bd9fd
files_type(openca_etc_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# /etc/openca template files
Chris PeBenito 5bd9fd
type openca_etc_in_t;
Chris PeBenito 5bd9fd
files_type(openca_etc_in_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# /etc/openca writeable (from CGI script) files
Chris PeBenito 5bd9fd
type openca_etc_writeable_t;
Chris PeBenito 5bd9fd
files_type(openca_etc_writeable_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# /usr/share/openca/crypto/keys
Chris PeBenito 5bd9fd
type openca_usr_share_t;
Chris PeBenito 5bd9fd
files_type(openca_usr_share_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# /var/lib/openca
Chris PeBenito 5bd9fd
type openca_var_lib_t;
Chris PeBenito 5bd9fd
files_type(openca_var_lib_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# /var/lib/openca/crypto/keys
Chris PeBenito 5bd9fd
type openca_var_lib_keys_t;
Chris PeBenito 5bd9fd
files_type(openca_var_lib_keys_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
########################################
Chris PeBenito 5bd9fd
#
Chris PeBenito 5bd9fd
# Local policy
Chris PeBenito 5bd9fd
#
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# Allow access to other files under /etc/openca
Chris PeBenito 5bd9fd
allow openca_ca_t openca_etc_t:file r_file_perms;
Chris PeBenito 5bd9fd
allow openca_ca_t openca_etc_t:dir r_dir_perms;
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# Allow access to writeable files under /etc/openca
Chris PeBenito 5bd9fd
allow openca_ca_t openca_etc_writeable_t:file manage_file_perms;
Chris PeBenito 5bd9fd
allow openca_ca_t openca_etc_writeable_t:dir manage_dir_perms;
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# Allow access to other /var/lib/openca files
Chris PeBenito 5bd9fd
allow openca_ca_t openca_var_lib_t:file manage_file_perms;
Chris PeBenito 5bd9fd
allow openca_ca_t openca_var_lib_t:dir manage_dir_perms;
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# Allow access to private CA key
Chris PeBenito 5bd9fd
allow openca_ca_t openca_var_lib_keys_t:file manage_file_perms;
Chris PeBenito 5bd9fd
allow openca_ca_t openca_var_lib_keys_t:dir manage_dir_perms;
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# Allow access to other /usr/share/openca files
Chris PeBenito 5bd9fd
allow openca_ca_t openca_usr_share_t:file r_file_perms;
Chris PeBenito 5bd9fd
allow openca_ca_t openca_usr_share_t:lnk_file r_file_perms;
Chris PeBenito 5bd9fd
allow openca_ca_t openca_usr_share_t:dir r_dir_perms;
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
# the perl executable will be able to run a perl script
Chris PeBenito 5bd9fd
corecmd_exec_bin(openca_ca_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
dev_read_rand(openca_ca_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
files_list_default(openca_ca_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
init_use_fds(openca_ca_t)
Chris PeBenito 5bd9fd
init_use_script_fds(openca_ca_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
libs_use_ld_so(openca_ca_t)
Chris PeBenito 5bd9fd
libs_use_shared_libs(openca_ca_t)
Chris PeBenito 5bd9fd
libs_exec_lib_files(openca_ca_t)
Chris PeBenito 5bd9fd
Chris PeBenito 5bd9fd
apache_append_log(openca_ca_t)
Chris PeBenito 5bd9fd
# Allow the script to return its output
Chris PeBenito 5bd9fd
apache_rw_cache_files(openca_ca_t)