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 #10443 - added nova/glance/neutron rules #45

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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion foreman-selinux-disable
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ do
if /usr/sbin/semodule -s $selinuxvariant -l >/dev/null; then
# Remove all user defined ports (including the default one)
/usr/sbin/semanage port -E | \
grep -E '(elasticsearch|docker)_port_t' | \
grep -E '(elasticsearch|docker|foreman_osapi_compute)_port_t' | \
sed s/-a/-d/g | \
/usr/sbin/semanage -S $selinuxvariant -i -
# Unload policy
Expand Down
9 changes: 9 additions & 0 deletions foreman-selinux-enable
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set +e
TMP=$(mktemp -t foreman-selinux-enable.XXXXXXXXXX)
trap "rm -rf '$TMP'" EXIT INT TERM

is_redhat_6() {
test x$(rpm -q --whatprovides redhat-release --qf '%{version}') = x6
}

# Load or upgrade foreman policy and set booleans.
#
# Dependant booleans must be managed in a separate transaction.
Expand All @@ -25,6 +29,11 @@ do
/usr/sbin/semanage port -E | grep -q docker_port_t || \
echo "port -a -t docker_port_t -p tcp 2375-2376" >> $TMP

if is_redhat_6; then
/usr/sbin/semanage port -E | grep -q foreman_osapi_compute_port_t || \
echo "port -a -t foreman_osapi_compute_port_t -p tcp 8774" >> $TMP
fi

/usr/sbin/semanage -S $selinuxvariant -i $TMP
fi
done
9 changes: 9 additions & 0 deletions foreman.te
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ files_pid_file(foreman_var_run_t)
type foreman_proxy_port_t;
corenet_port(foreman_proxy_port_t)

type foreman_osapi_compute_port_t;
corenet_port(foreman_osapi_compute_port_t)

require{
type bin_t;
type httpd_t;
Expand Down Expand Up @@ -308,9 +311,15 @@ optional_policy(`

tunable_policy(`passenger_can_connect_openstack',`
ifdef(`distro_rhel6', `
# keystone (identity service)
corenet_tcp_connect_commplex_port(passenger_t)
# all other ports not yet defined on rhel6
allow passenger_t foreman_osapi_compute_port_t:tcp_socket name_connect;
',`
# keystone (identity service)
corenet_tcp_connect_commplex_main_port(passenger_t)
# nova (compute service)
corenet_tcp_connect_osapi_compute_port(passenger_t)
')
')

Expand Down