Skip to contentSkip to conversation

Contrib updates from Gentoo

PATCH New Sven Vermeulen 3 participants 29 messages Apr 11, 2013 – Apr 17, 2013

lore
Share & tools
lore
#0 lore raw

cover Contrib updates from Gentoo

A set of contrib updates from Gentoo

Sven Vermeulen (13):
Allow asterisk admins to execute asterisk binary directly Support tagfiles for consolekit
ConsoleKit needs to read the dbus machine-id File context updates for courier-imap
Allow reading /proc/self for fail2ban due to FAM support Allow IRC clients to read certificates
Update on file contexts for OpenLDAP
Update on file contexts for wpa_supplicant Postfix creates defer(red) queue locations Update file contexts for puppet
Support ~/.tmux.conf as tmux configuration file Support tmux control socket
Add setuid/setgid capability to ulogd_t

 asterisk.if       | 21 +++++++++++++++++++++
 consolekit.te     |  6 ++++++
 courier.fc        |  2 ++
 dbus.if           |  1 +
 fail2ban.te       |  3 +++
 irc.te            |  1 +
 ldap.fc           |  5 +++++
 networkmanager.fc |  1 +
 postfix.te        |  2 ++
 puppet.fc         |  4 ++++
 screen.fc         |  1 +
 screen.if         |  1 +
 screen.te         |  3 ++-
 ulogd.te          |  2 +-
 14 files changed, 51 insertions(+), 2 deletions(-)
Signature · 1 line
1.8.1.5
#1 lore raw

PATCH 1/13 Allow asterisk admins to execute asterisk binary directly

Administrating Asterisk requires being able to run the asterisk binary (no transition needed, it acts as a client). For instance
http://www.voip-info.org/wiki/view/Asterisk+CLI shows an overview of common CLI commands ran by administrators through the asterisk binary.

Thus add in asterisk_exec($1) into the asterisk_admin() definition.

---
 asterisk.if | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
