2006-01-16 18:30:14 +00:00
|
|
|
## <summary>Collection of tools for managing UNIX services</summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Policy for DJB's daemontools
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## An ipc channel between the supervised domain and svc_start_t
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## Domain allowed access to svc_start_t.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`daemontools_ipc_domain',`
|
|
|
|
gen_require(`
|
|
|
|
type svc_start_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 svc_start_t:process sigchld;
|
|
|
|
allow $1 svc_start_t:fd use;
|
|
|
|
allow $1 svc_start_t:fifo_file { read write getattr };
|
|
|
|
allow svc_start_t $1:process signal;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Define a specified domain as a supervised service.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## </param>
|
|
|
|
## <param name="entrypoint">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## The type associated with the process program.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`daemontools_service_domain',`
|
|
|
|
gen_require(`
|
|
|
|
type svc_run_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
domain_auto_trans(svc_run_t, $2, $1)
|
|
|
|
daemontools_ipc_domain($1)
|
|
|
|
|
|
|
|
allow svc_run_t $1:process signal;
|
|
|
|
allow $1 svc_run_t:fd use;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute in the svc_start_t domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`daemontools_domtrans_start',`
|
|
|
|
gen_require(`
|
|
|
|
type svc_start_t, svc_start_exec_t;
|
|
|
|
')
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern($1, svc_start_exec_t, svc_start_t)
|
2006-01-16 18:30:14 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute in the svc_run_t domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`daemontools_domtrans_run',`
|
|
|
|
gen_require(`
|
|
|
|
type svc_run_t, svc_run_exec_t;
|
|
|
|
')
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern($1, svc_run_exec_t, svc_run_t)
|
2006-01-16 18:30:14 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute in the svc_multilog_t domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`daemontools_domtrans_multilog',`
|
|
|
|
gen_require(`
|
|
|
|
type svc_multilog_t, svc_multilog_exec_t;
|
|
|
|
')
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern($1, svc_multilog_exec_t, svc_multilog_t)
|
2006-01-16 18:30:14 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow a domain to read svc_svc_t files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2006-01-16 18:30:14 +00:00
|
|
|
#
|
|
|
|
interface(`daemontools_read_svc',`
|
|
|
|
gen_require(`
|
|
|
|
type svc_svc_t;
|
|
|
|
')
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 svc_svc_t:dir list_dir_perms;
|
|
|
|
allow $1 svc_svc_t:file read_file_perms;
|
2006-01-16 18:30:14 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow a domain to create svc_svc_t files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-16 18:30:14 +00:00
|
|
|
## </param>
|
2006-09-06 22:07:25 +00:00
|
|
|
## <rolecap/>
|
2006-01-16 18:30:14 +00:00
|
|
|
#
|
|
|
|
interface(`daemontools_manage_svc',`
|
|
|
|
gen_require(`
|
|
|
|
type svc_svc_t;
|
|
|
|
')
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 svc_svc_t:dir manage_dir_perms;
|
|
|
|
allow $1 svc_svc_t:fifo_file manage_fifo_file_perms;
|
|
|
|
allow $1 svc_svc_t:file manage_file_perms;
|
2006-01-16 18:30:14 +00:00
|
|
|
allow $1 svc_svc_t:lnk_file { read create };
|
|
|
|
')
|