Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes 2789 - selinux denials #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions foreman-selinux-enable
Expand Up @@ -6,5 +6,6 @@ do
/usr/sbin/semodule -s $selinuxvariant -l >/dev/null 2>&1 && \
/usr/sbin/semanage -S $selinuxvariant -i - << _EOF
module -a /usr/share/selinux/${selinuxvariant}/foreman.pp.bz2
boolean -m --on httpd_setrlimit
_EOF
done
12 changes: 11 additions & 1 deletion foreman.te
Expand Up @@ -65,6 +65,7 @@ files_pid_file(foreman_var_run_t)

require{
type httpd_t;
type httpd_tmp_t;
type passenger_t;
type passenger_tmp_t;
type puppetmaster_exec_t;
Expand Down Expand Up @@ -103,6 +104,10 @@ miscfiles_read_localization(passenger_t)
corenet_tcp_connect_postgresql_port(passenger_t)
corenet_tcp_connect_ssh_port(passenger_t)

optional_policy(`
postgresql_stream_connect(passenger_t)
')

# The read the code (and potentially modules) from /usr/share.
files_read_usr_files(passenger_t)

Expand Down Expand Up @@ -146,6 +151,12 @@ tunable_policy(`httpd_run_foreman', `
allow httpd_t passenger_tmp_t:sock_file write;
')

tunable_policy(`httpd_run_foreman', `
manage_dirs_pattern(passenger_t, httpd_tmp_t, httpd_tmp_t)
manage_files_pattern(passenger_t, httpd_tmp_t, httpd_tmp_t)
manage_sock_files_pattern(passenger_t, httpd_tmp_t, httpd_tmp_t)
')

optional_policy(`
# Allow sending of email reports.
mta_send_mail(passenger_t)
Expand All @@ -165,4 +176,3 @@ optional_policy(`
corecmd_search_bin(passenger_t)
domtrans_pattern(passenger_t, puppetmaster_exec_t, puppetmaster_t)
')