asterisk.if +21 -0
index 7268a04..26c8621 100644
@@ -113,6 +113,8 @@ interface(`asterisk_admin',`
 	role_transition $2 asterisk_initrc_exec_t system_r;
 	allow $2 system_r;
 
+	asterisk_exec($1)
+
 	files_list_tmp($1)
 	admin_pattern($1, asterisk_tmp_t)
 
@@ -131,3 +133,22 @@ interface(`asterisk_admin',`
 	files_list_pids($1)
 	admin_pattern($1, asterisk_var_run_t)
 ')
+
+######################################
+## <summary>
+##	Execute asterisk is the caller domain.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to execute asterisk
+##	</summary>
+## </param>
+#
+interface(`asterisk_exec',`
+	gen_require(`
+		type asterisk_exec_t;
+	')
+
+	corecmd_search_bin($1)
+	can_exec($1, asterisk_exec_t)
+')
Signature · 1 line
1.8.1.5
#2 lore raw

PATCH 1/13 Allow asterisk admins to execute asterisk binary directly

Quoted 6 lines · Sven Vermeulen

Administrating Asterisk requires being able to run the asterisk binary (no transition needed, it acts as a client). For instance
http://www.voip-info.org/wiki/view/Asterisk+CLI shows an overview of common CLI commands ran by administrators through the asterisk binary.

Thus add in asterisk_exec($1) into the asterisk_admin() definition.

Merged with changes, thanks

Moved asterisk exec to the right place and edited the interface xml header

Quoted 42 lines
---
 asterisk.if | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
asterisk.if +21 -0
index 7268a04..26c8621 100644
@@ -113,6 +113,8 @@ interface(`asterisk_admin',`
 	role_transition $2 asterisk_initrc_exec_t system_r;
 	allow $2 system_r;
 
+	asterisk_exec($1)
+
 	files_list_tmp($1)
 	admin_pattern($1, asterisk_tmp_t)
 
@@ -131,3 +133,22 @@ interface(`asterisk_admin',`
 	files_list_pids($1)
 	admin_pattern($1, asterisk_var_run_t)
 ')
+
+######################################
+## <summary>
+##	Execute asterisk is the caller domain.
+## </summary>
+## <param name="domain">
+##	<summary>
+##	Domain allowed to execute asterisk
+##	</summary>
+## </param>
+#
+interface(`asterisk_exec',`
+	gen_require(`
+		type asterisk_exec_t;
+	')
+
+	corecmd_search_bin($1)
+	can_exec($1, asterisk_exec_t)
+')
#3 lore raw

PATCH 2/13 Support tagfiles for consolekit

In reply to Sven Vermeulen

Gentoo currently still uses the pam-foreground compatibility, which causes ConsoleKit to set tagfiles in the pam_console tag directory (/var/run/console). As /var/run is dynamic nowadays, ConsoleKit also creates the directory.

Allow ConsoleKit to create such directory with the right file transition in place.

Debian also has this (already in policy) so duplicate settings for Gentoo. As the policy includes a transition, I'm less inclined to make this a global policy change as I have no idea what the impact would be on other distributions such as Fedora/RedHat.

---
 consolekit.te | 5 +++++
 1 file changed, 5 insertions(+)
consolekit.te +5 -0
index 5f0c793..aff2f51 100644
@@ -92,6 +92,11 @@ ifdef(`distro_debian',`
 	auth_pid_filetrans_pam_var_console(consolekit_t, dir, "console")
 ')
 
+ifdef(`distro_gentoo',`
+	auth_create_pam_console_data_dirs(consolekit_t)
+	auth_pid_filetrans_pam_var_console(consolekit_t, dir, "console")
+')
+
 optional_policy(`
 	dbus_system_domain(consolekit_t, consolekit_exec_t)
 
Signature · 1 line
1.8.1.5
#4 lore raw

PATCH 2/13 Support tagfiles for consolekit

Quoted 7 lines · Sven Vermeulen

Gentoo currently still uses the pam-foreground compatibility, which causes ConsoleKit to set tagfiles in the pam_console tag directory (/var/run/console). As /var/run is dynamic nowadays, ConsoleKit also creates the directory.

Allow ConsoleKit to create such directory with the right file transition in place.

Quoted 6 lines

Debian also has this (already in policy) so duplicate settings for Gentoo. As the policy includes a transition, I'm less inclined to make this a global policy change as I have no idea what the impact would be on other distributions such as Fedora/RedHat.

Merged with changes, thanks

Made this unconditional as this does not seem to conflict with fedora

Quoted 20 lines
---
 consolekit.te | 5 +++++
 1 file changed, 5 insertions(+)
consolekit.te +5 -0
index 5f0c793..aff2f51 100644
@@ -92,6 +92,11 @@ ifdef(`distro_debian',`
 	auth_pid_filetrans_pam_var_console(consolekit_t, dir, "console")
 ')
 
+ifdef(`distro_gentoo',`
+	auth_create_pam_console_data_dirs(consolekit_t)
+	auth_pid_filetrans_pam_var_console(consolekit_t, dir, "console")
+')
+
 optional_policy(`
 	dbus_system_domain(consolekit_t, consolekit_exec_t)
 
#5 lore raw

PATCH 3/13 ConsoleKit needs to read the dbus machine-id

In reply to Sven Vermeulen

The dbus integration in ConsoleKit reads in the machine-id as provided through dbus (/var/lib/dbus/machine-id).

On Gentoo, this location is a symbolic link to /etc/machine-id however, so we update the interface to support reading the symbolic link files too.

See also ConsoleKit's src/ck-manager.c function generate_session_cookie (calls dbus_get_local_machine_id).

---
 consolekit.te | 1 +
 dbus.if       | 1 +
 2 files changed, 2 insertions(+)
consolekit.te +1 -0
index aff2f51..6874d9a 100644
@@ -98,6 +98,7 @@ ifdef(`distro_gentoo',`
 ')
 
 optional_policy(`
+	dbus_read_lib_files(consolekit_t)
 	dbus_system_domain(consolekit_t, consolekit_exec_t)
 
 	optional_policy(`
dbus.if +1 -0
index afcf3a2..62d22cb 100644
@@ -356,6 +356,7 @@ interface(`dbus_read_lib_files',`
 
 	files_search_var_lib($1)
 	read_files_pattern($1, system_dbusd_var_lib_t, system_dbusd_var_lib_t)
+	read_lnk_files_pattern($1, system_dbusd_var_lib_t, system_dbusd_var_lib_t)
 ')
 
 ########################################
Signature · 1 line
1.8.1.5
#6 lore raw

PATCH 3/13 ConsoleKit needs to read the dbus machine-id

Quoted 10 lines · Sven Vermeulen

The dbus integration in ConsoleKit reads in the machine-id as provided through dbus (/var/lib/dbus/machine-id).

On Gentoo, this location is a symbolic link to /etc/machine-id however, so we update the interface to support reading the symbolic link files too.

See also ConsoleKit's src/ck-manager.c function generate_session_cookie (calls dbus_get_local_machine_id).

Merged, thanks

Quoted 29 lines
---
 consolekit.te | 1 +
 dbus.if       | 1 +
 2 files changed, 2 insertions(+)
consolekit.te +1 -0
index aff2f51..6874d9a 100644
@@ -98,6 +98,7 @@ ifdef(`distro_gentoo',`
 ')
 
 optional_policy(`
+	dbus_read_lib_files(consolekit_t)
 	dbus_system_domain(consolekit_t, consolekit_exec_t)
 
 	optional_policy(`
dbus.if +1 -0
index afcf3a2..62d22cb 100644
@@ -356,6 +356,7 @@ interface(`dbus_read_lib_files',`
 
 	files_search_var_lib($1)
 	read_files_pattern($1, system_dbusd_var_lib_t, system_dbusd_var_lib_t)
+	read_lnk_files_pattern($1, system_dbusd_var_lib_t, system_dbusd_var_lib_t)
 ')
 
 ########################################
#7 lore raw

PATCH 4/13 File context updates for courier-imap

In reply to Sven Vermeulen
---
 courier.fc | 2 ++
 1 file changed, 2 insertions(+)
courier.fc +2 -0
index 8a4b596..69bdc68 100644
@@ -4,9 +4,11 @@
 /usr/bin/imapd	--	gen_context(system_u:object_r:courier_pop_exec_t,s0)
 
 /usr/sbin/authdaemond	--	gen_context(system_u:object_r:courier_authdaemon_exec_t,s0)
+/usr/sbin/courier-imapd	--	gen_context(system_u:object_r:courier_pop_exec_t,s0)
 /usr/sbin/courierlogger	--	gen_context(system_u:object_r:courier_exec_t,s0)
 /usr/sbin/courierldapaliasd	--	gen_context(system_u:object_r:courier_exec_t,s0)
 /usr/sbin/couriertcpd	--	gen_context(system_u:object_r:courier_tcpd_exec_t,s0)
+/usr/sbin/imaplogin	--	gen_context(system_u:object_r:courier_authdaemon_exec_t,s0)
 
 /usr/lib/courier/authlib/.*	--	gen_context(system_u:object_r:courier_authdaemon_exec_t,s0)
 /usr/lib/courier/courier-authlib/.*	--	gen_context(system_u:object_r:courier_authdaemon_exec_t,s0)
Signature · 1 line
1.8.1.5
#8 lore raw

PATCH 4/13 File context updates for courier-imap

Quoted 1 line · Sven Vermeulen

Merged with changes, thanks

imaplogin is courier_pop_exec_t

Quoted 20 lines
---
 courier.fc | 2 ++
 1 file changed, 2 insertions(+)
courier.fc +2 -0
index 8a4b596..69bdc68 100644
@@ -4,9 +4,11 @@
 /usr/bin/imapd	--	gen_context(system_u:object_r:courier_pop_exec_t,s0)
 
 /usr/sbin/authdaemond	--	gen_context(system_u:object_r:courier_authdaemon_exec_t,s0)
+/usr/sbin/courier-imapd	--	gen_context(system_u:object_r:courier_pop_exec_t,s0)
 /usr/sbin/courierlogger	--	gen_context(system_u:object_r:courier_exec_t,s0)
 /usr/sbin/courierldapaliasd	--	gen_context(system_u:object_r:courier_exec_t,s0)
 /usr/sbin/couriertcpd	--	gen_context(system_u:object_r:courier_tcpd_exec_t,s0)
+/usr/sbin/imaplogin	--	gen_context(system_u:object_r:courier_authdaemon_exec_t,s0)
 
 /usr/lib/courier/authlib/.*	--	gen_context(system_u:object_r:courier_authdaemon_exec_t,s0)
 /usr/lib/courier/courier-authlib/.*	--	gen_context(system_u:object_r:courier_authdaemon_exec_t,s0)
#9 lore raw

PATCH 5/13 Allow reading /proc/self for fail2ban due to FAM support

In reply to Sven Vermeulen

fail2ban supports file monitoring solutions like Gamin, Pyinotify. When using Gamin, fail2ban launches a gam_server which, through FAM support, reads in /proc/self.

As this gam_server is only for the fail2ban activities and all permissions (except for read access to the fail2ban_t /proc itself), allow this in the fail2ban_t domain instead of creating a new domain for gam_server and transitioning to it.

---
 fail2ban.te | 3 +++
 1 file changed, 3 insertions(+)
fail2ban.te +3 -0
index 0872e50..919358a 100644
@@ -42,6 +42,9 @@ allow fail2ban_t self:fifo_file rw_fifo_file_perms;
 allow fail2ban_t self:unix_stream_socket { accept connectto listen };
 allow fail2ban_t self:tcp_socket { accept listen };
 
+# Needed for FAM support
+read_files_pattern(fail2ban_t, fail2ban_t, fail2ban_t)
+
 append_files_pattern(fail2ban_t, fail2ban_log_t, fail2ban_log_t)
 create_files_pattern(fail2ban_t, fail2ban_log_t, fail2ban_log_t)
 setattr_files_pattern(fail2ban_t, fail2ban_log_t, fail2ban_log_t)
Signature · 1 line
1.8.1.5
#10 lore raw

PATCH 5/13 Allow reading /proc/self for fail2ban due to FAM support

Quoted 10 lines · Sven Vermeulen

fail2ban supports file monitoring solutions like Gamin, Pyinotify. When using Gamin, fail2ban launches a gam_server which, through FAM support, reads in /proc/self.

As this gam_server is only for the fail2ban activities and all permissions (except for read access to the fail2ban_t /proc itself), allow this in the fail2ban_t domain instead of creating a new domain for gam_server and transitioning to it.

Merged, thanks

You do not have to add in line comments as you have the git commit messages

Quoted 18 lines
---
 fail2ban.te | 3 +++
 1 file changed, 3 insertions(+)
fail2ban.te +3 -0
index 0872e50..919358a 100644
@@ -42,6 +42,9 @@ allow fail2ban_t self:fifo_file rw_fifo_file_perms;
 allow fail2ban_t self:unix_stream_socket { accept connectto listen };
 allow fail2ban_t self:tcp_socket { accept listen };
 
+# Needed for FAM support
+read_files_pattern(fail2ban_t, fail2ban_t, fail2ban_t)
+
 append_files_pattern(fail2ban_t, fail2ban_log_t, fail2ban_log_t)
 create_files_pattern(fail2ban_t, fail2ban_log_t, fail2ban_log_t)
 setattr_files_pattern(fail2ban_t, fail2ban_log_t, fail2ban_log_t)
#11 lore raw

PATCH 6/13 Allow IRC clients to read certificates

In reply to Sven Vermeulen

To support IRC clients to connect to SSL-enabled IRC servers, allow irc clients to read the generic certificates.

---
 irc.te | 1 +
 1 file changed, 1 insertion(+)
irc.te +1 -0
index ecad9c7..ddf1595 100644
@@ -106,6 +106,7 @@ auth_use_nsswitch(irc_t)
 init_read_utmp(irc_t)
 init_dontaudit_lock_utmp(irc_t)
 
+miscfiles_read_generic_certs(irc_t)
 miscfiles_read_localization(irc_t)
 
 userdom_use_user_terminals(irc_t)
Signature · 1 line
1.8.1.5
#12 lore raw

PATCH 6/13 Allow IRC clients to read certificates

Quoted 4 lines · Sven Vermeulen

To support IRC clients to connect to SSL-enabled IRC servers, allow irc clients to read the generic certificates.

Merged, thanks

Quoted 16 lines
---
 irc.te | 1 +
 1 file changed, 1 insertion(+)
irc.te +1 -0
index ecad9c7..ddf1595 100644
@@ -106,6 +106,7 @@ auth_use_nsswitch(irc_t)
 init_read_utmp(irc_t)
 init_dontaudit_lock_utmp(irc_t)
 
+miscfiles_read_generic_certs(irc_t)
 miscfiles_read_localization(irc_t)
 
 userdom_use_user_terminals(irc_t)
#13 lore raw

PATCH 7/13 Update on file contexts for OpenLDAP

In reply to Sven Vermeulen
---
 ldap.fc | 5 +++++
 1 file changed, 5 insertions(+)
ldap.fc +5 -0
index bc25c95..b7e5679 100644
@@ -6,11 +6,16 @@
 
 /usr/sbin/slapd	--	gen_context(system_u:object_r:slapd_exec_t,s0)
 
+/usr/lib/openldap/slapd	--	gen_context(system_u:object_r:slapd_exec_t,s0)
 /usr/lib/slapd	--	gen_context(system_u:object_r:slapd_exec_t,s0)
 
 /var/lib/ldap(/.*)?	gen_context(system_u:object_r:slapd_db_t,s0)
 /var/lib/ldap/replog(/.*)?	gen_context(system_u:object_r:slapd_replog_t,s0)
 
+/var/lib/openldap-data(/.*)?	gen_context(system_u:object_r:slapd_db_t,s0)
+/var/lib/openldap-ldbm(/.*)?	gen_context(system_u:object_r:slapd_db_t,s0)
+/var/lib/openldap-slurpd(/.*)?	gen_context(system_u:object_r:slapd_db_t,s0)
+
 /var/lock/subsys/ldap	--	gen_context(system_u:object_r:slapd_lock_t,s0)
 /var/lock/subsys/slapd	--	gen_context(system_u:object_r:slapd_lock_t,s0)
 
Signature · 1 line
1.8.1.5
#14 lore raw

PATCH 7/13 Update on file contexts for OpenLDAP

Quoted 1 line · Sven Vermeulen

Merged, thanks

Quoted 25 lines
---
 ldap.fc | 5 +++++
 1 file changed, 5 insertions(+)
ldap.fc +5 -0
index bc25c95..b7e5679 100644
@@ -6,11 +6,16 @@
 
 /usr/sbin/slapd	--	gen_context(system_u:object_r:slapd_exec_t,s0)
 
+/usr/lib/openldap/slapd	--	gen_context(system_u:object_r:slapd_exec_t,s0)
 /usr/lib/slapd	--	gen_context(system_u:object_r:slapd_exec_t,s0)
 
 /var/lib/ldap(/.*)?	gen_context(system_u:object_r:slapd_db_t,s0)
 /var/lib/ldap/replog(/.*)?	gen_context(system_u:object_r:slapd_replog_t,s0)
 
+/var/lib/openldap-data(/.*)?	gen_context(system_u:object_r:slapd_db_t,s0)
+/var/lib/openldap-ldbm(/.*)?	gen_context(system_u:object_r:slapd_db_t,s0)
+/var/lib/openldap-slurpd(/.*)?	gen_context(system_u:object_r:slapd_db_t,s0)
+
 /var/lock/subsys/ldap	--	gen_context(system_u:object_r:slapd_lock_t,s0)
 /var/lock/subsys/slapd	--	gen_context(system_u:object_r:slapd_lock_t,s0)
 
#15 lore raw

PATCH 8/13 Update on file contexts for wpa_supplicant

In reply to Sven Vermeulen
---
 networkmanager.fc | 1 +
 1 file changed, 1 insertion(+)
networkmanager.fc +1 -0
index a1fb3c3..94b9734 100644
@@ -20,6 +20,7 @@
 /sbin/wpa_supplicant	--	gen_context(system_u:object_r:NetworkManager_exec_t,s0)
 
 /usr/bin/NetworkManager	--	gen_context(system_u:object_r:NetworkManager_exec_t,s0)
+/usr/bin/wpa_cli	--	gen_context(system_u:object_r:wpa_cli_exec_t,s0)
 /usr/bin/wpa_supplicant	--	gen_context(system_u:object_r:NetworkManager_exec_t,s0)
 
 /usr/sbin/NetworkManager	--	gen_context(system_u:object_r:NetworkManager_exec_t,s0)
Signature · 1 line
1.8.1.5
#16 lore raw

PATCH 8/13 Update on file contexts for wpa_supplicant

Quoted 1 line · Sven Vermeulen

Merged, thanks

Quoted 16 lines
---
 networkmanager.fc | 1 +
 1 file changed, 1 insertion(+)
networkmanager.fc +1 -0
index a1fb3c3..94b9734 100644
@@ -20,6 +20,7 @@
 /sbin/wpa_supplicant	--	gen_context(system_u:object_r:NetworkManager_exec_t,s0)
 
 /usr/bin/NetworkManager	--	gen_context(system_u:object_r:NetworkManager_exec_t,s0)
+/usr/bin/wpa_cli	--	gen_context(system_u:object_r:wpa_cli_exec_t,s0)
 /usr/bin/wpa_supplicant	--	gen_context(system_u:object_r:NetworkManager_exec_t,s0)
 
 /usr/sbin/NetworkManager	--	gen_context(system_u:object_r:NetworkManager_exec_t,s0)
#17 lore raw

PATCH 9/13 Postfix creates defer(red) queue locations

In reply to Sven Vermeulen

At startup, the Postfix daemon will check if the defer and deferred queues are available. If not, it will create them. Introduce the proper file transitions to support this.

---
 postfix.te | 2 ++
 1 file changed, 2 insertions(+)
postfix.te +2 -0
index 3f45a93..069bc2e 100644
@@ -244,6 +244,8 @@ create_dirs_pattern(postfix_master_t, postfix_spool_t, postfix_spool_maildrop_t)
 delete_files_pattern(postfix_master_t, postfix_spool_maildrop_t, postfix_spool_maildrop_t)
 rename_files_pattern(postfix_master_t, postfix_spool_maildrop_t, postfix_spool_maildrop_t)
 setattr_dirs_pattern(postfix_master_t, postfix_spool_maildrop_t, postfix_spool_maildrop_t)
+filetrans_pattern(postfix_master_t, postfix_spool_t, postfix_spool_maildrop_t, dir, "defer")
+filetrans_pattern(postfix_master_t, postfix_spool_t, postfix_spool_maildrop_t, dir, "deferred")
 filetrans_pattern(postfix_master_t, postfix_spool_t, postfix_spool_maildrop_t, dir, "maildrop")
 
 create_dirs_pattern(postfix_master_t, postfix_spool_t, postfix_var_run_t)
Signature · 1 line
1.8.1.5
#18 lore raw

PATCH 9/13 Postfix creates defer(red) queue locations

Quoted 3 lines · Sven Vermeulen

At startup, the Postfix daemon will check if the defer and deferred queues are available. If not, it will create them. Introduce the proper file transitions to support this.

If you are going to assign a new type for the defer/deferred directories then is the maildrop name the correct one? Those directories aren't for mail storage and the file contents are different to that which is used by programs such as maildrop.

It's always been postfix_spool_t for those directories, why do we need to change this?

Quoted 23 lines
---
 postfix.te | 2 ++
 1 file changed, 2 insertions(+)
postfix.te +2 -0
index 3f45a93..069bc2e 100644
@@ -244,6 +244,8 @@ create_dirs_pattern(postfix_master_t, postfix_spool_t,
 postfix_spool_maildrop_t) delete_files_pattern(postfix_master_t,
 postfix_spool_maildrop_t, postfix_spool_maildrop_t)
 rename_files_pattern(postfix_master_t, postfix_spool_maildrop_t,
 postfix_spool_maildrop_t) setattr_dirs_pattern(postfix_master_t,
 postfix_spool_maildrop_t, postfix_spool_maildrop_t)
+filetrans_pattern(postfix_master_t, postfix_spool_t,
 postfix_spool_maildrop_t, dir, "defer")
+filetrans_pattern(postfix_master_t, postfix_spool_t,

postfix_spool_maildrop_t, dir, "deferred") filetrans_pattern(postfix_master_t, postfix_spool_t, postfix_spool_maildrop_t, dir, "maildrop")

create_dirs_pattern(postfix_master_t, postfix_spool_t, postfix_var_run_t)

Signature · 2 lines
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
#19 lore raw

PATCH 9/13 Postfix creates defer(red) queue locations

Quoted 5 lines · Russell Coker
Quoted 3 lines · Sven Vermeulen

At startup, the Postfix daemon will check if the defer and deferred queues are available. If not, it will create them. Introduce the proper file transitions to support this.

Quoted 7 lines

If you are going to assign a new type for the defer/deferred directories then is the maildrop name the correct one? Those directories aren't for mail storage and the file contents are different to that which is used by programs such as maildrop.

It's always been postfix_spool_t for those directories, why do we need to change this?

Because they're not postfix_spool_t according to the file context def?

#v+
/var/spool/postfix/deferred(/.*)? -d gen_context(system_u:object_r:postfix_spool_maildrop_t,s0)
/var/spool/postfix/defer(/.*)? gen_context(system_u:object_r:postfix_spool_maildrop_t,s0)
#v-

What the patch does is streamline this so that we don't need restorecond or a relabel operation. Also, the deferred queue only has the directory labeled as such - mails that are moved between queues retain their label (postfix_spool_t).

Wkr,
Sven Vermeulen

#20 lore raw

PATCH 9/13 Postfix creates defer(red) queue locations

In reply to Sven Vermeulen
Quoted 5 lines · Sven Vermeulen

At startup, the Postfix daemon will check if the defer and deferred queues are available. If not, it will create them. Introduce the proper file transitions to support this.

Merged, thanks

Quoted 17 lines
---
 postfix.te | 2 ++
 1 file changed, 2 insertions(+)
postfix.te +2 -0
index 3f45a93..069bc2e 100644
@@ -244,6 +244,8 @@ create_dirs_pattern(postfix_master_t, postfix_spool_t, postfix_spool_maildrop_t)
 delete_files_pattern(postfix_master_t, postfix_spool_maildrop_t, postfix_spool_maildrop_t)
 rename_files_pattern(postfix_master_t, postfix_spool_maildrop_t, postfix_spool_maildrop_t)
 setattr_dirs_pattern(postfix_master_t, postfix_spool_maildrop_t, postfix_spool_maildrop_t)
+filetrans_pattern(postfix_master_t, postfix_spool_t, postfix_spool_maildrop_t, dir, "defer")
+filetrans_pattern(postfix_master_t, postfix_spool_t, postfix_spool_maildrop_t, dir, "deferred")
 filetrans_pattern(postfix_master_t, postfix_spool_t, postfix_spool_maildrop_t, dir, "maildrop")
 
 create_dirs_pattern(postfix_master_t, postfix_spool_t, postfix_var_run_t)
#21 lore raw

PATCH 10/13 Update file contexts for puppet

In reply to Sven Vermeulen
---
 puppet.fc | 4 ++++
 1 file changed, 4 insertions(+)
puppet.fc +4 -0
index 4ecda09..d68e26d 100644
@@ -3,6 +3,10 @@
 /etc/rc\.d/init\.d/puppet	--	gen_context(system_u:object_r:puppet_initrc_exec_t,s0)
 /etc/rc\.d/init\.d/puppetmaster	--	gen_context(system_u:object_r:puppetmaster_initrc_exec_t,s0)
 
+/usr/bin/puppetca	--	gen_context(system_u:object_r:puppetca_exec_t,s0)
+/usr/bin/puppetd	--	gen_context(system_u:object_r:puppet_exec_t,s0)
+/usr/bin/puppetmasterd	--	gen_context(system_u:object_r:puppetmaster_exec_t,s0)
+
 /usr/sbin/puppetca	--	gen_context(system_u:object_r:puppetca_exec_t,s0)
 /usr/sbin/puppetd	--	gen_context(system_u:object_r:puppet_exec_t,s0)
 /usr/sbin/puppetmasterd	--	gen_context(system_u:object_r:puppetmaster_exec_t,s0)
Signature · 1 line
1.8.1.5
#22 lore raw

PATCH 10/13 Update file contexts for puppet

Quoted 1 line · Sven Vermeulen

Merged, thanks

Quoted 19 lines
---
 puppet.fc | 4 ++++
 1 file changed, 4 insertions(+)
puppet.fc +4 -0
index 4ecda09..d68e26d 100644
@@ -3,6 +3,10 @@
 /etc/rc\.d/init\.d/puppet	--	gen_context(system_u:object_r:puppet_initrc_exec_t,s0)
 /etc/rc\.d/init\.d/puppetmaster	--	gen_context(system_u:object_r:puppetmaster_initrc_exec_t,s0)
 
+/usr/bin/puppetca	--	gen_context(system_u:object_r:puppetca_exec_t,s0)
+/usr/bin/puppetd	--	gen_context(system_u:object_r:puppet_exec_t,s0)
+/usr/bin/puppetmasterd	--	gen_context(system_u:object_r:puppetmaster_exec_t,s0)
+
 /usr/sbin/puppetca	--	gen_context(system_u:object_r:puppetca_exec_t,s0)
 /usr/sbin/puppetd	--	gen_context(system_u:object_r:puppet_exec_t,s0)
 /usr/sbin/puppetmasterd	--	gen_context(system_u:object_r:puppetmaster_exec_t,s0)
#23 lore raw

PATCH 11/13 Support ~/.tmux.conf as tmux configuration file

In reply to Sven Vermeulen

The tmux application is similar to screen, and already supported in the policy as such. Include ~/.tmux.conf as screen_home_t and include the proper transition when the file is created.

---
 screen.fc | 1 +
 screen.if | 1 +
 2 files changed, 2 insertions(+)
screen.fc +1 -0
index ac04d27..e7c2cf7 100644
@@ -1,5 +1,6 @@
 HOME_DIR/\.screen(/.*)?	gen_context(system_u:object_r:screen_home_t,s0)
 HOME_DIR/\.screenrc	--	gen_context(system_u:object_r:screen_home_t,s0)
+HOME_DIR/\.tmux\.conf	--	gen_context(system_u:object_r:screen_home_t,s0)
 
 /usr/bin/screen	--	gen_context(system_u:object_r:screen_exec_t,s0)
 /usr/bin/tmux	--	gen_context(system_u:object_r:screen_exec_t,s0)
screen.if +1 -0
index c21ddcc..be5cce2 100644
@@ -65,6 +65,7 @@ template(`screen_role_template',`
 
 	userdom_user_home_dir_filetrans($3, screen_home_t, dir, ".screen")
 	userdom_user_home_dir_filetrans($3, screen_home_t, file, ".screenrc")
+	userdom_user_home_dir_filetrans($3, screen_home_t, file, ".tmux.conf")
 
 	manage_dirs_pattern($3, screen_var_run_t, screen_var_run_t)
 	manage_files_pattern($3, screen_var_run_t, screen_var_run_t)
Signature · 1 line
1.8.1.5
#24 lore raw

PATCH 11/13 Support ~/.tmux.conf as tmux configuration file

Quoted 5 lines · Sven Vermeulen

The tmux application is similar to screen, and already supported in the policy as such. Include ~/.tmux.conf as screen_home_t and include the proper transition when the file is created.

Merged, thanks

Quoted 28 lines
---
 screen.fc | 1 +
 screen.if | 1 +
 2 files changed, 2 insertions(+)
screen.fc +1 -0
index ac04d27..e7c2cf7 100644
@@ -1,5 +1,6 @@
 HOME_DIR/\.screen(/.*)?	gen_context(system_u:object_r:screen_home_t,s0)
 HOME_DIR/\.screenrc	--	gen_context(system_u:object_r:screen_home_t,s0)
+HOME_DIR/\.tmux\.conf	--	gen_context(system_u:object_r:screen_home_t,s0)
 
 /usr/bin/screen	--	gen_context(system_u:object_r:screen_exec_t,s0)
 /usr/bin/tmux	--	gen_context(system_u:object_r:screen_exec_t,s0)
screen.if +1 -0
index c21ddcc..be5cce2 100644
@@ -65,6 +65,7 @@ template(`screen_role_template',`
 
 	userdom_user_home_dir_filetrans($3, screen_home_t, dir, ".screen")
 	userdom_user_home_dir_filetrans($3, screen_home_t, file, ".screenrc")
+	userdom_user_home_dir_filetrans($3, screen_home_t, file, ".tmux.conf")
 
 	manage_dirs_pattern($3, screen_var_run_t, screen_var_run_t)
 	manage_files_pattern($3, screen_var_run_t, screen_var_run_t)
#25 lore raw

PATCH 12/13 Support tmux control socket

In reply to Sven Vermeulen

The tmux application places its control socket in /tmp/tmux-*. Introduce a transition from screen_tmp_t (the /tmp/tmux-* directory) towards screen_var_run_t for socket files.

---
 screen.te | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
screen.te +2 -1
index f095081..75d538c 100644
@@ -38,12 +38,13 @@ allow screen_domain self:process signal_perms;
 allow screen_domain self:fd use;
 allow screen_domain self:fifo_file rw_fifo_file_perms;
 allow screen_domain self:tcp_socket { accept listen };
-allow screen_domain self:unix_stream_socket connectto;
+allow screen_domain self:unix_stream_socket { accept connectto listen };
 
 manage_dirs_pattern(screen_domain, screen_tmp_t, screen_tmp_t)
 manage_files_pattern(screen_domain, screen_tmp_t, screen_tmp_t)
 manage_fifo_files_pattern(screen_domain, screen_tmp_t, screen_tmp_t)
 files_tmp_filetrans(screen_domain, screen_tmp_t, { file dir })
+filetrans_pattern(screen_domain, screen_tmp_t, screen_var_run_t, sock_file)
 
 manage_fifo_files_pattern(screen_domain, screen_var_run_t, screen_var_run_t)
 manage_dirs_pattern(screen_domain, screen_var_run_t, screen_var_run_t)
Signature · 1 line
1.8.1.5
#26 lore raw

PATCH 12/13 Support tmux control socket

Quoted 5 lines · Sven Vermeulen

The tmux application places its control socket in /tmp/tmux-*. Introduce a transition from screen_tmp_t (the /tmp/tmux-* directory) towards screen_var_run_t for socket files.

Merged, thanks

Quoted 23 lines
---
 screen.te | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
screen.te +2 -1
index f095081..75d538c 100644
@@ -38,12 +38,13 @@ allow screen_domain self:process signal_perms;
 allow screen_domain self:fd use;
 allow screen_domain self:fifo_file rw_fifo_file_perms;
 allow screen_domain self:tcp_socket { accept listen };
-allow screen_domain self:unix_stream_socket connectto;
+allow screen_domain self:unix_stream_socket { accept connectto listen };
 
 manage_dirs_pattern(screen_domain, screen_tmp_t, screen_tmp_t)
 manage_files_pattern(screen_domain, screen_tmp_t, screen_tmp_t)
 manage_fifo_files_pattern(screen_domain, screen_tmp_t, screen_tmp_t)
 files_tmp_filetrans(screen_domain, screen_tmp_t, { file dir })
+filetrans_pattern(screen_domain, screen_tmp_t, screen_var_run_t, sock_file)
 
 manage_fifo_files_pattern(screen_domain, screen_var_run_t, screen_var_run_t)
 manage_dirs_pattern(screen_domain, screen_var_run_t, screen_var_run_t)
#27 lore raw

PATCH 13/13 Add setuid/setgid capability to ulogd_t

In reply to Sven Vermeulen

The ulog daemon, when launched with the "-u" option, will change uid/gid after it finished its root-required tasks. This is handled in src/ulogd.c. If we do not allow setuid/setgid, the following errors are displayed and the start-up fails.

Sun Mar 17 23:53:53 2013 <5> ulogd.c:1184 Changing UID / GID Sun Mar 17 23:53:53 2013 <8> ulogd.c:1186 can't set GID 245

---
 ulogd.te | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ulogd.te +1 -1
index c6acbbe..d41c4b1 100644
@@ -26,7 +26,7 @@ logging_log_file(ulogd_var_log_t)
 # Local policy
 #
 
-allow ulogd_t self:capability { net_admin sys_nice };
+allow ulogd_t self:capability { net_admin setuid setgid sys_nice };
 allow ulogd_t self:process setsched;
 allow ulogd_t self:netlink_nflog_socket create_socket_perms;
 allow ulogd_t self:netlink_socket create_socket_perms;
Signature · 1 line
1.8.1.5
#28 lore raw

PATCH 13/13 Add setuid/setgid capability to ulogd_t

Quoted 10 lines · Sven Vermeulen

The ulog daemon, when launched with the "-u" option, will change uid/gid after it finished its root-required tasks. This is handled in src/ulogd.c. If we do not allow setuid/setgid, the following errors are displayed and the start-up fails.

Sun Mar 17 23:53:53 2013 <5> ulogd.c:1184 Changing UID / GID Sun Mar 17 23:53:53 2013 <8> ulogd.c:1186 can't set GID 245

Merged, thanks

Quoted 17 lines
---
 ulogd.te | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ulogd.te +1 -1
index c6acbbe..d41c4b1 100644
@@ -26,7 +26,7 @@ logging_log_file(ulogd_var_log_t)
 # Local policy
 #
 
-allow ulogd_t self:capability { net_admin sys_nice };
+allow ulogd_t self:capability { net_admin setuid setgid sys_nice };
 allow ulogd_t self:process setsched;
 allow ulogd_t self:netlink_nflog_socket create_socket_perms;
 allow ulogd_t self:netlink_socket create_socket_perms;