systemd_test.te revision 5c7290b1956453024fc14abba2385ea9e9bccf8c
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirapolicy_module(systemd_test, 0.0.1)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira# declarations
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiraattribute systemd_test_domain_type;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirasystemd_test_base_template(systemd_test)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirasystemd_test_base_template(systemd_test_status)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirasystemd_test_base_template(systemd_test_start)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirasystemd_test_base_template(systemd_test_stop)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirasystemd_test_base_template(systemd_test_reload)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira# systemd_test_domain_type
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirarequire {
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira role system_r;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira role unconfined_r;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira type bin_t;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira type initrc_t;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira type systemd_systemctl_exec_t;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira type unconfined_service_t;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira}
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirarole system_r types systemd_test_domain_type;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirarole unconfined_r types systemd_test_domain_type;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiraallow systemd_test_domain_type bin_t: file entrypoint;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiraallow systemd_test_domain_type systemd_systemctl_exec_t: file entrypoint;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiraallow initrc_t systemd_test_domain_type: process transition;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiraallow unconfined_service_t systemd_test_domain_type: process transition;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiracorecmd_exec_bin(systemd_test_domain_type)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirainit_signal_script(systemd_test_domain_type)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirainit_sigchld_script(systemd_test_domain_type)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirasystemd_exec_systemctl(systemd_test_domain_type)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirauserdom_use_user_ttys(systemd_test_domain_type)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirauserdom_use_user_ptys(systemd_test_domain_type)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiraoptional_policy(`
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira dbus_system_bus_client(systemd_test_domain_type)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira init_dbus_chat(systemd_test_domain_type)
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira')
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira# systemd_test_*_t
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreirarequire {
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira type systemd_unit_file_t;
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira}
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiraallow systemd_test_status_t systemd_unit_file_t: service { status };
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiraallow systemd_test_start_t systemd_unit_file_t: service { start };
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiraallow systemd_test_stop_t systemd_unit_file_t: service { stop };
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreiraallow systemd_test_reload_t systemd_unit_file_t: service { reload };
b3e486b8194f238fdb7cdf977cb6943305b34b9cRafael Ferreira