Skip to contentSkip to conversation

ifplugd: Allow transition to init scripts

PATCH New Jason Zaman 2 participants 12 messages Apr 12, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 ifplugd: Allow transition to init scripts

---
 ifplugd.te | 2 ++
 1 file changed, 2 insertions(+)
ifplugd.te +2 -0
index 9267c1b..78bcd14 100644
@@ -53,6 +53,8 @@ domain_dontaudit_read_all_domains_state(ifplugd_t)
 
 auth_use_nsswitch(ifplugd_t)
 
+init_domtrans_script(ifplugd_t)
+
 logging_send_syslog_msg(ifplugd_t)
 
 miscfiles_read_localization(ifplugd_t)
Signature · 1 line
2.16.1
#1 lore raw

PATCH 2/6 Fix /run/samba context generated by samba init script

From: Scall <[email protected]>

---
 samba.te | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samba.te +1 -1
index f6042e7..4357fe5 100644
@@ -114,7 +114,7 @@ init_daemon_domain(nmbd_t, nmbd_exec_t)
 
 type samba_var_run_t;
 typealias samba_var_run_t alias { nmbd_var_run_t smbd_var_run_t };
-files_pid_file(samba_var_run_t)
+init_daemon_pid_file(samba_var_run_t, dir, "samba")
 
 type samba_etc_t;
 files_config_file(samba_etc_t)
Signature · 1 line
2.16.1
#3 lore raw

PATCH 3/6 gnome: add fcontext gconf_tmp_t for /run/user/%{USERID}/dconf

In reply to Jason Zaman
---
 gnome.fc | 1 +
 1 file changed, 1 insertion(+)
gnome.fc +1 -0
index 744ff68..14f78b3 100644
@@ -20,3 +20,4 @@ HOME_DIR/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
 /run/user/%{USERID}/keyring(/.*)?		gen_context(system_u:object_r:gnome_keyring_tmp_t,s0)
 /run/user/[^/]*/orcexec\..*	--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
 /run/user/%{USERID}/orcexec\..*	--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
+/run/user/%{USERID}/dconf(/.*)?		gen_context(system_u:object_r:gconf_tmp_t,s0)
Signature · 1 line
2.16.1
#5 lore raw

PATCH 4/6 mozilla: allow map usr, home, tmp files

In reply to Jason Zaman
---
 mozilla.te | 5 +++++
 1 file changed, 5 insertions(+)
mozilla.te +5 -0
index bc45d50..08496b6 100644
@@ -108,6 +108,7 @@ manage_lnk_files_pattern(mozilla_t, mozilla_tmpfs_t, mozilla_tmpfs_t)
 manage_fifo_files_pattern(mozilla_t, mozilla_tmpfs_t, mozilla_tmpfs_t)
 manage_sock_files_pattern(mozilla_t, mozilla_tmpfs_t, mozilla_tmpfs_t)
 fs_tmpfs_filetrans(mozilla_t, mozilla_tmpfs_t, { file lnk_file sock_file fifo_file })
+allow mozilla_t mozilla_plugin_tmpfs_t:file map;
 
 allow mozilla_t mozilla_plugin_rw_t:dir list_dir_perms;
 allow mozilla_t mozilla_plugin_rw_t:file read_file_perms;
@@ -347,6 +348,7 @@ allow mozilla_plugin_t mozilla_t:sem create_sem_perms;
 manage_dirs_pattern(mozilla_plugin_t, { mozilla_home_t mozilla_plugin_home_t }, { mozilla_home_t mozilla_plugin_home_t })
 manage_files_pattern(mozilla_plugin_t, { mozilla_home_t mozilla_plugin_home_t }, mozilla_plugin_home_t)
 manage_lnk_files_pattern(mozilla_plugin_t, { mozilla_home_t mozilla_plugin_home_t }, mozilla_plugin_home_t)
+allow mozilla_plugin_t mozilla_home_t:file map;
 
 userdom_user_home_dir_filetrans(mozilla_plugin_t, mozilla_home_t, dir, ".galeon")
 userdom_user_home_dir_filetrans(mozilla_plugin_t, mozilla_home_t, dir, ".mozilla")
