Skip to content
Open
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
1 change: 1 addition & 0 deletions misc/selinux/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ endif
# tarball even without running './configure --with-selinux-policy'
DISTFILES = Makefile.in Makefile.am cfengine-enterprise.fc cfengine-enterprise.te.all
DISTFILES += cfengine-enterprise.te.el9
DISTFILES += cfengine-enterprise.te.el10

CLEANFILES = cfengine-enterprise.pp cfengine-enterprise.if cfengine-enterprise.te
71 changes: 71 additions & 0 deletions misc/selinux/cfengine-enterprise.te.el10
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
require {
type cfengine_reactor_t;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am suspicious about all the requires. I remember this biting us in the past. Look at other policies for hints on using macros for many includes instead.

type cfengine_postgres_t;
type sysfs_t;
type proc_t;
type devpts_t;
type hugetlbfs_t;
type cfengine_hub_t;
type cfengine_execd_t;
type cfengine_apachectl_t;
type tty_device_t;
type user_devpts_t;
type cfengine_httpd_t;
type http_port_t;
type cfengine_httpd_exec_t;
type cfengine_serverd_t;
type systemd_userdbd_runtime_t;
type systemd_userdbd_t;
type kernel_t;
class tcp_socket name_connect;
class dir { getattr open read search };
class file { getattr open read write };
class capability { dac_override dac_read_search sys_ptrace };
class chr_file getattr;
class lnk_file read;
class sock_file write;
class unix_stream_socket connectto;
}

#============= cfengine_apachectl_t ==============
allow cfengine_apachectl_t devpts_t:dir { getattr search };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be interesting to compare this to a standard apache httpd policy.

allow cfengine_apachectl_t proc_t:file getattr;
allow cfengine_apachectl_t self:capability { dac_override dac_read_search sys_ptrace };
allow cfengine_apachectl_t sysfs_t:dir read;
allow cfengine_apachectl_t sysfs_t:file { open read };
allow cfengine_apachectl_t tty_device_t:chr_file getattr;
allow cfengine_apachectl_t user_devpts_t:chr_file getattr;

# selinux-policy requires the following http_port permissions whereas 3.14.3 does not.
# these permissions are not be needed if changes from ENT-12954 to masterfiles policy move inventory from common to an agent bundle are in place.
#============= cfengine_execd_t ==============
allow cfengine_execd_t http_port_t:tcp_socket name_connect;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any clue why cf-execd (and cf-serverd below) want to be able to connect to HTTP? Something new in pre-eval?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, would be good to reference masterfiles. Maybe it is us trying to query the aws api in inventory!?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, we actually have it commented in the EL9 policy. Please do the same here.


#============= cfengine_httpd_t ==============
allow cfengine_httpd_t hugetlbfs_t:file { read write };
allow cfengine_httpd_t systemd_userdbd_runtime_t:dir { open read getattr search };
allow cfengine_httpd_t systemd_userdbd_runtime_t:lnk_file read;
allow cfengine_httpd_t systemd_userdbd_runtime_t:sock_file write;
allow cfengine_httpd_t systemd_userdbd_t:unix_stream_socket connectto;
allow cfengine_httpd_t kernel_t:unix_stream_socket connectto;

#============= cfengine_hub_t ==============
allow cfengine_hub_t cfengine_httpd_exec_t:file getattr;
allow cfengine_hub_t sysfs_t:lnk_file read;

#============= cfengine_postgres_t ==============
allow cfengine_postgres_t systemd_userdbd_runtime_t:dir { open read getattr search };
allow cfengine_postgres_t systemd_userdbd_runtime_t:lnk_file read;
allow cfengine_postgres_t systemd_userdbd_runtime_t:sock_file write;
allow cfengine_postgres_t systemd_userdbd_t:unix_stream_socket connectto;
allow cfengine_postgres_t kernel_t:unix_stream_socket connectto;

#============= cfengine_reactor_t ==============
allow cfengine_reactor_t systemd_userdbd_runtime_t:dir { open read getattr search };
allow cfengine_reactor_t systemd_userdbd_runtime_t:lnk_file read;
allow cfengine_reactor_t systemd_userdbd_runtime_t:sock_file write;
allow cfengine_reactor_t systemd_userdbd_t:unix_stream_socket connectto;
allow cfengine_reactor_t kernel_t:unix_stream_socket connectto;

#============= cfengine_serverd_t ==============
allow cfengine_serverd_t http_port_t:tcp_socket name_connect;
Loading