commit: eeb241f1c72608674a22fdd992c29709dc52b00f Author: Dave Sugar <dsugar <AT> tresys <DOT> com> AuthorDate: Sun Apr 28 14:28:51 2019 +0000 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org> CommitDate: Sat Jul 13 06:43:14 2019 +0000 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=eeb241f1
create interfaces for NetworkManager units Create interfaces to allow start/stop, enable/disable and status of NetworkManager systemd unit Signed-off-by: Jason Zaman <jason <AT> perfinion.com> policy/modules/services/networkmanager.if | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/policy/modules/services/networkmanager.if b/policy/modules/services/networkmanager.if index 371ebfbd..39ff8cc0 100644 --- a/policy/modules/services/networkmanager.if +++ b/policy/modules/services/networkmanager.if @@ -293,6 +293,63 @@ interface(`networkmanager_stream_connect',` stream_connect_pattern($1, NetworkManager_var_run_t, NetworkManager_var_run_t, NetworkManager_t) ') +######################################## +## <summary> +## Allow specified domain to enable/disable NetworkManager units +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`networkmanager_enabledisable',` + gen_require(` + type NetworkManager_unit_t; + class service { enable disable }; + ') + + allow $1 NetworkManager_unit_t:service { enable disable }; +') + +######################################## +## <summary> +## Allow specified domain to start/stop NetworkManager units +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`networkmanager_startstop',` + gen_require(` + type NetworkManager_unit_t; + class service { start stop }; + ') + + allow $1 NetworkManager_unit_t:service { start stop }; +') + +######################################## +## <summary> +## Allow specified domain to get status of NetworkManager +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`networkmanager_status',` + gen_require(` + type NetworkManager_unit_t; + class service status; + ') + + allow $1 NetworkManager_unit_t:service status; +') + ######################################## ## <summary> ## All of the rules required to