Add interfaces to control ntpd_unit_t systemd services
PATCH 2/2 interface to enable/disable systemd_networkd service
In reply to David SugarSigned-off-by Dave Sugar <[email protected]>
--- policy/modules/system/systemd.if | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
policy/modules/system/systemd.if +19 -0
@@ -467,6 +467,25 @@ interface(`systemd_manage_networkd_units',` manage_files_pattern($1, systemd_networkd_unit_t, systemd_networkd_unit_t) ') +######################################## +## <summary> +## Allow specified domain to enable systemd-networkd units +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`systemd_enabledisable_networkd',` + gen_require(` + type systemd_networkd_unit_t; + class service { enable disable }; + ') + + allow $1 systemd_networkd_unit_t:service { enable disable }; +') + ######################################## ## <summary> ## Allow specified domain to start systemd-networkd units
Signature · 1 line
2.19.1
PATCH 1/2 Add interfaces to control ntpd_unit_t systemd services
Signed-off-by Dave Sugar <[email protected]>
--- policy/modules/services/ntp.if | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+)
policy/modules/services/ntp.if +63 -0
@@ -177,6 +177,69 @@ interface(`ntp_rw_shm',` fs_search_tmpfs($1) ') +######################################## +## <summary> +## Allow specified domain to enable/disable ntpd unit +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ntp_enabledisable',` + ifdef(`init_systemd',` + gen_require(` + type ntpd_unit_t; + class service { enable disable }; + ') + + allow $1 ntpd_unit_t:service { enable disable }; + ') +') + +######################################## +## <summary> +## Allow specified domain to start/stop ntpd unit +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ntp_startstop',` + ifdef(`init_systemd',` + gen_require(` + type ntpd_unit_t; + class service { start stop }; + ') + + allow $1 ntpd_unit_t:service { start stop }; + ') +') + +######################################## +## <summary> +## Allow specified domain to get status of ntpd unit +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ntp_status',` + ifdef(`init_systemd',` + gen_require(` + type ntpd_unit_t; + class service status; + ') + + allow $1 ntpd_unit_t:service status; + ') +') + ######################################## ## <summary> ## All of the rules required to
Signature · 1 line
2.19.1
Quoted 69 lines · David Sugar
Signed-off-by Dave Sugar <[email protected]>--- policy/modules/services/ntp.if | 63 ++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+)policy/modules/services/ntp.if +56
-0@@ -177,6 +177,69 @@ interface(`ntp_rw_shm',` fs_search_tmpfs($1) ') +######################################## +## <summary> +## Allow specified domain to enable/disable ntpd unit +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ntp_enabledisable',` + ifdef(`init_systemd',` + gen_require(` + type ntpd_unit_t; + class service { enable disable }; + ') + + allow $1 ntpd_unit_t:service { enable disable }; + ') +') + +######################################## +## <summary> +## Allow specified domain to start/stop ntpd unit +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ntp_startstop',` + ifdef(`init_systemd',` + gen_require(` + type ntpd_unit_t; + class service { start stop }; + ') + + allow $1 ntpd_unit_t:service { start stop }; + ') +') + +######################################## +## <summary> +## Allow specified domain to get status of ntpd unit +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`ntp_status',` + ifdef(`init_systemd',` + gen_require(` + type ntpd_unit_t;
policy/modules/services/ntp.if interface(`ntp_rw_shm',` · line 245
Quoted 10 lines
policy/modules/services/ntp.if +7
-0+ class service status; + ') + + allow $1 ntpd_unit_t:service status; + ') +') + ######################################## ## <summary> ## All of the rules required to
Merged.
Signature · 1 line
Chris PeBenito
Re: [PATCH 2/2] interface to enable/disable systemd_networkd service
In reply to David SugarQuoted 25 lines · David Sugar
Signed-off-by Dave Sugar <[email protected]>--- policy/modules/system/systemd.if | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)policy/modules/system/systemd.if +12
-0@@ -467,6 +467,25 @@ interface(`systemd_manage_networkd_units',` manage_files_pattern($1, systemd_networkd_unit_t, systemd_networkd_unit_t) ') +######################################## +## <summary> +## Allow specified domain to enable systemd-networkd units +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`systemd_enabledisable_networkd',` + gen_require(`
policy/modules/system/systemd.if interface(`systemd_manage_networkd_units',` · line 491
Quoted 10 lines
policy/modules/system/systemd.if +7
-0+ type systemd_networkd_unit_t; + class service { enable disable }; + ') + + allow $1 systemd_networkd_unit_t:service { enable disable }; +') + ######################################## ## <summary> ## Allow specified domain to start systemd-networkd units
Merged.
Signature · 1 line
Chris PeBenito