Skip to content

Commit

Permalink
Refs #30803: Allow Apache to connect to Unix socket
Browse files Browse the repository at this point in the history
  • Loading branch information
ehelms committed Oct 1, 2020
1 parent e7b3179 commit 27caf1c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions foreman-selinux-relabel
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/var/lib/foreman \
/var/run/foreman \
/run/foreman \
/run/foreman.sock \
/var/log/foreman \
/etc/foreman \
/etc/puppet/node.rb \
Expand Down
1 change: 1 addition & 0 deletions foreman.fc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
/var/log/foreman(/.*)? gen_context(system_u:object_r:foreman_log_t,s0)

/var/run/foreman(/.*)? gen_context(system_u:object_r:foreman_var_run_t,s0)
/run/foreman.sock gen_context(system_u:object_r:foreman_var_run_t,s0)

/usr/share/foreman/.ssh(/.*)? gen_context(system_u:object_r:ssh_home_t,s0)
/usr/share/foreman/extras/noVNC/websockify\.py gen_context(system_u:object_r:websockify_exec_t,s0)
Expand Down
4 changes: 4 additions & 0 deletions foreman.te
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ allow foreman_rails_t self:udp_socket { all_udp_socket_perms };
allow foreman_rails_t self:unix_dgram_socket { all_unix_dgram_socket_perms };
corenet_tcp_bind_generic_node(foreman_rails_t)

# Allow Apache access to the Unix socket
allow foreman_rails_t httpd_var_run_t:dir search;
allow httpd_t foreman_rails_t:unix_stream_socket { connectto getattr read write };

# Listening for HTTP communication on port 3000
corenet_tcp_bind_ntop_port(foreman_rails_t)
corenet_tcp_connect_ntop_port(foreman_rails_t)
Expand Down

0 comments on commit 27caf1c

Please sign in to comment.