Add passenger from Fedora.

This commit is contained in:
Chris PeBenito 2011-05-20 10:27:47 -04:00
parent 0d62ce9373
commit f5df601718
3 changed files with 127 additions and 0 deletions

View File

@ -0,0 +1,11 @@
/usr/lib/ruby/gems/.*/passenger-.*/ext/apache2/ApplicationPoolServerExecutable -- gen_context(system_u:object_r:passenger_exec_t,s0)
/usr/lib/ruby/gems/.*/passenger-.*/agents/PassengerWatchdog -- gen_context(system_u:object_r:passenger_exec_t,s0)
/usr/lib/ruby/gems/.*/passenger-.*/agents/PassengerLoggingAgent -- gen_context(system_u:object_r:passenger_exec_t,s0)
/usr/lib/ruby/gems/.*/passenger-.*/agents/apache2/PassengerHelperAgent -- gen_context(system_u:object_r:passenger_exec_t,s0)
/var/lib/passenger(/.*)? gen_context(system_u:object_r:passenger_var_lib_t,s0)
/var/log/passenger(/.*)? gen_context(system_u:object_r:passenger_log_t,s0)
/var/log/passenger.* -- gen_context(system_u:object_r:passenger_log_t,s0)
/var/run/passenger(/.*)? gen_context(system_u:object_r:passenger_var_run_t,s0)

View File

@ -0,0 +1,39 @@
## <summary>Ruby on rails deployment for Apache and Nginx servers.</summary>
######################################
## <summary>
## Execute passenger in the passenger domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`passenger_domtrans',`
gen_require(`
type passenger_t, passenger_exec_t;
')
domtrans_pattern($1, passenger_exec_t, passenger_t)
')
########################################
## <summary>
## Read passenger lib files
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`passenger_read_lib_files',`
gen_require(`
type passenger_var_lib_t;
')
read_files_pattern($1, passenger_var_lib_t, passenger_var_lib_t)
read_lnk_files_pattern($1, passenger_var_lib_t, passenger_var_lib_t)
files_search_var_lib($1)
')

View File

@ -0,0 +1,77 @@
policy_module(passanger, 1.0.0)
########################################
#
# Declarations
#
type passenger_t;
type passenger_exec_t;
domain_type(passenger_t)
domain_entry_file(passenger_t, passenger_exec_t)
role system_r types passenger_t;
type passenger_log_t;
logging_log_file(passenger_log_t)
type passenger_tmp_t;
files_tmp_file(passenger_tmp_t)
type passenger_var_lib_t;
files_type(passenger_var_lib_t)
type passenger_var_run_t;
files_pid_file(passenger_var_run_t)
########################################
#
# passanger local policy
#
allow passenger_t self:capability { chown dac_override fsetid fowner kill setuid setgid sys_nice };
allow passenger_t self:process { setpgid setsched sigkill signal };
allow passenger_t self:fifo_file rw_fifo_file_perms;
allow passenger_t self:unix_stream_socket { create_stream_socket_perms connectto };
can_exec(passenger_t, passenger_exec_t)
manage_dirs_pattern(passenger_t, passenger_log_t, passenger_log_t)
manage_files_pattern(passenger_t, passenger_log_t, passenger_log_t)
logging_log_filetrans(passenger_t, passenger_log_t, file)
manage_dirs_pattern(passenger_t, passenger_var_lib_t, passenger_var_lib_t)
manage_files_pattern(passenger_t, passenger_var_lib_t, passenger_var_lib_t)
files_search_var_lib(passenger_t)
manage_dirs_pattern(passenger_t, passenger_var_run_t, passenger_var_run_t)
manage_files_pattern(passenger_t, passenger_var_run_t, passenger_var_run_t)
manage_fifo_files_pattern(passenger_t, passenger_var_run_t, passenger_var_run_t)
manage_sock_files_pattern(passenger_t, passenger_var_run_t, passenger_var_run_t)
files_pid_filetrans(passenger_t, passenger_var_run_t, { file dir sock_file })
kernel_read_system_state(passenger_t)
kernel_read_kernel_sysctls(passenger_t)
corenet_all_recvfrom_netlabel(passenger_t)
corenet_all_recvfrom_unlabeled(passenger_t)
corenet_tcp_sendrecv_generic_if(passenger_t)
corenet_tcp_sendrecv_generic_node(passenger_t)
corenet_tcp_connect_http_port(passenger_t)
corecmd_exec_bin(passenger_t)
corecmd_exec_shell(passenger_t)
dev_read_urand(passenger_t)
files_read_etc_files(passenger_t)
auth_use_nsswitch(passenger_t)
miscfiles_read_localization(passenger_t)
userdom_dontaudit_use_user_terminals(passenger_t)
optional_policy(`
apache_append_log(passenger_t)
apache_read_sys_content(passenger_t)
')