Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.
/ pulp Public archive

Commit

Permalink
Merge pull request #3298 from werwty/master
Browse files Browse the repository at this point in the history
Update pulp puppet selinux policies
  • Loading branch information
werwty committed Jan 30, 2018
2 parents 76ea3bf + c5373a4 commit d66e8f5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/selinux/server/pulp-celery.te
Expand Up @@ -30,7 +30,7 @@ require {
type sysfs_t;
class sock_file { create link unlink write };
class unix_stream_socket connectto;
class dir { getattr search read write remove_name create add_name rmdir relabelto relabelfrom };
class dir { add_name create getattr open read relabelfrom relabelto remove_name rename reparent rmdir search setattr write };
class file { lock rename write setattr getattr read create link unlink open relabelto relabelfrom map };
class filesystem getattr;
class process { setsched signal signull execmem };
Expand Down Expand Up @@ -202,9 +202,12 @@ optional_policy(`
tunable_policy(`pulp_manage_puppet', `
# Puppet modules can contain symlinks, though it seems they often do not. This line allows
# Pulp to install the symlinks if they are present.
allow celery_t puppet_etc_t:dir { add_name create getattr open read remove_name rename reparent rmdir search setattr write};
allow celery_t puppet_etc_t:file { create getattr open setattr write };
allow celery_t puppet_etc_t:lnk_file { create read getattr unlink };
manage_dirs_pattern(celery_t, puppet_etc_t, puppet_etc_t)
manage_files_pattern(celery_t, puppet_etc_t, puppet_etc_t)
puppet_read_config(celery_t)
')
')

Expand Down
17 changes: 17 additions & 0 deletions server/selinux/server/pulp-server.te
Expand Up @@ -4,7 +4,10 @@ policy_module(pulp-server, 0.0.0)
type pulp_cert_t;

require {
type puppet_etc_t;
type httpd_t;
class dir { read remove_name rmdir write };
class file { getattr unlink };
}

##### Certificates #####
Expand All @@ -22,3 +25,17 @@ read_lnk_files_pattern(httpd_t, pulp_cert_t, pulp_cert_t)
## Allow httpd_t to make connections to amqp and mongod ports
corenet_tcp_connect_amqp_port(httpd_t)
corenet_tcp_connect_mongod_port(httpd_t)


######################################
#
# Add some policies under the pulp_manage_puppet selinux boolean to allow httpd access
# to manage files, directory, and symlinks under the puppet_etc_t label
#

optional_policy(`
tunable_policy(`pulp_manage_puppet', `
allow httpd_t puppet_etc_t:dir { read remove_name rmdir write };
allow httpd_t puppet_etc_t:file { getattr unlink };
')
')

0 comments on commit d66e8f5

Please sign in to comment.