Chris PeBenito 5d4f4b
policy_module(openca, 1.2.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type openca_ca_t;
Chris PeBenito 17de1b
type openca_ca_exec_t;
Chris PeBenito 17de1b
domain_type(openca_ca_t)
Chris PeBenito 0bfccd
domain_entry_file(openca_ca_t, openca_ca_exec_t)
Chris PeBenito 17de1b
role system_r types openca_ca_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# cjp: seems like some of these types
Chris PeBenito 17de1b
# can be removed and replaced with generic
Chris PeBenito 17de1b
# etc or usr files.
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# /etc/openca standard files
Chris PeBenito 17de1b
type openca_etc_t;
Chris PeBenito 6224fc
files_config_file(openca_etc_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# /etc/openca template files
Chris PeBenito 17de1b
type openca_etc_in_t;
Chris PeBenito 17de1b
files_type(openca_etc_in_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# /etc/openca writeable (from CGI script) files
Chris PeBenito 17de1b
type openca_etc_writeable_t;
Chris PeBenito 17de1b
files_type(openca_etc_writeable_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# /usr/share/openca/crypto/keys
Chris PeBenito 17de1b
type openca_usr_share_t;
Chris PeBenito 17de1b
files_type(openca_usr_share_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# /var/lib/openca
Chris PeBenito 17de1b
type openca_var_lib_t;
Chris PeBenito 17de1b
files_type(openca_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# /var/lib/openca/crypto/keys
Chris PeBenito 17de1b
type openca_var_lib_keys_t;
Chris PeBenito 17de1b
files_type(openca_var_lib_keys_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Allow access to other files under /etc/openca
Chris PeBenito c0868a
allow openca_ca_t openca_etc_t:file read_file_perms;
Chris PeBenito c0868a
allow openca_ca_t openca_etc_t:dir list_dir_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Allow access to writeable files under /etc/openca
Chris PeBenito 0bfccd
manage_dirs_pattern(openca_ca_t, openca_etc_writeable_t, openca_etc_writeable_t)
Chris PeBenito 0bfccd
manage_files_pattern(openca_ca_t, openca_etc_writeable_t, openca_etc_writeable_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Allow access to other /var/lib/openca files
Chris PeBenito 0bfccd
manage_dirs_pattern(openca_ca_t, openca_var_lib_t, openca_var_lib_t)
Chris PeBenito 0bfccd
manage_files_pattern(openca_ca_t, openca_var_lib_t, openca_var_lib_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Allow access to private CA key
Chris PeBenito 0bfccd
manage_dirs_pattern(openca_ca_t, openca_var_lib_keys_t, openca_var_lib_keys_t)
Chris PeBenito 0bfccd
manage_files_pattern(openca_ca_t, openca_var_lib_keys_t, openca_var_lib_keys_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# Allow access to other /usr/share/openca files
Chris PeBenito 0bfccd
read_files_pattern(openca_ca_t, openca_usr_share_t, openca_usr_share_t)
Chris PeBenito 0bfccd
read_lnk_files_pattern(openca_ca_t, openca_usr_share_t, openca_usr_share_t)
Chris PeBenito c0868a
allow openca_ca_t openca_usr_share_t:dir list_dir_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# the perl executable will be able to run a perl script
Chris PeBenito 17de1b
corecmd_exec_bin(openca_ca_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_rand(openca_ca_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_list_default(openca_ca_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_fds(openca_ca_t)
Chris PeBenito 17de1b
init_use_script_fds(openca_ca_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
libs_exec_lib_files(openca_ca_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
apache_append_log(openca_ca_t)
Chris PeBenito 17de1b
# Allow the script to return its output
Chris PeBenito 17de1b
apache_rw_cache_files(openca_ca_t)