## policy for sosreport
########################################
##
## Execute a domain transition to run sosreport.
##
##
##
## Domain allowed to transition.
##
##
#
interface(`sosreport_domtrans',`
gen_require(`
type sosreport_t, sosreport_exec_t;
')
domtrans_pattern($1, sosreport_exec_t, sosreport_t)
')
########################################
##
## Execute sosreport in the sosreport domain, and
## allow the specified role the sosreport domain.
##
##
##
## Domain allowed access
##
##
##
##
## The role to be allowed the sosreport domain.
##
##
#
interface(`sosreport_run',`
gen_require(`
type sosreport_t;
')
sosreport_domtrans($1)
role $2 types sosreport_t;
')
########################################
##
## Role access for sosreport
##
##
##
## Role allowed access
##
##
##
##
## User domain for the role
##
##
#
interface(`sosreport_role',`
gen_require(`
type sosreport_t;
')
role $1 types sosreport_t;
sosreport_domtrans($2)
ps_process_pattern($2, sosreport_t)
allow $2 sosreport_t:process signal;
')
########################################
##
## Allow the specified domain to read
## sosreport tmp files.
##
##
##
## Domain allowed access.
##
##
#
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)
')
########################################
##
## Delete sosreport tmp files.
##
##
##
## Domain allowed access.
##
##
#
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)
')
########################################
##
## Append sosreport tmp files.
##
##
##
## Domain allowed access.
##
##
#
interface(`sosreport_append_tmp_files',`
gen_require(`
type sosreport_tmp_t;
')
allow $1 sosreport_tmp_t:file append;
')