@@ -370,6 +372,8 @@ manage_fifo_files_pattern(mozilla_plugin_t, mozilla_plugin_tmp_t, mozilla_plugin
 files_tmp_filetrans(mozilla_plugin_t, mozilla_plugin_tmp_t, { dir file fifo_file })
 userdom_user_tmp_filetrans(mozilla_plugin_t, mozilla_plugin_tmp_t, { dir file fifo_file })
 
+allow mozilla_plugin_t mozilla_tmp_t:file rw_file_perms;
+
 manage_files_pattern(mozilla_plugin_t, mozilla_plugin_tmpfs_t, mozilla_plugin_tmpfs_t)
 manage_lnk_files_pattern(mozilla_plugin_t, mozilla_plugin_tmpfs_t, mozilla_plugin_tmpfs_t)
 manage_fifo_files_pattern(mozilla_plugin_t, mozilla_plugin_tmpfs_t, mozilla_plugin_tmpfs_t)
@@ -479,6 +483,7 @@ files_exec_usr_files(mozilla_plugin_t)
 files_list_mnt(mozilla_plugin_t)
 files_read_config_files(mozilla_plugin_t)
 files_read_usr_files(mozilla_plugin_t)
+files_map_usr_files(mozilla_plugin_t)
 
 fs_getattr_all_fs(mozilla_plugin_t)
 # fs_read_hugetlbfs_files(mozilla_plugin_t)
Signature · 1 line
2.16.1
#7 lore raw

PATCH 5/6 mta: Add msmtp fcontexts and allow ssl certs

In reply to Jason Zaman
---
 mta.fc | 3 +++
 mta.te | 1 +
 2 files changed, 4 insertions(+)
mta.fc +3 -0
index ace4a1f..66634b0 100644
@@ -2,6 +2,7 @@ HOME_DIR/\.esmtp_queue	--	gen_context(system_u:object_r:mail_home_t,s0)
 HOME_DIR/\.forward[^/]*	--	gen_context(system_u:object_r:mail_home_t,s0)
 HOME_DIR/dead\.letter	--	gen_context(system_u:object_r:mail_home_t,s0)
 HOME_DIR/\.mailrc	--	gen_context(system_u:object_r:mail_home_t,s0)
+HOME_DIR/\.msmtprc	--	gen_context(system_u:object_r:mail_home_t,s0)
 HOME_DIR/Maildir(/.*)?	gen_context(system_u:object_r:mail_home_rw_t,s0)
 HOME_DIR/DovecotMail(/.*)?	gen_context(system_u:object_r:mail_home_rw_t,s0)
 HOME_DIR/\.maildir(/.*)?	gen_context(system_u:object_r:mail_home_rw_t,s0)
@@ -10,10 +11,12 @@ HOME_DIR/\.maildir(/.*)?	gen_context(system_u:object_r:mail_home_rw_t,s0)
 /etc/aliases\.db	--	gen_context(system_u:object_r:etc_aliases_t,s0)
 /etc/mail(/.*)?	gen_context(system_u:object_r:etc_mail_t,s0)
 /etc/mail/aliases.*	--	gen_context(system_u:object_r:etc_aliases_t,s0)
+/etc/msmtprc		--	gen_context(system_u:object_r:etc_mail_t,s0)
 /etc/postfix/aliases.*	--	gen_context(system_u:object_r:etc_aliases_t,s0)
 
 /usr/bin/esmtp	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
 /usr/bin/mail(x)?	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
+/usr/bin/msmtp	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
 /usr/bin/rmail	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
 /usr/bin/sendmail\.postfix	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
 /usr/bin/sendmail(\.sendmail)?	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
mta.te +1 -0
index 6320c52..b02ee2b 100644
@@ -109,6 +109,7 @@ init_dontaudit_rw_utmp(user_mail_domain)
 
 logging_send_syslog_msg(user_mail_domain)
 
+miscfiles_read_all_certs(user_mail_domain)
 miscfiles_read_localization(user_mail_domain)
 
 tunable_policy(`use_samba_home_dirs',`
Signature · 1 line
2.16.1
#9 lore raw

PATCH 6/6 virt: Add netlink socket and filetrans

In reply to Jason Zaman
---
 virt.te | 2 ++
 1 file changed, 2 insertions(+)
virt.te +2 -0
index 0907fd8..a20bfa3 100644
@@ -471,6 +471,7 @@ allow virtd_t self:tcp_socket { accept listen };
 allow virtd_t self:tun_socket { create_socket_perms relabelfrom relabelto };
 allow virtd_t self:rawip_socket create_socket_perms;
 allow virtd_t self:packet_socket create_socket_perms;
+allow virtd_t self:netlink_generic_socket create_socket_perms;
 allow virtd_t self:netlink_kobject_uevent_socket create_socket_perms;
 allow virtd_t self:netlink_route_socket nlmsg_write;
 
@@ -489,6 +490,7 @@ domtrans_pattern(virtd_t, virtd_lxc_exec_t, virtd_lxc_t)
 
 manage_dirs_pattern(virtd_t, virt_cache_t, virt_cache_t)
 manage_files_pattern(virtd_t, virt_cache_t, virt_cache_t)
+files_var_filetrans(virtd_t, virt_cache_t, { file dir })
 
 manage_dirs_pattern(virtd_t, virt_content_t, virt_content_t)
 manage_files_pattern(virtd_t, virt_content_t, virt_content_t)
Signature · 1 line
2.16.1
#11 lore raw

PATCH 1/6 ifplugd: Allow transition to init scripts

In reply to Jason Zaman
Quoted 9 lines · Jason Zaman
---
  ifplugd.te | 2 ++
  1 file changed, 2 insertions(+)
ifplugd.te +0 -0
index 9267c1b..78bcd14 100644

ifplugd.te domain_dontaudit_read_all_domains_state(ifplugd_t) · line 60

Quoted 8 lines
ifplugd.te +2 -0
@@ -53,6 +53,8 @@ domain_dontaudit_read_all_domains_state(ifplugd_t)
 
  auth_use_nsswitch(ifplugd_t)
 
+init_domtrans_script(ifplugd_t)
+
  logging_send_syslog_msg(ifplugd_t)
 
  miscfiles_read_localization(ifplugd_t)

Merged.

Signature · 1 line
Chris PeBenito
#2 lore raw

PATCH 2/6 Fix /run/samba context generated by samba init script

In reply to Jason Zaman
Quoted 11 lines · Jason Zaman

From: Scall <[email protected]>

---
  samba.te | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
samba.te +0 -0
index f6042e7..4357fe5 100644

samba.te init_daemon_domain(nmbd_t, nmbd_exec_t) · line 120

Quoted 8 lines
samba.te +1 -1
@@ -114,7 +114,7 @@ init_daemon_domain(nmbd_t, nmbd_exec_t)
 
  type samba_var_run_t;
  typealias samba_var_run_t alias { nmbd_var_run_t smbd_var_run_t };
-files_pid_file(samba_var_run_t)
+init_daemon_pid_file(samba_var_run_t, dir, "samba")
 
  type samba_etc_t;
  files_config_file(samba_etc_t)

Merged.

Signature · 1 line
Chris PeBenito
#4 lore raw

PATCH 3/6 gnome: add fcontext gconf_tmp_t for /run/user/%{USERID}/dconf

In reply to Jason Zaman

gnome.fc HOME_DIR/orcexec\..* gen_context(system_u:object_r:gstreamer_orcexec_t,s0) · line 23

Quoted 13 lines · Jason Zaman
---
  gnome.fc | 1 +
  1 file changed, 1 insertion(+)
gnome.fc +1 -0
index 744ff68..14f78b3 100644
@@ -20,3 +20,4 @@ HOME_DIR/orcexec\..*	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
  /run/user/%{USERID}/keyring(/.*)?		gen_context(system_u:object_r:gnome_keyring_tmp_t,s0)
  /run/user/[^/]*/orcexec\..*	--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
  /run/user/%{USERID}/orcexec\..*	--	gen_context(system_u:object_r:gstreamer_orcexec_t,s0)
+/run/user/%{USERID}/dconf(/.*)?		gen_context(system_u:object_r:gconf_tmp_t,s0)

Merged.

Signature · 1 line
Chris PeBenito
#6 lore raw

PATCH 4/6 mozilla: allow map usr, home, tmp files

In reply to Jason Zaman
Quoted 34 lines · Jason Zaman
---
  mozilla.te | 5 +++++
  1 file changed, 5 insertions(+)
mozilla.te +4 -0
index bc45d50..08496b6 100644
@@ -108,6 +108,7 @@ manage_lnk_files_pattern(mozilla_t, mozilla_tmpfs_t, mozilla_tmpfs_t)
  manage_fifo_files_pattern(mozilla_t, mozilla_tmpfs_t, mozilla_tmpfs_t)
  manage_sock_files_pattern(mozilla_t, mozilla_tmpfs_t, mozilla_tmpfs_t)
  fs_tmpfs_filetrans(mozilla_t, mozilla_tmpfs_t, { file lnk_file sock_file fifo_file })
+allow mozilla_t mozilla_plugin_tmpfs_t:file map;
 
  allow mozilla_t mozilla_plugin_rw_t:dir list_dir_perms;
  allow mozilla_t mozilla_plugin_rw_t:file read_file_perms;
@@ -347,6 +348,7 @@ allow mozilla_plugin_t mozilla_t:sem create_sem_perms;
  manage_dirs_pattern(mozilla_plugin_t, { mozilla_home_t mozilla_plugin_home_t }, { mozilla_home_t mozilla_plugin_home_t })
  manage_files_pattern(mozilla_plugin_t, { mozilla_home_t mozilla_plugin_home_t }, mozilla_plugin_home_t)
  manage_lnk_files_pattern(mozilla_plugin_t, { mozilla_home_t mozilla_plugin_home_t }, mozilla_plugin_home_t)
+allow mozilla_plugin_t mozilla_home_t:file map;
 
  userdom_user_home_dir_filetrans(mozilla_plugin_t, mozilla_home_t, dir, ".galeon")
  userdom_user_home_dir_filetrans(mozilla_plugin_t, mozilla_home_t, dir, ".mozilla")
@@ -370,6 +372,8 @@ manage_fifo_files_pattern(mozilla_plugin_t, mozilla_plugin_tmp_t, mozilla_plugin
  files_tmp_filetrans(mozilla_plugin_t, mozilla_plugin_tmp_t, { dir file fifo_file })
  userdom_user_tmp_filetrans(mozilla_plugin_t, mozilla_plugin_tmp_t, { dir file fifo_file })
 
+allow mozilla_plugin_t mozilla_tmp_t:file rw_file_perms;
+
  manage_files_pattern(mozilla_plugin_t, mozilla_plugin_tmpfs_t, mozilla_plugin_tmpfs_t)
  manage_lnk_files_pattern(mozilla_plugin_t, mozilla_plugin_tmpfs_t, mozilla_plugin_tmpfs_t)
  manage_fifo_files_pattern(mozilla_plugin_t, mozilla_plugin_tmpfs_t, mozilla_plugin_tmpfs_t)

mozilla.te files_exec_usr_files(mozilla_plugin_t) · line 489

Quoted 7 lines
mozilla.te +1 -0
@@ -479,6 +483,7 @@ files_exec_usr_files(mozilla_plugin_t)
  files_list_mnt(mozilla_plugin_t)
  files_read_config_files(mozilla_plugin_t)
  files_read_usr_files(mozilla_plugin_t)
+files_map_usr_files(mozilla_plugin_t)
 
  fs_getattr_all_fs(mozilla_plugin_t)
  # fs_read_hugetlbfs_files(mozilla_plugin_t)

Merged.

Signature · 1 line
Chris PeBenito
#8 lore raw

PATCH 5/6 mta: Add msmtp fcontexts and allow ssl certs

In reply to Jason Zaman
Quoted 35 lines · Jason Zaman
---
  mta.fc | 3 +++
  mta.te | 1 +
  2 files changed, 4 insertions(+)
mta.fc +3 -0
index ace4a1f..66634b0 100644
@@ -2,6 +2,7 @@ HOME_DIR/\.esmtp_queue	--	gen_context(system_u:object_r:mail_home_t,s0)
  HOME_DIR/\.forward[^/]*	--	gen_context(system_u:object_r:mail_home_t,s0)
  HOME_DIR/dead\.letter	--	gen_context(system_u:object_r:mail_home_t,s0)
  HOME_DIR/\.mailrc	--	gen_context(system_u:object_r:mail_home_t,s0)
+HOME_DIR/\.msmtprc	--	gen_context(system_u:object_r:mail_home_t,s0)
  HOME_DIR/Maildir(/.*)?	gen_context(system_u:object_r:mail_home_rw_t,s0)
  HOME_DIR/DovecotMail(/.*)?	gen_context(system_u:object_r:mail_home_rw_t,s0)
  HOME_DIR/\.maildir(/.*)?	gen_context(system_u:object_r:mail_home_rw_t,s0)
@@ -10,10 +11,12 @@ HOME_DIR/\.maildir(/.*)?	gen_context(system_u:object_r:mail_home_rw_t,s0)
  /etc/aliases\.db	--	gen_context(system_u:object_r:etc_aliases_t,s0)
  /etc/mail(/.*)?	gen_context(system_u:object_r:etc_mail_t,s0)
  /etc/mail/aliases.*	--	gen_context(system_u:object_r:etc_aliases_t,s0)
+/etc/msmtprc		--	gen_context(system_u:object_r:etc_mail_t,s0)
  /etc/postfix/aliases.*	--	gen_context(system_u:object_r:etc_aliases_t,s0)
 
  /usr/bin/esmtp	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
  /usr/bin/mail(x)?	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
+/usr/bin/msmtp	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
  /usr/bin/rmail	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
  /usr/bin/sendmail\.postfix	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
  /usr/bin/sendmail(\.sendmail)?	--	gen_context(system_u:object_r:sendmail_exec_t,s0)
mta.te +0 -0
index 6320c52..b02ee2b 100644

mta.te init_dontaudit_rw_utmp(user_mail_domain) · line 115

Quoted 7 lines
mta.te +1 -0
@@ -109,6 +109,7 @@ init_dontaudit_rw_utmp(user_mail_domain)
 
  logging_send_syslog_msg(user_mail_domain)
 
+miscfiles_read_all_certs(user_mail_domain)
  miscfiles_read_localization(user_mail_domain)
 
  tunable_policy(`use_samba_home_dirs',`

Merged.

Signature · 1 line
Chris PeBenito
#10 lore raw

PATCH 6/6 virt: Add netlink socket and filetrans

In reply to Jason Zaman
Quoted 17 lines · Jason Zaman
---
  virt.te | 2 ++
  1 file changed, 2 insertions(+)
virt.te +1 -0
index 0907fd8..a20bfa3 100644
@@ -471,6 +471,7 @@ allow virtd_t self:tcp_socket { accept listen };
  allow virtd_t self:tun_socket { create_socket_perms relabelfrom relabelto };
  allow virtd_t self:rawip_socket create_socket_perms;
  allow virtd_t self:packet_socket create_socket_perms;
+allow virtd_t self:netlink_generic_socket create_socket_perms;
  allow virtd_t self:netlink_kobject_uevent_socket create_socket_perms;
  allow virtd_t self:netlink_route_socket nlmsg_write;
 

virt.te domtrans_pattern(virtd_t, virtd_lxc_exec_t, virtd_lxc_t) · line 496

Quoted 7 lines
virt.te +1 -0
@@ -489,6 +490,7 @@ domtrans_pattern(virtd_t, virtd_lxc_exec_t, virtd_lxc_t)
 
  manage_dirs_pattern(virtd_t, virt_cache_t, virt_cache_t)
  manage_files_pattern(virtd_t, virt_cache_t, virt_cache_t)
+files_var_filetrans(virtd_t, virt_cache_t, { file dir })
 
  manage_dirs_pattern(virtd_t, virt_content_t, virt_content_t)
  manage_files_pattern(virtd_t, virt_content_t, virt_content_t)

Merged.

Signature · 1 line
Chris PeBenito