2005-07-13 20:48:51 +00:00
|
|
|
## <summary>Name service cache daemon</summary>
|
|
|
|
|
2006-04-12 15:04:28 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send generic signals to NSCD.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_signal',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 nscd_t:process signal;
|
|
|
|
')
|
|
|
|
|
2009-06-30 19:27:21 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send NSCD the kill signal.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_kill',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 nscd_t:process sigkill;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Send signulls to NSCD.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_signull',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 nscd_t:process signull;
|
|
|
|
')
|
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute NSCD in the nscd domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-05 13:03:19 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-13 20:48:51 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_domtrans',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_t, nscd_exec_t;
|
|
|
|
')
|
|
|
|
|
2007-03-23 23:24:59 +00:00
|
|
|
corecmd_search_bin($1)
|
2008-07-23 21:38:39 +00:00
|
|
|
domtrans_pattern($1, nscd_exec_t, nscd_t)
|
2005-07-13 20:48:51 +00:00
|
|
|
')
|
|
|
|
|
2006-07-28 15:13:58 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Allow the specified domain to execute nscd
|
|
|
|
## in the caller domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_exec',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_exec_t;
|
|
|
|
')
|
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
can_exec($1, nscd_exec_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
')
|
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Use NSCD services by connecting using
|
|
|
|
## a unix stream socket.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-13 20:48:51 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-13 20:48:51 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`nscd_socket_use',`
|
2005-07-13 20:48:51 +00:00
|
|
|
gen_require(`
|
|
|
|
type nscd_t, nscd_var_run_t;
|
2009-06-30 19:27:21 +00:00
|
|
|
class nscd { getserv getpwd getgrp gethost shmempwd shmemgrp shmemhost shmemserv };
|
2005-07-13 20:48:51 +00:00
|
|
|
')
|
|
|
|
|
2005-08-31 15:25:12 +00:00
|
|
|
allow $1 self:unix_stream_socket create_socket_perms;
|
2005-07-13 20:48:51 +00:00
|
|
|
|
|
|
|
allow $1 nscd_t:nscd { getpwd getgrp gethost };
|
|
|
|
dontaudit $1 nscd_t:fd use;
|
2009-06-30 19:27:21 +00:00
|
|
|
dontaudit $1 nscd_t:nscd { getserv shmempwd shmemgrp shmemhost shmemserv };
|
2005-07-13 20:48:51 +00:00
|
|
|
files_search_pids($1)
|
2008-07-23 21:38:39 +00:00
|
|
|
stream_connect_pattern($1, nscd_var_run_t, nscd_var_run_t, nscd_t)
|
2005-07-13 20:48:51 +00:00
|
|
|
dontaudit $1 nscd_var_run_t:file { getattr read };
|
|
|
|
')
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Use nscd services
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_use',`
|
|
|
|
tunable_policy(`nscd_use_shm',`
|
|
|
|
nscd_shm_use($1)
|
|
|
|
',`
|
|
|
|
nscd_socket_use($1)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Use NSCD services by mapping the database from
|
|
|
|
## an inherited NSCD file descriptor.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-13 20:48:51 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-13 20:48:51 +00:00
|
|
|
## </param>
|
|
|
|
#
|
2006-02-02 21:08:12 +00:00
|
|
|
interface(`nscd_shm_use',`
|
2005-07-13 20:48:51 +00:00
|
|
|
gen_require(`
|
|
|
|
type nscd_t, nscd_var_run_t;
|
2005-09-21 20:01:40 +00:00
|
|
|
class nscd { getpwd getgrp gethost shmempwd shmemgrp shmemhost };
|
2005-07-13 20:48:51 +00:00
|
|
|
')
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow $1 nscd_var_run_t:dir list_dir_perms;
|
2005-07-13 20:48:51 +00:00
|
|
|
allow $1 nscd_t:nscd { shmempwd shmemgrp shmemhost };
|
|
|
|
|
|
|
|
# Receive fd from nscd and map the backing file with read access.
|
|
|
|
allow $1 nscd_t:fd use;
|
|
|
|
|
|
|
|
# cjp: these were originally inherited from the
|
2008-12-03 19:16:20 +00:00
|
|
|
# nscd_socket_domain macro. need to investigate
|
2005-07-13 20:48:51 +00:00
|
|
|
# if they are all actually required
|
|
|
|
allow $1 self:unix_stream_socket create_stream_socket_perms;
|
2010-09-20 09:54:26 +00:00
|
|
|
|
|
|
|
# dg: This may not be required.
|
|
|
|
allow $1 nscd_var_run_t:sock_file read_sock_file_perms;
|
|
|
|
|
|
|
|
stream_connect_pattern($1, nscd_var_run_t, nscd_var_run_t, nscd_t)
|
2005-07-13 20:48:51 +00:00
|
|
|
files_search_pids($1)
|
|
|
|
allow $1 nscd_t:nscd { getpwd getgrp gethost };
|
|
|
|
dontaudit $1 nscd_var_run_t:file { getattr read };
|
|
|
|
')
|
|
|
|
|
2006-08-07 17:14:00 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to search the NSCD pid directory.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2010-08-05 13:03:19 +00:00
|
|
|
## Domain to not audit.
|
2006-08-07 17:14:00 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_dontaudit_search_pid',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_var_run_t;
|
|
|
|
')
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
dontaudit $1 nscd_var_run_t:dir search_dir_perms;
|
2006-08-07 17:14:00 +00:00
|
|
|
')
|
|
|
|
|
2005-07-20 14:25:24 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read NSCD pid file.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-20 14:25:24 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-20 14:25:24 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_read_pid',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_var_run_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_pids($1)
|
2008-07-23 21:38:39 +00:00
|
|
|
read_files_pattern($1, nscd_var_run_t, nscd_var_run_t)
|
2005-07-20 14:25:24 +00:00
|
|
|
')
|
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Unconfined access to NSCD services.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2005-07-13 20:48:51 +00:00
|
|
|
## Domain allowed access.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2005-07-13 20:48:51 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_unconfined',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_t;
|
2005-09-19 14:18:48 +00:00
|
|
|
class nscd all_nscd_perms;
|
2005-07-13 20:48:51 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 nscd_t:nscd *;
|
|
|
|
')
|
2007-03-08 15:14:45 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute nscd in the nscd domain, and
|
|
|
|
## allow the specified role the nscd domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2010-08-05 13:03:19 +00:00
|
|
|
## Domain allowed to transition.
|
2007-03-08 15:14:45 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
2010-08-03 13:20:22 +00:00
|
|
|
## Role allowed access.
|
2007-03-08 15:14:45 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_run',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
nscd_domtrans($1)
|
|
|
|
role $2 types nscd_t;
|
|
|
|
')
|
2009-06-30 19:27:21 +00:00
|
|
|
|
2009-09-09 13:35:37 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute the nscd server init script.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2010-08-05 13:03:19 +00:00
|
|
|
## Domain allowed to transition.
|
2009-09-09 13:35:37 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`nscd_initrc_domtrans',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_initrc_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
init_labeled_script_domtrans($1, nscd_initrc_exec_t)
|
|
|
|
')
|
|
|
|
|
2009-06-30 19:27:21 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## All of the rules required to administrate
|
|
|
|
## an nscd environment
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
|
|
|
## The role to be allowed to manage the nscd domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <rolecap/>
|
|
|
|
#
|
|
|
|
interface(`nscd_admin',`
|
|
|
|
gen_require(`
|
|
|
|
type nscd_t, nscd_log_t, nscd_var_run_t;
|
|
|
|
type nscd_initrc_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 nscd_t:process { ptrace signal_perms };
|
|
|
|
ps_process_pattern($1, nscd_t)
|
|
|
|
|
|
|
|
init_labeled_script_domtrans($1, nscd_initrc_exec_t)
|
|
|
|
domain_system_change_exemption($1)
|
|
|
|
role_transition $2 nscd_initrc_exec_t system_r;
|
|
|
|
allow $2 system_r;
|
|
|
|
|
|
|
|
logging_list_logs($1)
|
|
|
|
admin_pattern($1, nscd_log_t)
|
|
|
|
|
|
|
|
files_list_pids($1)
|
|
|
|
admin_pattern($1, nscd_var_run_t)
|
|
|
|
')
|