From 49024476309df1f6f32f34c40e793592687c9f26 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Tue, 21 Feb 2023 18:00:13 +0000 Subject: selinux: Define interfaces for libvirt and similar frameworks Services running passt will commonly need to transition to its domain, terminate it, connect and write to its socket. The init_daemon_domain() macro now defines the default transition to the passt_t domain, using the passt_exec_t type. Signed-off-by: Stefano Brivio --- contrib/selinux/passt.if | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'contrib/selinux/passt.if') diff --git a/contrib/selinux/passt.if b/contrib/selinux/passt.if index f689a99..893395b 100644 --- a/contrib/selinux/passt.if +++ b/contrib/selinux/passt.if @@ -15,3 +15,29 @@ interface(`passt_read_data',` allow $1 passt_t:dir { search add_name }; allow $1 passt_t:file { open read getattr }; ') + +interface(`passt_domtrans',` + gen_require(` + type passt_t, passt_exec_t; + ') + + corecmd_search_bin($1) + domtrans_pattern($1, passt_exec_t, passt_t) +') + +interface(`passt_socket',` + gen_require(` + type passt_t; + ') + + allow $1 user_tmp_t:sock_file write; + allow $1 passt_t:unix_stream_socket connectto; +') + +interface(`passt_kill',` + gen_require(` + type passt_t; + ') + + allow $1 passt_t:process { signal sigkill }; +') -- cgit v1.2.3