Skip to content

Commit

Permalink
Introduce RHEL 9 specific SELinux policy
Browse files Browse the repository at this point in the history
The type `systemd_userdbd_runtime_t` is only available on RHEL 9
and so RHEL 8 policy cannot contain it.

Ticket: ENT-9727
Changelog: None
  • Loading branch information
vpodzime committed Nov 8, 2023
1 parent 3bf6540 commit ba92b7b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions misc/selinux/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ endif
# explicit DISTFILES are required for these files to be part of a 'make dist'
# 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

CLEANFILES = cfengine-enterprise.pp cfengine-enterprise.if cfengine-enterprise.te
6 changes: 0 additions & 6 deletions misc/selinux/cfengine-enterprise.te.all
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ require {
type syslogd_var_run_t;
type system_dbusd_t;
type system_dbusd_var_run_t;
type systemd_userdbd_runtime_t;
type tmp_t;
type tmpfs_t;
role system_r;
Expand Down Expand Up @@ -643,11 +642,6 @@ allow cfengine_httpd_t tmp_t:file { create setattr unlink write rename };
allow cfengine_httpd_t tmp_t:dir { add_name remove_name write read };
allow cfengine_httpd_t var_t:dir read;

# PAM module for dynamic users
allow cfengine_httpd_t systemd_userdbd_runtime_t:dir { getattr open read search };
allow cfengine_httpd_t systemd_userdbd_runtime_t:sock_file write;
allow cfengine_httpd_t kernel_t:unix_stream_socket connectto;

# apparently, httpd creates some temporary bits in /tmp that it needs to mmap()
allow cfengine_httpd_t tmp_t:file map;

Expand Down
8 changes: 8 additions & 0 deletions misc/selinux/cfengine-enterprise.te.el9
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require {
type systemd_userdbd_runtime_t;
}

# PAM module for dynamic users
allow cfengine_httpd_t systemd_userdbd_runtime_t:dir { getattr open read search };
allow cfengine_httpd_t systemd_userdbd_runtime_t:sock_file write;
allow cfengine_httpd_t kernel_t:unix_stream_socket connectto;

0 comments on commit ba92b7b

Please sign in to comment.