mirror of
https://github.com/SELinuxProject/refpolicy
synced 2025-03-19 17:54:02 +00:00
add openca, bug 1660
This commit is contained in:
parent
5706facdf2
commit
5bd9fd7bc2
@ -64,6 +64,7 @@
|
|||||||
nessus
|
nessus
|
||||||
nsd
|
nsd
|
||||||
ntop
|
ntop
|
||||||
|
openca
|
||||||
openvpn (Petre Rodan)
|
openvpn (Petre Rodan)
|
||||||
perdition
|
perdition
|
||||||
postgrey
|
postgrey
|
||||||
|
@ -37,6 +37,7 @@ ifdef(`distro_suse', `
|
|||||||
/usr/sbin/suexec -- gen_context(system_u:object_r:httpd_suexec_exec_t,s0)
|
/usr/sbin/suexec -- gen_context(system_u:object_r:httpd_suexec_exec_t,s0)
|
||||||
|
|
||||||
/usr/share/htdig(/.*)? gen_context(system_u:object_r:httpd_sys_content_t,s0)
|
/usr/share/htdig(/.*)? gen_context(system_u:object_r:httpd_sys_content_t,s0)
|
||||||
|
/usr/share/openca/htdocs(/.*)? gen_context(system_u:object_r:httpd_sys_content_t,s0)
|
||||||
|
|
||||||
/var/cache/httpd(/.*)? gen_context(system_u:object_r:httpd_cache_t,s0)
|
/var/cache/httpd(/.*)? gen_context(system_u:object_r:httpd_cache_t,s0)
|
||||||
/var/cache/mason(/.*)? gen_context(system_u:object_r:httpd_cache_t,s0)
|
/var/cache/mason(/.*)? gen_context(system_u:object_r:httpd_cache_t,s0)
|
||||||
|
@ -470,6 +470,25 @@ interface(`apache_dontaudit_rw_tcp_sockets',`
|
|||||||
dontaudit $1 httpd_t:tcp_socket { read write };
|
dontaudit $1 httpd_t:tcp_socket { read write };
|
||||||
')
|
')
|
||||||
|
|
||||||
|
########################################
|
||||||
|
## <summary>
|
||||||
|
## Allow the specified domain to read
|
||||||
|
## and write Apache cache files.
|
||||||
|
## </summary>
|
||||||
|
## <param name="domain">
|
||||||
|
## <summary>
|
||||||
|
## Domain allowed access.
|
||||||
|
## </summary>
|
||||||
|
## </param>
|
||||||
|
#
|
||||||
|
interface(`apache_rw_cache_files',`
|
||||||
|
gen_require(`
|
||||||
|
type httpd_cache_t;
|
||||||
|
')
|
||||||
|
|
||||||
|
allow $1 httpd_cache_t:file rw_file_perms;
|
||||||
|
')
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
## <summary>
|
## <summary>
|
||||||
## Allow the specified domain to read
|
## Allow the specified domain to read
|
||||||
|
@ -430,6 +430,13 @@ optional_policy(`
|
|||||||
nscd_socket_use(httpd_t)
|
nscd_socket_use(httpd_t)
|
||||||
')
|
')
|
||||||
|
|
||||||
|
optional_policy(`
|
||||||
|
openca_domtrans(httpd_t)
|
||||||
|
openca_signal(httpd_t)
|
||||||
|
openca_sigstop(httpd_t)
|
||||||
|
openca_kill(httpd_t)
|
||||||
|
')
|
||||||
|
|
||||||
optional_policy(`
|
optional_policy(`
|
||||||
# Allow httpd to work with postgresql
|
# Allow httpd to work with postgresql
|
||||||
postgresql_stream_connect(httpd_t)
|
postgresql_stream_connect(httpd_t)
|
||||||
|
9
refpolicy/policy/modules/services/openca.fc
Normal file
9
refpolicy/policy/modules/services/openca.fc
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
/etc/openca(/.*)? gen_context(system_u:object_r:openca_etc_t,s0)
|
||||||
|
/etc/openca/*.\.in(/.*)? gen_context(system_u:object_r:openca_etc_in_t,s0)
|
||||||
|
/etc/openca/rbac(/.*)? gen_context(system_u:object_r:openca_etc_writeable_t,s0)
|
||||||
|
|
||||||
|
/usr/share/openca(/.*)? gen_context(system_u:object_r:openca_usr_share_t,s0)
|
||||||
|
/usr/share/openca/cgi-bin/ca/.+ -- gen_context(system_u:object_r:openca_ca_exec_t,s0)
|
||||||
|
|
||||||
|
/var/lib/openca(/.*)? gen_context(system_u:object_r:openca_var_lib_t,s0)
|
||||||
|
/var/lib/openca/crypto/keys(/.*)? gen_context(system_u:object_r:openca_var_lib_keys_t,s0)
|
80
refpolicy/policy/modules/services/openca.if
Normal file
80
refpolicy/policy/modules/services/openca.if
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
## <summary>OpenCA - Open Certificate Authority</summary>
|
||||||
|
|
||||||
|
########################################
|
||||||
|
## <summary>
|
||||||
|
## Execute the OpenCA program with
|
||||||
|
## a domain transition.
|
||||||
|
## </summary>
|
||||||
|
## <param name="domain">
|
||||||
|
## <summary>
|
||||||
|
## Domain allowed access.
|
||||||
|
## </summary>
|
||||||
|
## </param>
|
||||||
|
#
|
||||||
|
interface(`openca_domtrans',`
|
||||||
|
gen_require(`
|
||||||
|
type openca_ca_t, openca_ca_exec_t, openca_usr_share_t;
|
||||||
|
')
|
||||||
|
|
||||||
|
domain_auto_trans($1,openca_ca_exec_t,openca_ca_t)
|
||||||
|
allow httpd_t openca_usr_share_t:dir search_dir_perms;
|
||||||
|
files_search_usr(httpd_t)
|
||||||
|
|
||||||
|
allow openca_ca_t $1:fd use;
|
||||||
|
allow openca_ca_t $1:fifo_file rw_file_perms;
|
||||||
|
allow openca_ca_t $1:process sigchld;
|
||||||
|
')
|
||||||
|
|
||||||
|
########################################
|
||||||
|
## <summary>
|
||||||
|
## Send OpenCA generic signals.
|
||||||
|
## </summary>
|
||||||
|
## <param name="domain">
|
||||||
|
## <summary>
|
||||||
|
## Domain allowed access.
|
||||||
|
## </summary>
|
||||||
|
## </param>
|
||||||
|
#
|
||||||
|
interface(`openca_signal',`
|
||||||
|
gen_require(`
|
||||||
|
type openca_ca_t;
|
||||||
|
')
|
||||||
|
|
||||||
|
allow $1 openca_ca_t:process signal;
|
||||||
|
')
|
||||||
|
|
||||||
|
########################################
|
||||||
|
## <summary>
|
||||||
|
## Send OpenCA stop signals.
|
||||||
|
## </summary>
|
||||||
|
## <param name="domain">
|
||||||
|
## <summary>
|
||||||
|
## Domain allowed access.
|
||||||
|
## </summary>
|
||||||
|
## </param>
|
||||||
|
#
|
||||||
|
interface(`openca_sigstop',`
|
||||||
|
gen_require(`
|
||||||
|
type openca_ca_t;
|
||||||
|
')
|
||||||
|
|
||||||
|
allow $1 openca_ca_t:process sigstop;
|
||||||
|
')
|
||||||
|
|
||||||
|
########################################
|
||||||
|
## <summary>
|
||||||
|
## Kill OpenCA.
|
||||||
|
## </summary>
|
||||||
|
## <param name="domain">
|
||||||
|
## <summary>
|
||||||
|
## Domain allowed access.
|
||||||
|
## </summary>
|
||||||
|
## </param>
|
||||||
|
#
|
||||||
|
interface(`openca_kill',`
|
||||||
|
gen_require(`
|
||||||
|
type openca_ca_t;
|
||||||
|
')
|
||||||
|
|
||||||
|
allow $1 openca_ca_t:process sigkill;
|
||||||
|
')
|
85
refpolicy/policy/modules/services/openca.te
Normal file
85
refpolicy/policy/modules/services/openca.te
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
|
||||||
|
policy_module(openca,1.0.0)
|
||||||
|
|
||||||
|
########################################
|
||||||
|
#
|
||||||
|
# Declarations
|
||||||
|
#
|
||||||
|
|
||||||
|
type openca_ca_t;
|
||||||
|
type openca_ca_exec_t;
|
||||||
|
domain_type(openca_ca_t)
|
||||||
|
domain_entry_file(openca_ca_t,openca_ca_exec_t)
|
||||||
|
role system_r types openca_ca_t;
|
||||||
|
|
||||||
|
# cjp: seems like some of these types
|
||||||
|
# can be removed and replaced with generic
|
||||||
|
# etc or usr files.
|
||||||
|
|
||||||
|
# /etc/openca standard files
|
||||||
|
type openca_etc_t;
|
||||||
|
files_type(openca_etc_t)
|
||||||
|
|
||||||
|
# /etc/openca template files
|
||||||
|
type openca_etc_in_t;
|
||||||
|
files_type(openca_etc_in_t)
|
||||||
|
|
||||||
|
# /etc/openca writeable (from CGI script) files
|
||||||
|
type openca_etc_writeable_t;
|
||||||
|
files_type(openca_etc_writeable_t)
|
||||||
|
|
||||||
|
# /usr/share/openca/crypto/keys
|
||||||
|
type openca_usr_share_t;
|
||||||
|
files_type(openca_usr_share_t)
|
||||||
|
|
||||||
|
# /var/lib/openca
|
||||||
|
type openca_var_lib_t;
|
||||||
|
files_type(openca_var_lib_t)
|
||||||
|
|
||||||
|
# /var/lib/openca/crypto/keys
|
||||||
|
type openca_var_lib_keys_t;
|
||||||
|
files_type(openca_var_lib_keys_t)
|
||||||
|
|
||||||
|
########################################
|
||||||
|
#
|
||||||
|
# Local policy
|
||||||
|
#
|
||||||
|
|
||||||
|
# Allow access to other files under /etc/openca
|
||||||
|
allow openca_ca_t openca_etc_t:file r_file_perms;
|
||||||
|
allow openca_ca_t openca_etc_t:dir r_dir_perms;
|
||||||
|
|
||||||
|
# Allow access to writeable files under /etc/openca
|
||||||
|
allow openca_ca_t openca_etc_writeable_t:file manage_file_perms;
|
||||||
|
allow openca_ca_t openca_etc_writeable_t:dir manage_dir_perms;
|
||||||
|
|
||||||
|
# Allow access to other /var/lib/openca files
|
||||||
|
allow openca_ca_t openca_var_lib_t:file manage_file_perms;
|
||||||
|
allow openca_ca_t openca_var_lib_t:dir manage_dir_perms;
|
||||||
|
|
||||||
|
# Allow access to private CA key
|
||||||
|
allow openca_ca_t openca_var_lib_keys_t:file manage_file_perms;
|
||||||
|
allow openca_ca_t openca_var_lib_keys_t:dir manage_dir_perms;
|
||||||
|
|
||||||
|
# Allow access to other /usr/share/openca files
|
||||||
|
allow openca_ca_t openca_usr_share_t:file r_file_perms;
|
||||||
|
allow openca_ca_t openca_usr_share_t:lnk_file r_file_perms;
|
||||||
|
allow openca_ca_t openca_usr_share_t:dir r_dir_perms;
|
||||||
|
|
||||||
|
# the perl executable will be able to run a perl script
|
||||||
|
corecmd_exec_bin(openca_ca_t)
|
||||||
|
|
||||||
|
dev_read_rand(openca_ca_t)
|
||||||
|
|
||||||
|
files_list_default(openca_ca_t)
|
||||||
|
|
||||||
|
init_use_fds(openca_ca_t)
|
||||||
|
init_use_script_fds(openca_ca_t)
|
||||||
|
|
||||||
|
libs_use_ld_so(openca_ca_t)
|
||||||
|
libs_use_shared_libs(openca_ca_t)
|
||||||
|
libs_exec_lib_files(openca_ca_t)
|
||||||
|
|
||||||
|
apache_append_log(openca_ca_t)
|
||||||
|
# Allow the script to return its output
|
||||||
|
apache_rw_cache_files(openca_ca_t)
|
Loading…
Reference in New Issue
Block a user