: missing file context for system-tools-backends (gnome)
PATCH 1/1 : missing file context for system-tools-backends (gnome)
I think the following file context is still missing in current reference policy for an optional Gnome package (that shouldn't need its own policy):
Add the generic binary executable label to the script from System Tools Backends.
--- policy/modules/contrib/gnome.fc | 2 ++ 1 file changed, 2 insertions(+)
policy/modules/contrib/gnome.fc +2 -0
@@ -7,3 +7,5 @@ HOME_DIR/\.gnome2(/.*)? gen_context(sys /tmp/gconfd-USER/.* -- gen_context(system_u:object_r:gconf_tmp_t,s0) /usr/libexec/gconfd-2 -- gen_context(system_u:object_r:gconfd_exec_t,s0) + +/usr/share/system-tools-backends-2.0/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0)
PATCH 1/1 : missing file context for system-tools-backends (gnome)
Quoted 16 lines · Guido Trentalancia
I think the following file context is still missing in current reference policy for an optional Gnome package (that shouldn't need its own policy):
Add the generic binary executable label to the script from System Tools Backends.
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/gnome.fc | 2 ++ 1 file changed, 2 insertions(+)
policy/modules/contrib/gnome.fc HOME_DIR/\.gnome2(/.*)? gen_context(sys · line 11
Quoted 5 lines
policy/modules/contrib/gnome.fc +2
-0@@ -7,3 +7,5 @@ HOME_DIR/\.gnome2(/.*)? gen_context(sys /tmp/gconfd-USER/.* -- gen_context(system_u:object_r:gconf_tmp_t,s0) /usr/libexec/gconfd-2 -- gen_context(system_u:object_r:gconfd_exec_t,s0) + +/usr/share/system-tools-backends-2.0/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0)
This specification only applies to "-2.0". Can you make it more generic?
Maybe something like:
/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.pl
will work?
Quoted 4 lines
_______________________________________________
refpolicy mailing list
refpolicy at oss.tresys.com
http://oss.tresys.com/mailman/listinfo/refpolicy
PATCH 1/1 : missing file context for system-tools-backends (gnome)
Hello Dominick.
Quoted 25 lines · Dominick Grift
Quoted 16 lines · Guido Trentalancia
I think the following file context is still missing in current reference policy for an optional Gnome package (that shouldn't need its own policy):
Add the generic binary executable label to the script from System Tools Backends.
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/gnome.fc | 2 ++ 1 file changed, 2 insertions(+)policy/modules/contrib/gnome.fc HOME_DIR/\.gnome2(/.*)? gen_context(sys · line 11
Quoted 5 lines
policy/modules/contrib/gnome.fc +2
-0@@ -7,3 +7,5 @@ HOME_DIR/\.gnome2(/.*)? gen_context(sys /tmp/gconfd-USER/.* -- gen_context(system_u:object_r:gconf_tmp_t,s0) /usr/libexec/gconfd-2 -- gen_context(system_u:object_r:gconfd_exec_t,s0) + +/usr/share/system-tools-backends-2.0/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0)This specification only applies to "-2.0". Can you make it more generic?
Quoted 5 lines
Maybe something like:
/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.plwill work?
Yes, good point.
Also, it would better fit into the dbus module rather than the gnome one.
And I think when it is actually getting used, for example by gnome-system-tools, it needs at least some policy modifications to the dbus module (e.g. corecmd_exec_shell+corecmd_exec_bin), so it's a bit more complicated than just that.
Perhaps, this is a better starting point ?
policy/modules/contrib/dbus.fc +4 -0
@@ -8,10 +8,14 @@ /usr/bin/dbus-daemon(-1)? -- gen_context(system_u:object_r:dbusd_exec_t,s0) /usr/libexec/dbus-daemon-launch-helper -- gen_context(system_u:object_r:dbusd_exec_t,s0) +/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0) + /var/lib/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_lib_t,s0) /var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) +/var/cache/system-tools-backends(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) + ifdef(`distro_redhat',` /var/named/chroot/var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) ')
policy/modules/contrib/dbus.te +13 -0
@@ -9,6 +9,13 @@ gen_require(` # Delcarations # +## <desc> +## <p> +## Enable support for system-tools-backends. +## </p> +## </desc> +gen_tunable(allow_system_tools_backends, false) + attribute dbusd_unconfined; attribute session_bus_type;
@@ -112,6 +119,12 @@ corecmd_list_bin(system_dbusd_t) corecmd_read_bin_pipes(system_dbusd_t) corecmd_read_bin_sockets(system_dbusd_t) +# needed for system-tools-backends +tunable_policy(`allow_system_tools_backends',` + corecmd_exec_bin(system_dbusd_t) + corecmd_exec_shell(system_dbusd_t) +') + domain_use_interactive_fds(system_dbusd_t) domain_read_all_domains_state(system_dbusd_t)
Regards,
Guido
PATCH 1/1 : missing file context for system-tools-backends (gnome)
Quoted 39 lines · Guido Trentalancia
Hello Dominick.
Quoted 25 lines · Dominick Grift
Quoted 16 lines · Guido Trentalancia
I think the following file context is still missing in current reference policy for an optional Gnome package (that shouldn't need its own policy):
Add the generic binary executable label to the script from System Tools Backends.
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/gnome.fc | 2 ++ 1 file changed, 2 insertions(+)policy/modules/contrib/gnome.fc HOME_DIR/\.gnome2(/.*)? gen_context(sys · line 11
Quoted 5 lines
policy/modules/contrib/gnome.fc +2
-0@@ -7,3 +7,5 @@ HOME_DIR/\.gnome2(/.*)? gen_context(sys /tmp/gconfd-USER/.* -- gen_context(system_u:object_r:gconf_tmp_t,s0) /usr/libexec/gconfd-2 -- gen_context(system_u:object_r:gconfd_exec_t,s0) + +/usr/share/system-tools-backends-2.0/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0)This specification only applies to "-2.0". Can you make it more generic?
Quoted 5 lines
Maybe something like:
/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.plwill work?
Yes, good point.
Also, it would better fit into the dbus module rather than the gnome one.
Quoted 6 lines
And I think when it is actually getting used, for example by gnome-system-tools, it needs at least some policy modifications to the dbus module (e.g. corecmd_exec_shell+corecmd_exec_bin), so it's a bit more complicated than just that.
Perhaps, this is a better starting point ?
I dont know what this package actually is except to its description
"a set of cross-platform modules for Linux, FreeBSD and other Unix systems. The backends provide an common DBus interface to all platforms to modify or read the system configuration in a distro independent fashion. "
Looking at the fedora policy seems it only needs:
# needed for system-tools-backends corecmd_exec_shell(system_dbusd_t)
Whether this should allowed conditionally is debatable i guess.
Fedora allows it unconditionally.
I guess fedora decided to run this in the system_dbusd_t domain rather than in a private domain. I am not sure why that was decided and if thats optimal.
Also dont prepend your boolean names with "allow", prepend it with the name if the module that has it declared or something:dbus_system_tools_backend_support or something (not even sure whther this belongs in the dbus module)
Description should be something like: "Determine whether system tools backend is supported" or whatever.
Quoted 51 lines
policy/modules/contrib/dbus.fc +4
-0@@ -8,10 +8,14 @@ /usr/bin/dbus-daemon(-1)? -- gen_context(system_u:object_r:dbusd_exec_t,s0) /usr/libexec/dbus-daemon-launch-helper -- gen_context(system_u:object_r:dbusd_exec_t,s0) +/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0) + /var/lib/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_lib_t,s0) /var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) +/var/cache/system-tools-backends(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) + ifdef(`distro_redhat',` /var/named/chroot/var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) ')policy/modules/contrib/dbus.te +13
-0@@ -9,6 +9,13 @@ gen_require(` # Delcarations # +## <desc> +## <p> +## Enable support for system-tools-backends. +## </p> +## </desc> +gen_tunable(allow_system_tools_backends, false) + attribute dbusd_unconfined; attribute session_bus_type;@@ -112,6 +119,12 @@ corecmd_list_bin(system_dbusd_t) corecmd_read_bin_pipes(system_dbusd_t) corecmd_read_bin_sockets(system_dbusd_t) +# needed for system-tools-backends +tunable_policy(`allow_system_tools_backends',` + corecmd_exec_bin(system_dbusd_t) + corecmd_exec_shell(system_dbusd_t) +') + domain_use_interactive_fds(system_dbusd_t) domain_read_all_domains_state(system_dbusd_t)Regards,
Guido
PATCH 1/1 : missing file context for system-tools-backends (gnome)
And by the way the file context specification belongs in corecommands.fc file because of type bin_t.
Quoted 128 lines · Dominick Grift
Quoted 39 lines · Guido Trentalancia
Hello Dominick.
Quoted 25 lines · Dominick Grift
Quoted 16 lines · Guido Trentalancia
I think the following file context is still missing in current reference policy for an optional Gnome package (that shouldn't need its own policy):
Add the generic binary executable label to the script from System Tools Backends.
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/gnome.fc | 2 ++ 1 file changed, 2 insertions(+)policy/modules/contrib/gnome.fc HOME_DIR/\.gnome2(/.*)? gen_context(sys · line 11
Quoted 5 lines
policy/modules/contrib/gnome.fc +2
-0@@ -7,3 +7,5 @@ HOME_DIR/\.gnome2(/.*)? gen_context(sys /tmp/gconfd-USER/.* -- gen_context(system_u:object_r:gconf_tmp_t,s0) /usr/libexec/gconfd-2 -- gen_context(system_u:object_r:gconfd_exec_t,s0) + +/usr/share/system-tools-backends-2.0/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0)This specification only applies to "-2.0". Can you make it more generic?
Quoted 5 lines
Maybe something like:
/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.plwill work?
Yes, good point.
Also, it would better fit into the dbus module rather than the gnome one.
Quoted 6 lines
And I think when it is actually getting used, for example by gnome-system-tools, it needs at least some policy modifications to the dbus module (e.g. corecmd_exec_shell+corecmd_exec_bin), so it's a bit more complicated than just that.
Perhaps, this is a better starting point ?
I dont know what this package actually is except to its description
"a set of cross-platform modules for Linux, FreeBSD and other Unix systems. The backends provide an common DBus interface to all platforms to modify or read the system configuration in a distro independent fashion. "
Looking at the fedora policy seems it only needs:
# needed for system-tools-backends corecmd_exec_shell(system_dbusd_t)Whether this should allowed conditionally is debatable i guess.
Fedora allows it unconditionally.
I guess fedora decided to run this in the
system_dbusd_tdomain rather than in a private domain. I am not sure why that was decided and if thats optimal.Also dont prepend your boolean names with "allow", prepend it with the name if the module that has it declared or something:
dbus_system_tools_backend_supportor something (not even sure whther this belongs in the dbus module)Description should be something like: "Determine whether system tools backend is supported" or whatever.
Quoted 51 lines
policy/modules/contrib/dbus.fc +4
-0@@ -8,10 +8,14 @@ /usr/bin/dbus-daemon(-1)? -- gen_context(system_u:object_r:dbusd_exec_t,s0) /usr/libexec/dbus-daemon-launch-helper -- gen_context(system_u:object_r:dbusd_exec_t,s0) +/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0) + /var/lib/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_lib_t,s0) /var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) +/var/cache/system-tools-backends(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) + ifdef(`distro_redhat',` /var/named/chroot/var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) ')policy/modules/contrib/dbus.te +13
-0@@ -9,6 +9,13 @@ gen_require(` # Delcarations # +## <desc> +## <p> +## Enable support for system-tools-backends. +## </p> +## </desc> +gen_tunable(allow_system_tools_backends, false) + attribute dbusd_unconfined; attribute session_bus_type;@@ -112,6 +119,12 @@ corecmd_list_bin(system_dbusd_t) corecmd_read_bin_pipes(system_dbusd_t) corecmd_read_bin_sockets(system_dbusd_t) +# needed for system-tools-backends +tunable_policy(`allow_system_tools_backends',` + corecmd_exec_bin(system_dbusd_t) + corecmd_exec_shell(system_dbusd_t) +') + domain_use_interactive_fds(system_dbusd_t) domain_read_all_domains_state(system_dbusd_t)Regards,
Guido
PATCH v2 1/1 : missing file context for system-tools-backends (gnome)
Hello Dominick.
Quoted 2 lines · Dominick Grift
And by the way the file context specification belongs in corecommands.fc file because of type
bin_t.
I am not sure why you suggest a different name for the boolean, when the rest of the policy uses the "allow_" prefix for booleans that activate/deactivate support for components/packages.
However, here is a revised version with the amendments:
policy/modules/kernel/corecommands.fc +1 -0
@@ -295,6 +295,7 @@ ifdef(`distro_gentoo',` /usr/share/shorewall-lite(/.*)? gen_context(system_u:object_r:bin_t,s0) /usr/share/shorewall6-lite(/.*)? gen_context(system_u:object_r:bin_t,s0) /usr/share/spamassassin/sa-update\.cron gen_context(system_u:object_r:bin_t,s0) +/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0) /usr/share/turboprint/lib(/.*)? -- gen_context(system_u:object_r:bin_t,s0) /usr/share/vhostmd/scripts(/.*)? gen_context(system_u:object_r:bin_t,s0)
policy/modules/contrib/dbus.fc +2 -0
@@ -12,6 +12,8 @@ /var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) +/var/cache/system-tools-backends(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) + ifdef(`distro_redhat',` /var/named/chroot/var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) ')
policy/modules/contrib/dbus.te +13 -0
@@ -9,6 +9,13 @@ gen_require(` # Delcarations # +## <desc> +## <p> +## Determine whether system-tools-backends is supported. +## </p> +## </desc> +gen_tunable(system_tools_backends_support, true) + attribute dbusd_unconfined; attribute session_bus_type;
@@ -112,6 +119,12 @@ corecmd_list_bin(system_dbusd_t) corecmd_read_bin_pipes(system_dbusd_t) corecmd_read_bin_sockets(system_dbusd_t) +# needed for system-tools-backends +tunable_policy(`allow_system_tools_backends',` + corecmd_exec_bin(system_dbusd_t) + corecmd_exec_shell(system_dbusd_t) +') + domain_use_interactive_fds(system_dbusd_t) domain_read_all_domains_state(system_dbusd_t)
Regards,
Guido
Quoted 121 lines · Dominick Grift
Quoted 120 lines · Guido Trentalancia
Quoted 39 lines
Hello Dominick.
Quoted 25 lines · Dominick Grift
Quoted 16 lines · Guido Trentalancia
I think the following file context is still missing in current reference policy for an optional Gnome package (that shouldn't need its own policy):
Add the generic binary executable label to the script from System Tools Backends.
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/gnome.fc | 2 ++ 1 file changed, 2 insertions(+)policy/modules/contrib/gnome.fc HOME_DIR/\.gnome2(/.*)? gen_context(sys · line 11
Quoted 5 lines
policy/modules/contrib/gnome.fc +2
-0@@ -7,3 +7,5 @@ HOME_DIR/\.gnome2(/.*)? gen_context(sys /tmp/gconfd-USER/.* -- gen_context(system_u:object_r:gconf_tmp_t,s0) /usr/libexec/gconfd-2 -- gen_context(system_u:object_r:gconfd_exec_t,s0) + +/usr/share/system-tools-backends-2.0/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0)This specification only applies to "-2.0". Can you make it more generic?
Quoted 5 lines
Maybe something like:
/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.plwill work?
Yes, good point.
Also, it would better fit into the dbus module rather than the gnome one.
Quoted 6 lines
And I think when it is actually getting used, for example by gnome-system-tools, it needs at least some policy modifications to the dbus module (e.g. corecmd_exec_shell+corecmd_exec_bin), so it's a bit more complicated than just that.
Perhaps, this is a better starting point ?
I dont know what this package actually is except to its description
"a set of cross-platform modules for Linux, FreeBSD and other Unix systems. The backends provide an common DBus interface to all platforms to modify or read the system configuration in a distro independent fashion. "
Looking at the fedora policy seems it only needs:
# needed for system-tools-backends corecmd_exec_shell(system_dbusd_t)Whether this should allowed conditionally is debatable i guess.
Fedora allows it unconditionally.
I guess fedora decided to run this in the
system_dbusd_tdomain rather than in a private domain. I am not sure why that was decided and if thats optimal.Also dont prepend your boolean names with "allow", prepend it with the name if the module that has it declared or something:
dbus_system_tools_backend_supportor something (not even sure whther this belongs in the dbus module)Description should be something like: "Determine whether system tools backend is supported" or whatever.
Quoted 45 lines
policy/modules/contrib/dbus.fc +4
-0@@ -8,10 +8,14 @@ /usr/bin/dbus-daemon(-1)? -- gen_context(system_u:object_r:dbusd_exec_t,s0) /usr/libexec/dbus-daemon-launch-helper -- gen_context(system_u:object_r:dbusd_exec_t,s0) +/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0) + /var/lib/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_lib_t,s0) /var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) +/var/cache/system-tools-backends(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) + ifdef(`distro_redhat',` /var/named/chroot/var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) ')policy/modules/contrib/dbus.te +13
-0@@ -9,6 +9,13 @@ gen_require(` # Delcarations # +## <desc> +## <p> +## Enable support for system-tools-backends. +## </p> +## </desc> +gen_tunable(allow_system_tools_backends, false) + attribute dbusd_unconfined; attribute session_bus_type;@@ -112,6 +119,12 @@ corecmd_list_bin(system_dbusd_t) corecmd_read_bin_pipes(system_dbusd_t) corecmd_read_bin_sockets(system_dbusd_t) +# needed for system-tools-backends +tunable_policy(`allow_system_tools_backends',` + corecmd_exec_bin(system_dbusd_t) + corecmd_exec_shell(system_dbusd_t) +') + domain_use_interactive_fds(system_dbusd_t) domain_read_all_domains_state(system_dbusd_t)
PATCH v2 1/1 : missing file context for system-tools-backends (gnome)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 175 lines · Guido Trentalancia
Hello Dominick.
Quoted 2 lines · Dominick Grift
And by the way the file context specification belongs in corecommands.fc file because of type
bin_t.I am not sure why you suggest a different name for the boolean, when the rest of the policy uses the "
allow_" prefix for booleans that activate/deactivate support for components/packages.However, here is a revised version with the amendments:
--- refpolicy-04062012/policy/modules/kernel/corecommands.fc 2012-05-29
21:13:09.426703690 +0200 +++ refpolicy-04062012-system-tools-backends/policy/modules/kernel/corecommands.fc2012-06-21 20:30:47.631775829 +0200 @@ -295,6 +295,7 @@ifdef(
distro_gentoo',/usr/share/shorewall-lite(/.*)?gen_context(system_u:object_r:bin_t,s0)/usr/share/shorewall6-lite(/.*)?gen_context(system_u:object_r:bin_t,s0)/usr/share/spamassassin/sa-update\.crongen_context(system_u:object_r:bin_t,s0)+/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.pl--gen_context(system_u:object_r:bin_t,s0)/usr/share/turboprint/lib(/.*)? --gen_context(system_u:object_r:bin_t,s0)/usr/share/vhostmd/scripts(/.*)?gen_context(system_u:object_r:bin_t,s0)--- refpolicy-04062012/policy/modules/contrib/dbus.fc 2011-09-09
18:29:23.566610878 +0200 +++ refpolicy-04062012-system-tools-backends/policy/modules/contrib/dbus.fc2012-06-21 20:30:57.117774699 +0200 @@ -12,6 +12,8 @@/var/run/dbus(/.*)?
gen_context(system_u:object_r:system_dbusd_var_run_t,s0)+/var/cache/system-tools-backends(/.*)?
gen_context(system_u:object_r:system_dbusd_var_run_t,s0)+ ifdef(distro_redhat',/var/named/chroot/var/run/dbus(/.*)?gen_context(system_u:object_r:system_dbusd_var_run_t,s0)') ---
refpolicy-04062012/policy/modules/contrib/dbus.te 2011-09-09
18:29:23.566610878 +0200 +++ refpolicy-04062012-system-tools-backends/policy/modules/contrib/dbus.te2012-06-21 20:32:21.612867416 +0200 @@ -9,6 +9,13 @@ gen_require(` #Delcarations #
+## <desc> +## <p> +## Determine whether system-tools-backends is supported. +## </p> +## </desc> +gen_tunable(system_tools_backends_support, true) + attribute
dbusd_unconfined; attributesession_bus_type;policy/modules/contrib/dbus.te +3
-0@@ -112,6 +119,12 @@ corecmd_list_bin(system_dbusd_t) corecmd_read_bin_pipes(system_dbusd_t) corecmd_read_bin_sockets(system_dbusd_t) +# needed for system-tools-backends +tunable_policy(`allow_system_tools_backends',` + corecmd_exec_bin(system_dbusd_t) + corecmd_exec_shell(system_dbusd_t) +') + domain_use_interactive_fds(system_dbusd_t) domain_read_all_domains_state(system_dbusd_t)Regards,
Guido
Quoted 112 lines · Dominick Grift
Quoted 111 lines · Guido Trentalancia
Quoted 42 lines
Hello Dominick.
Quoted 25 lines · Dominick Grift
Quoted 14 lines · Guido Trentalancia
I think the following file context is still missing in current reference policy for an optional Gnome package (that shouldn't need its own policy):
Add the generic binary executable label to the script from System Tools Backends.
Signed-off-by Guido Trentalancia <[email protected]> ---policy/modules/contrib/gnome.fc | 2 ++ 1 file changed, 2
insertions(+)--- refpolicy-04062012/policy/modules/contrib/gnome.fc 2011-09-09
18:29:23.571610910 +0200 +++ refpolicy-04062012-system-tools-backends/policy/modules/contrib/gnome.fcQuoted 9 lines
2012-06-20 22:41:01.448465819 +0200 @@ -7,3 +7,5 @@HOME_DIR/\.gnome2(/.*)? gen_context(sys
/tmp/gconfd-USER/.*--gen_context(system_u:object_r:gconf_tmp_t,s0)
/usr/libexec/gconfd-2--gen_context(system_u:object_r:gconfd_exec_t,s0)++/usr/share/system-tools-backends-2.0/scripts/SystemToolsBackends.pl
--gen_context(system_u:object_r:bin_t,s0)Quoted 8 lines
This specification only applies to "-2.0". Can you make it more generic?
Maybe something like:
/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.plwill work?
Yes, good point.
Also, it would better fit into the dbus module rather than the gnome one.
Quoted 6 lines
And I think when it is actually getting used, for example by gnome-system-tools, it needs at least some policy modifications to the dbus module (e.g. corecmd_exec_shell+corecmd_exec_bin), so it's a bit more complicated than just that.
Perhaps, this is a better starting point ?
I dont know what this package actually is except to its description
"a set of cross-platform modules for Linux, FreeBSD and other Unix systems. The backends provide an common DBus interface to all platforms to modify or read the system configuration in a distro independent fashion. "
Looking at the fedora policy seems it only needs:
# needed for system-tools-backends corecmd_exec_shell(system_dbusd_t)Whether this should allowed conditionally is debatable i guess.
Fedora allows it unconditionally.
I guess fedora decided to run this in the
system_dbusd_tdomain rather than in a private domain. I am not sure why that was decided and if thats optimal.Also dont prepend your boolean names with "allow", prepend it with the name if the module that has it declared or something:
dbus_system_tools_backend_supportor something (not even sure whther this belongs in the dbus module)Description should be something like: "Determine whether system tools backend is supported" or whatever.
Quoted 34 lines
--- refpolicy-04062012/policy/modules/contrib/dbus.fc 2011-09-09
18:29:23.566610878 +0200 +++ refpolicy-04062012-system-tools-backends/policy/modules/contrib/dbus.fc2012-06-21 19:25:26.577167925 +0200 @@ -8,10 +8,14 @@/usr/bin/dbus-daemon(-1)? --
gen_context(system_u:object_r:dbusd_exec_t,s0)/usr/libexec/dbus-daemon-launch-helper--gen_context(system_u:object_r:dbusd_exec_t,s0)
+/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.pl--gen_context(system_u:object_r:bin_t,s0)+ /var/lib/dbus(/.*)?gen_context(system_u:object_r:system_dbusd_var_lib_t,s0)/var/run/dbus(/.*)?
gen_context(system_u:object_r:system_dbusd_var_run_t,s0)+/var/cache/system-tools-backends(/.*)?
gen_context(system_u:object_r:system_dbusd_var_run_t,s0)+ ifdef(distro_redhat',/var/named/chroot/var/run/dbus(/.*)?gen_context(system_u:object_r:system_dbusd_var_run_t,s0)') ---
refpolicy-04062012/policy/modules/contrib/dbus.te 2011-09-09
18:29:23.566610878 +0200 +++ refpolicy-04062012-system-tools-backends/policy/modules/contrib/dbus.te2012-06-21 19:22:02.830368908 +0200 @@ -9,6 +9,13 @@ gen_require(` #Delcarations #
+## <desc> +## <p> +## Enable support for system-tools-backends. +## </p> +## </desc> +gen_tunable(allow_system_tools_backends, false) + attribute
dbusd_unconfined; attributesession_bus_type;policy/modules/contrib/dbus.te +0
-0@@ -112,6 +119,12 @@ corecmd_list_bin(system_dbusd_t) corecmd_read_bin_pipes(system_dbusd_t) corecmd_read_bin_sockets(system_dbusd_t)
Quoted 11 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
(quoted diff) +2
-0+# needed for system-tools-backends +tunable_policy(`allow_system_tools_backends',` +
corecmd_exec_bin(system_dbusd_t)+corecmd_exec_shell(system_dbusd_t)+') +domain_use_interactive_fds(system_dbusd_t)domain_read_all_domains_state(system_dbusd_t)_______________________________________________ refpolicy mailing list refpolicy at oss.tresys.com http://oss.tresys.com/mailman/listinfo/refpolicy
I can't seem to find this package in Fedora 18?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEUEARECAAYFAk/jbacACgkQrlYvE4MpobOSGQCXUFHtI2IWmWhCO6sKB9jKSFj1 rwCgoMwMrORcCIlKiOnNta9vWfQC7Ng=
=ASMb
-----END PGP SIGNATURE-----
PATCH 1/1 : missing file context for system-tools-backends (gnome)
In reply to Dominick GriftQuoted 54 lines · Dominick Grift
Quoted 39 lines · Guido Trentalancia
Hello Dominick.
Quoted 25 lines · Dominick Grift
Quoted 16 lines · Guido Trentalancia
I think the following file context is still missing in current reference policy for an optional Gnome package (that shouldn't need its own policy):
Add the generic binary executable label to the script from System Tools Backends.
Signed-off-by Guido Trentalancia <[email protected]>--- policy/modules/contrib/gnome.fc | 2 ++ 1 file changed, 2 insertions(+)policy/modules/contrib/gnome.fc HOME_DIR/\.gnome2(/.*)? gen_context(sys · line 11
Quoted 5 lines
policy/modules/contrib/gnome.fc +2
-0@@ -7,3 +7,5 @@ HOME_DIR/\.gnome2(/.*)? gen_context(sys /tmp/gconfd-USER/.* -- gen_context(system_u:object_r:gconf_tmp_t,s0) /usr/libexec/gconfd-2 -- gen_context(system_u:object_r:gconfd_exec_t,s0) + +/usr/share/system-tools-backends-2.0/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0)This specification only applies to "-2.0". Can you make it more generic?
Quoted 5 lines
Maybe something like:
/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.plwill work?
Yes, good point.
Also, it would better fit into the dbus module rather than the gnome one.
Quoted 6 lines
And I think when it is actually getting used, for example by gnome-system-tools, it needs at least some policy modifications to the dbus module (e.g. corecmd_exec_shell+corecmd_exec_bin), so it's a bit more complicated than just that.
Perhaps, this is a better starting point ?
I dont know what this package actually is except to its description
"a set of cross-platform modules for Linux, FreeBSD and other Unix systems. The backends provide an common DBus interface to all platforms to modify or read the system configuration in a distro independent fashion. "
Quoted 6 lines
Looking at the fedora policy seems it only needs:
# needed for system-tools-backends corecmd_exec_shell(system_dbusd_t)Whether this should allowed conditionally is debatable i guess.
You're right, it's part of Gnome. Perhaps the boolean could be set to default to true ?
The point is that it hasn't got its own module so it runs as system_dbus_t and it's not strictly required to run Gnome either.
Finally, I haven't got a clear picture of how wide it is used.
Quoted 1 line
Fedora allows it unconditionally.
Yes, it allows corecmd_exec_shell unconditionally as in your quote. A very strict, limited functionality policy might not want to allow that for an auxiliary package.
Quoted 3 lines
I guess fedora decided to run this in the
system_dbusd_tdomain rather than in a private domain. I am not sure why that was decided and if thats optimal.
It's probably not optimal, but there are time and cost constraints too. With the boolean availability, we could optimize it a little further at virtually no cost.
Quoted 7 lines
Also dont prepend your boolean names with "allow", prepend it with the name if the module that has it declared or something:
dbus_system_tools_backend_supportor something (not even sure whther this belongs in the dbus module)Description should be something like: "Determine whether system tools backend is supported" or whatever.
That can be easily modified... It's not part of DBus. It's part of Gnome, it uses DBus.
Quoted 47 lines
Quoted 47 lines
policy/modules/contrib/dbus.fc +4
-0@@ -8,10 +8,14 @@ /usr/bin/dbus-daemon(-1)? -- gen_context(system_u:object_r:dbusd_exec_t,s0) /usr/libexec/dbus-daemon-launch-helper -- gen_context(system_u:object_r:dbusd_exec_t,s0) +/usr/share/system-tools-backends.*/scripts/SystemToolsBackends.pl -- gen_context(system_u:object_r:bin_t,s0) + /var/lib/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_lib_t,s0) /var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) +/var/cache/system-tools-backends(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) + ifdef(`distro_redhat',` /var/named/chroot/var/run/dbus(/.*)? gen_context(system_u:object_r:system_dbusd_var_run_t,s0) ')policy/modules/contrib/dbus.te +13
-0@@ -9,6 +9,13 @@ gen_require(` # Delcarations # +## <desc> +## <p> +## Enable support for system-tools-backends. +## </p> +## </desc> +gen_tunable(allow_system_tools_backends, false) + attribute dbusd_unconfined; attribute session_bus_type;@@ -112,6 +119,12 @@ corecmd_list_bin(system_dbusd_t) corecmd_read_bin_pipes(system_dbusd_t) corecmd_read_bin_sockets(system_dbusd_t) +# needed for system-tools-backends +tunable_policy(`allow_system_tools_backends',` + corecmd_exec_bin(system_dbusd_t) + corecmd_exec_shell(system_dbusd_t) +') + domain_use_interactive_fds(system_dbusd_t) domain_read_all_domains_state(system_dbusd_t)
Quoted 3 lines
Quoted 3 lines
Regards,
Guido
Regards,
Guido
PATCH 1/1 : missing file context for system-tools-backends (gnome)
In reply to Dominick GriftQuoted 2 lines · Dominick Grift
Quoted 1 line · Guido Trentalancia
Hello Dominick.
[cut]
Quoted 4 lines
Looking at the fedora policy seems it only needs:
# needed for system-tools-backends corecmd_exec_shell(system_dbusd_t)
And by the way, since you were asking, comecmd_exec_bin is needed when the backends are executed, for example, by gnome-system-tools (since the script had been labelled as a generic binary executable to avoid creating a new module built for the purpose).
Not everybody might want system_dbusd_t to execute binaries, so that's the reason for the boolean.
Regards,
Guido
PATCH 1/1 : missing file context for system-tools-backends (gnome)
Quoted 6 lines · Guido Trentalancia
And by the way, since you were asking,
comecmd_exec_binis needed when the backends are executed, for example, by gnome-system-tools (since the script had been labelled as a generic binary executable to avoid creating a new module built for the purpose).
Quoted 7 lines
Not everybody might want
system_dbusd_tto execute binaries, so that's the reason for the boolean.Regards,
Guido
I am still trying to make sense out of all this, but:
I guess we should make system-tools-backends a dbus_system_domain() i.e. make system_dbusd_t domain transition to a private domain type for system-tools-backends when its executable files get executed.
That way we don't have to allow systemd_dbusd_t to run generic binaries.
PATCH 1/1 : missing file context for system-tools-backends (gnome)
Hello Dominick.
Quoted 16 lines · Dominick Grift
Quoted 6 lines · Guido Trentalancia
And by the way, since you were asking,
comecmd_exec_binis needed when the backends are executed, for example, by gnome-system-tools (since the script had been labelled as a generic binary executable to avoid creating a new module built for the purpose).Quoted 7 lines
Not everybody might want
system_dbusd_tto execute binaries, so that's the reason for the boolean.Regards,
Guido
Quoted 7 lines
I am still trying to make sense out of all this, but:
I guess we should make system-tools-backends a
dbus_system_domain()i.e. makesystem_dbusd_tdomain transition to a private domain type for system-tools-backends when its executable files get executed.That way we don't have to allow
systemd_dbusd_tto run generic binaries.
Yes, that would be much better of course !
Consider gnome-system-tools is a GUI that is meant to configure network, system users, shared filesystems or folders and system time. That is why we would need a boolean as a lot of people would probably like to disable such administrative functionality in the policy (it is still possible to have the boolean default to true, as in the latest modification sketch that I posted, for a more usable generic system).
Can you sketch a few lines of policy modifications for the domain transition that you are talking about ? I guess you want to define a new domain, therefore create a new module for system-tools-backends ? And then allow a domain transition from dbus.te to such domain. And perhaps finally label the system-tools-backends perl script with its own ?_exec_t type instead of the generic binary which is more risky ?
Regards,
Guido
PATCH 1/1 : missing file context for system-tools-backends (gnome)
Quoted 7 lines · Guido Trentalancia
Consider gnome-system-tools is a GUI that is meant to configure network, system users, shared filesystems or folders and system time. That is why we would need a boolean as a lot of people would probably like to disable such administrative functionality in the policy (it is still possible to have the boolean default to true, as in the latest modification sketch that I posted, for a more usable generic system).
Quoted 6 lines
Can you sketch a few lines of policy modifications for the domain transition that you are talking about ? I guess you want to define a new domain, therefore create a new module for system-tools-backends ? And then allow a domain transition from dbus.te to such domain. And perhaps finally label the system-tools-backends perl script with its own ?_exec_t type instead of the generic binary which is more risky ?
I still can't imagine how this works but:
something like:
type stb_t;
type stb_exec_t;dbus_system_domain(stb_t, stb_exec_t)
role system_r types stb_t;
and then label the stb executable file(s) type stb_exec_t.
That should tell selinux to perform a domain transition from system_busd_t to stb_t on running files with type stb_exec_t.
You can also find me on irc.freenode.org at #selinux or #fedora-selinux
Quoted 4 lines
Regards,
Guido
PATCH 1/1 : missing file context for system-tools-backends (gnome)
Hello Dominick.
Quoted 25 lines · Dominick Grift
Quoted 7 lines · Guido Trentalancia
Consider gnome-system-tools is a GUI that is meant to configure network, system users, shared filesystems or folders and system time. That is why we would need a boolean as a lot of people would probably like to disable such administrative functionality in the policy (it is still possible to have the boolean default to true, as in the latest modification sketch that I posted, for a more usable generic system).
Quoted 6 lines
Can you sketch a few lines of policy modifications for the domain transition that you are talking about ? I guess you want to define a new domain, therefore create a new module for system-tools-backends ? And then allow a domain transition from dbus.te to such domain. And perhaps finally label the system-tools-backends perl script with its own ?_exec_t type instead of the generic binary which is more risky ?
I still can't imagine how this works but:
something like:
type
stb_t;
typestb_exec_t;dbus_system_domain(stb_t, stb_exec_t)
rolesystem_rtypesstb_t;
Quoted 4 lines
and then label the stb executable file(s) type
stb_exec_t.That should tell selinux to perform a domain transition from
system_busd_ttostb_ton running files with typestb_exec_t.
Yes, more or less what I was imagining.
I would need to test it first and then eventually submit another patch when possible.
It takes just a little bit more but at least we can get rid of the risky corecmd_* permissions.
Quoted 1 line
You can also find me on irc.freenode.org at #selinux or #fedora-selinux
My involvement at the moment is just as a sort of part-time hobbist and there is a lot more policy and stuff that I'd like to work on, but unfortunately work constrains do not always allow me to do that.
So, I bet further involvement with other online resources such as irc is impossible as the list is already considered as heavy load for me at the moment !
Consider I am also hitting a bug in libsepol when trying to build the latest policy, so there is a lot of things to sort out and time is very scarce...
And in reply to what Daniel added, I think Fedora has its own system configuration tools (for example the system-config-*), so that's probably the reason why they decided to drop gnome-system-tools and system-backends-tools if as you say it is not possible to find them anymore in the latest repository...
Thanks a lot for your comments though !
Regards,
Guido