Oreon-Lime-R2/selinux-policy/selinux-policy-d9f4a2b/selinux-policy-d9f4a2bbeb91fd95d0c35a90936efb9ea99d2455/policy/modules/contrib/sosreport.if

186 lines
3.6 KiB
Text

## <summary>Generate debugging information for system.</summary>
########################################
## <summary>
## Execute a domain transition to run sosreport.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`sosreport_domtrans',`
gen_require(`
type sosreport_t, sosreport_exec_t;
')
corecmd_search_bin($1)
domtrans_pattern($1, sosreport_exec_t, sosreport_t)
')
########################################
## <summary>
## Execute sosreport in the sosreport
## domain, and allow the specified
## role the sosreport domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="role">
## <summary>
## Role allowed access.
## </summary>
## </param>
#
interface(`sosreport_run',`
gen_require(`
attribute_role sosreport_roles;
')
sosreport_domtrans($1)
roleattribute $2 sosreport_roles;
')
########################################
## <summary>
## Role access for sosreport.
## </summary>
## <param name="role">
## <summary>
## Role allowed access.
## </summary>
## </param>
## <param name="domain">
## <summary>
## User domain for the role.
## </summary>
## </param>
#
interface(`sosreport_role',`
gen_require(`
type sosreport_t;
')
sosreport_run($2, $1)
allow $2 sosreport_t:process { ptrace signal_perms };
ps_process_pattern($2, sosreport_t)
')
########################################
## <summary>
## Read sosreport temporary files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`sosreport_read_tmp_files',`
gen_require(`
type sosreport_tmp_t;
')
files_search_tmp($1)
read_files_pattern($1, sosreport_tmp_t, sosreport_tmp_t)
')
########################################
## <summary>
## Append sosreport temporary files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`sosreport_append_tmp_files',`
gen_require(`
type sosreport_tmp_t;
')
files_search_tmp($1)
append_files_pattern($1, sosreport_tmp_t, sosreport_tmp_t)
')
########################################
## <summary>
## Delete sosreport temporary files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`sosreport_delete_tmp_files',`
gen_require(`
type sosreport_tmp_t;
')
files_delete_tmp_dir_entry($1)
delete_files_pattern($1, sosreport_tmp_t, sosreport_tmp_t)
')
########################################
## <summary>
## Send a null signal to sosreport.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`sosreport_signull',`
gen_require(`
type sosreport_t;
')
allow $1 sosreport_t:process signull;
')
########################################
## <summary>
## Send and receive messages from
## sosreport over dbus.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`sosreport_dbus_chat',`
gen_require(`
type sosreport_t;
class dbus send_msg;
')
allow $1 sosreport_t:dbus send_msg;
allow sosreport_t $1:dbus send_msg;
')
########################################
## <summary>
## Send a message to sosreport over the datagram socket.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`sosreport_dgram_send',`
gen_require(`
type sosreport_t;
')
allow $1 sosreport_t:unix_dgram_socket sendto;
')