Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	SMB and CIFS client/server programs for UNIX and
Chris PeBenito 17de1b
##	name  Service  Switch  daemon for resolving names
Chris PeBenito 17de1b
##	from Windows NT servers.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 0c8917
##	Execute nmbd net in the nmbd_t domain.
Chris PeBenito 0c8917
## </summary>
Chris PeBenito 0c8917
## <param name="domain">
Chris PeBenito 0c8917
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 0c8917
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
#
Chris PeBenito 0c8917
interface(`samba_domtrans_nmbd',`
Chris PeBenito 0c8917
	gen_require(`
Chris PeBenito 0c8917
		type nmbd_t, nmbd_exec_t;
Chris PeBenito 0c8917
	')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	corecmd_search_bin($1)
Chris PeBenito 0c8917
	domtrans_pattern($1, nmbd_exec_t, nmbd_t)
Chris PeBenito 0c8917
')
Chris PeBenito 0c8917
Jeremy Solt 34838a
#######################################
Jeremy Solt 34838a
## <summary>
Jeremy Solt 34838a
##	Allow domain to signal samba
Jeremy Solt 34838a
## </summary>
Jeremy Solt 34838a
## <param name="domain">
Jeremy Solt 34838a
##	<summary>
Jeremy Solt 34838a
##	Domain allowed access.
Jeremy Solt 34838a
##	</summary>
Jeremy Solt 34838a
## </param>
Jeremy Solt 34838a
#
Jeremy Solt 34838a
interface(`samba_signal_nmbd',`
Jeremy Solt 34838a
	gen_require(`
Jeremy Solt 34838a
		type nmbd_t;
Jeremy Solt 34838a
	')
Jeremy Solt 34838a
	allow $1 nmbd_t:process signal;
Jeremy Solt 34838a
')
Jeremy Solt 34838a
Chris PeBenito 0c8917
########################################
Chris PeBenito 0c8917
## <summary>
Chris PeBenito 0c8917
##	Execute samba server in the samba domain.
Chris PeBenito 0c8917
## </summary>
Chris PeBenito 0c8917
## <param name="domain">
Chris PeBenito 0c8917
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 0c8917
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
#
Chris PeBenito 0c8917
interface(`samba_initrc_domtrans',`
Chris PeBenito 0c8917
	gen_require(`
Chris PeBenito 0c8917
		type samba_initrc_exec_t;
Chris PeBenito 0c8917
	')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	init_labeled_script_domtrans($1, samba_initrc_exec_t)
Chris PeBenito 0c8917
')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
########################################
Chris PeBenito 0c8917
## <summary>
Chris PeBenito 17de1b
##	Execute samba net in the samba_net domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_domtrans_net',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type samba_net_t, samba_net_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_search_bin($1)
Chris PeBenito 0bfccd
	domtrans_pattern($1, samba_net_exec_t, samba_net_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Dan Walsh 3eaa99
##	Execute samba net in the samba_unconfined_net domain.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dominick Grift 612346
##	Domain allowed to transition.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`samba_domtrans_unconfined_net',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type samba_unconfined_net_t, samba_net_exec_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	corecmd_search_bin($1)
Dan Walsh 3eaa99
	domtrans_pattern($1, samba_net_exec_t, samba_unconfined_net_t)
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Chris PeBenito 17de1b
##	Execute samba net in the samba_net domain, and
Chris PeBenito 17de1b
##	allow the specified role the samba_net domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito a7ee7f
##	Role allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_run_net',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type samba_net_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	samba_domtrans_net($1)
Chris PeBenito 17de1b
	role $2 types samba_net_t;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Dan Walsh 3eaa99
#######################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	The role for the samba module.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="role">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	The role to be allowed the samba_net domain.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dominick Grift 9c9e4c
## <rolecap/>
Dan Walsh 3eaa99
#
Miroslav Grepl d15b40
interface(`samba_role_notrans',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type smbd_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	role $1 types smbd_t;
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Dan Walsh 3eaa99
##	Execute samba net in the samba_unconfined_net domain, and
Dan Walsh 3eaa99
##	allow the specified role the samba_unconfined_net domain.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="domain">
Dan Walsh 3eaa99
##	<summary>
Dominick Grift 612346
##	Domain allowed to transition.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
## <param name="role">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	The role to be allowed the samba_unconfined_net domain.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
## <rolecap/>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
interface(`samba_run_unconfined_net',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type samba_unconfined_net_t;
Dan Walsh 3eaa99
	')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	samba_domtrans_unconfined_net($1)
Dan Walsh 3eaa99
	role $2 types samba_unconfined_net_t;
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute smbmount in the smbmount domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_domtrans_smbmount',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type smbmount_t, smbmount_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	corecmd_search_bin($1)
Chris PeBenito 0bfccd
	domtrans_pattern($1, smbmount_exec_t, smbmount_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 350b6a
##	Execute smbmount interactively and do
Chris PeBenito 350b6a
##	a domain transition to the smbmount domain.
Chris PeBenito 350b6a
## </summary>
Chris PeBenito 350b6a
## <param name="domain">
Chris PeBenito 350b6a
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 350b6a
##	</summary>
Chris PeBenito 350b6a
## </param>
Chris PeBenito 350b6a
## <param name="role">
Chris PeBenito 350b6a
##	<summary>
Chris PeBenito a7ee7f
##	Role allowed access.
Chris PeBenito 350b6a
##	</summary>
Chris PeBenito 350b6a
## </param>
Chris PeBenito 350b6a
## <rolecap/>
Chris PeBenito 350b6a
#
Chris PeBenito 350b6a
interface(`samba_run_smbmount',`
Chris PeBenito 350b6a
	gen_require(`
Chris PeBenito 350b6a
		type smbmount_t;
Chris PeBenito 350b6a
	')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
	samba_domtrans_smbmount($1)
Chris PeBenito 350b6a
	role $2 types smbmount_t;
Chris PeBenito 350b6a
')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
########################################
Chris PeBenito 350b6a
## <summary>
Chris PeBenito 17de1b
##	Allow the specified domain to read
Chris PeBenito 17de1b
##	samba configuration files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_read_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type samba_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 0bfccd
	read_files_pattern($1, samba_etc_t, samba_etc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Allow the specified domain to read
Chris PeBenito 17de1b
##	and write samba configuration files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_rw_config',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type samba_etc_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 0bfccd
	rw_files_pattern($1, samba_etc_t, samba_etc_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 0c8917
##	Allow the specified domain to read
Chris PeBenito 0c8917
##	and write samba configuration files.
Chris PeBenito 0c8917
## </summary>
Chris PeBenito 0c8917
## <param name="domain">
Chris PeBenito 0c8917
##	<summary>
Chris PeBenito 0c8917
##	Domain allowed access.
Chris PeBenito 0c8917
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
## <rolecap/>
Chris PeBenito 0c8917
#
Chris PeBenito 0c8917
interface(`samba_manage_config',`
Chris PeBenito 0c8917
	gen_require(`
Chris PeBenito 0c8917
		type samba_etc_t;
Chris PeBenito 0c8917
	')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	files_search_etc($1)
Chris PeBenito 0c8917
	manage_dirs_pattern($1, samba_etc_t, samba_etc_t)
Chris PeBenito 0c8917
	manage_files_pattern($1, samba_etc_t, samba_etc_t)
Chris PeBenito 0c8917
')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
########################################
Chris PeBenito 0c8917
## <summary>
Chris PeBenito 17de1b
##	Allow the specified domain to read samba's log files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_read_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type samba_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_search_logs($1)
Chris PeBenito c0868a
	allow $1 samba_log_t:dir list_dir_perms;
Chris PeBenito 0bfccd
	read_files_pattern($1, samba_log_t, samba_log_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 40df56
##	Allow the specified domain to append to samba's log files.
Chris PeBenito 40df56
## </summary>
Chris PeBenito 40df56
## <param name="domain">
Chris PeBenito 40df56
##	<summary>
Chris PeBenito 40df56
##	Domain allowed access.
Chris PeBenito 40df56
##	</summary>
Chris PeBenito 40df56
## </param>
Chris PeBenito 40df56
## <rolecap/>
Chris PeBenito 40df56
#
Chris PeBenito 40df56
interface(`samba_append_log',`
Chris PeBenito 40df56
	gen_require(`
Chris PeBenito 40df56
		type samba_log_t;
Chris PeBenito 40df56
	')
Chris PeBenito 40df56
Chris PeBenito 40df56
	logging_search_logs($1)
Chris PeBenito 40df56
	allow $1 samba_log_t:dir list_dir_perms;
Chris PeBenito 40df56
	allow $1 samba_log_t:file append_file_perms;
Chris PeBenito 40df56
')
Chris PeBenito 40df56
Chris PeBenito 40df56
########################################
Chris PeBenito 40df56
## <summary>
Chris PeBenito 17de1b
##	Execute samba log in the caller domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito a72e42
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_exec_log',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type samba_log_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	logging_search_logs($1)
Chris PeBenito 0bfccd
	can_exec($1, samba_log_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Allow the specified domain to read samba's secrets.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_read_secrets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type samba_secrets_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_etc($1)
Chris PeBenito 82d277
	allow $1 samba_secrets_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 0c8917
##	Allow the specified domain to read samba's shares
Chris PeBenito 0c8917
## </summary>
Chris PeBenito 0c8917
## <param name="domain">
Chris PeBenito 0c8917
##	<summary>
Chris PeBenito 0c8917
##	Domain allowed access.
Chris PeBenito 0c8917
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
#
Chris PeBenito 0c8917
interface(`samba_read_share_files',`
Chris PeBenito 0c8917
	gen_require(`
Chris PeBenito 0c8917
		type samba_share_t;
Chris PeBenito 0c8917
	')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	allow $1 samba_share_t:filesystem getattr;
Chris PeBenito 0c8917
	read_files_pattern($1, samba_share_t, samba_share_t)
Chris PeBenito 0c8917
')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
########################################
Chris PeBenito 0c8917
## <summary>
Chris PeBenito 17de1b
##	Allow the specified domain to search
Chris PeBenito 17de1b
##	samba /var directories.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_search_var',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type samba_var_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 40df56
	files_search_var_lib($1)
Chris PeBenito 17de1b
	allow $1 samba_var_t:dir search_dir_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Allow the specified domain to
Chris PeBenito 40df56
##	read samba /var files.
Chris PeBenito 40df56
## </summary>
Chris PeBenito 40df56
## <param name="domain">
Chris PeBenito 40df56
##	<summary>
Chris PeBenito 40df56
##	Domain allowed access.
Chris PeBenito 40df56
##	</summary>
Chris PeBenito 40df56
## </param>
Chris PeBenito 40df56
#
Chris PeBenito 40df56
interface(`samba_read_var_files',`
Chris PeBenito 40df56
	gen_require(`
Chris PeBenito 40df56
		type samba_var_t;
Chris PeBenito 40df56
	')
Chris PeBenito 40df56
Chris PeBenito 40df56
	files_search_var_lib($1)
Chris PeBenito 0bfccd
	read_files_pattern($1, samba_var_t, samba_var_t)
Chris PeBenito 40df56
')
Chris PeBenito 40df56
Chris PeBenito 40df56
########################################
Chris PeBenito 40df56
## <summary>
Chris PeBenito 0c8917
##	Do not audit attempts to write samba
Chris PeBenito 0c8917
##	/var files.
Chris PeBenito 0c8917
## </summary>
Chris PeBenito 0c8917
## <param name="domain">
Chris PeBenito 0c8917
##	<summary>
Dominick Grift 288845
##	Domain to not audit.
Chris PeBenito 0c8917
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
#
Chris PeBenito 0c8917
interface(`samba_dontaudit_write_var_files',`
Chris PeBenito 0c8917
	gen_require(`
Chris PeBenito 0c8917
		type samba_var_t;
Chris PeBenito 0c8917
	')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	dontaudit $1 samba_var_t:file write;
Chris PeBenito 0c8917
')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
########################################
Chris PeBenito 0c8917
## <summary>
Chris PeBenito 40df56
##	Allow the specified domain to
Chris PeBenito 17de1b
##	read and write samba /var files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_rw_var_files',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type samba_var_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 40df56
	files_search_var_lib($1)
Chris PeBenito 0bfccd
	rw_files_pattern($1, samba_var_t, samba_var_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 40df56
##	Allow the specified domain to
Chris PeBenito 40df56
##	read and write samba /var files.
Chris PeBenito 40df56
## </summary>
Chris PeBenito 40df56
## <param name="domain">
Chris PeBenito 40df56
##	<summary>
Chris PeBenito 40df56
##	Domain allowed access.
Chris PeBenito 40df56
##	</summary>
Chris PeBenito 40df56
## </param>
Chris PeBenito 40df56
#
Chris PeBenito 40df56
interface(`samba_manage_var_files',`
Chris PeBenito 40df56
	gen_require(`
Chris PeBenito 40df56
		type samba_var_t;
Chris PeBenito 40df56
	')
Chris PeBenito 40df56
Chris PeBenito 40df56
	files_search_var_lib($1)
Chris PeBenito 0bfccd
	manage_files_pattern($1, samba_var_t, samba_var_t)
Dan Walsh 3eaa99
	manage_lnk_files_pattern($1, samba_var_t, samba_var_t)
Chris PeBenito 40df56
')
Chris PeBenito 40df56
Chris PeBenito 40df56
########################################
Chris PeBenito 40df56
## <summary>
Chris PeBenito 0c8917
##	Execute a domain transition to run smbcontrol.
Chris PeBenito 0c8917
## </summary>
Chris PeBenito 0c8917
## <param name="domain">
Dominick Grift 0dacd0
##	<summary>
Chris PeBenito 0c8917
##	Domain allowed to transition.
Dominick Grift 0dacd0
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
#
Chris PeBenito 0c8917
interface(`samba_domtrans_smbcontrol',`
Chris PeBenito 0c8917
	gen_require(`
Dominick Grift 2f94f4
		type smbcontrol_t, smbcontrol_exec_t;
Chris PeBenito 0c8917
	')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	domtrans_pattern($1, smbcontrol_exec_t, smbcontrol_t)
Chris PeBenito 0c8917
')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
########################################
Chris PeBenito 0c8917
## <summary>
Chris PeBenito 0c8917
##	Execute smbcontrol in the smbcontrol domain, and
Chris PeBenito 0c8917
##	allow the specified role the smbcontrol domain.
Chris PeBenito 0c8917
## </summary>
Chris PeBenito 0c8917
## <param name="domain">
Chris PeBenito 0c8917
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 0c8917
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
## <param name="role">
Chris PeBenito 0c8917
##	<summary>
Chris PeBenito a7ee7f
##	Role allowed access.
Chris PeBenito 0c8917
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
#
Chris PeBenito 0c8917
interface(`samba_run_smbcontrol',`
Chris PeBenito 0c8917
	gen_require(`
Chris PeBenito 0c8917
		type smbcontrol_t;
Chris PeBenito 0c8917
	')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	samba_domtrans_smbcontrol($1)
Chris PeBenito 0c8917
	role $2 types smbcontrol_t;
Chris PeBenito 0c8917
')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
########################################
Chris PeBenito 0c8917
## <summary>
Chris PeBenito 0c8917
##	Execute smbd in the smbd_t domain.
Chris PeBenito 0c8917
## </summary>
Chris PeBenito 0c8917
## <param name="domain">
Chris PeBenito 0c8917
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 0c8917
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
#
Chris PeBenito 0c8917
interface(`samba_domtrans_smbd',`
Chris PeBenito 0c8917
	gen_require(`
Chris PeBenito 0c8917
		type smbd_t, smbd_exec_t;
Chris PeBenito 0c8917
	')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	corecmd_search_bin($1)
Chris PeBenito 0c8917
	domtrans_pattern($1, smbd_exec_t, smbd_t)
Chris PeBenito 0c8917
')
Chris PeBenito 0c8917
Jeremy Solt 34838a
######################################
Jeremy Solt 34838a
## <summary>
Jeremy Solt 34838a
##	Allow domain to signal samba
Jeremy Solt 34838a
## </summary>
Jeremy Solt 34838a
## <param name="domain">
Jeremy Solt 34838a
##	<summary>
Jeremy Solt 34838a
##	Domain allowed access.
Jeremy Solt 34838a
##	</summary>
Jeremy Solt 34838a
## </param>
Jeremy Solt 34838a
#
Jeremy Solt 34838a
interface(`samba_signal_smbd',`
Jeremy Solt 34838a
	gen_require(`
Jeremy Solt 34838a
		type smbd_t;
Jeremy Solt 34838a
	')
Jeremy Solt 34838a
	allow $1 smbd_t:process signal;
Jeremy Solt 34838a
')
Jeremy Solt 34838a
Chris PeBenito 0c8917
########################################
Chris PeBenito 0c8917
## <summary>
Chris PeBenito 40df56
##	Do not audit attempts to use file descriptors from samba.
Chris PeBenito 40df56
## </summary>
Chris PeBenito 40df56
## <param name="domain">
Chris PeBenito 40df56
##	<summary>
Chris PeBenito 40df56
##	Domain to not audit.
Chris PeBenito 40df56
##	</summary>
Chris PeBenito 40df56
## </param>
Chris PeBenito 40df56
#
Chris PeBenito 40df56
interface(`samba_dontaudit_use_fds',`
Chris PeBenito 40df56
	gen_require(`
Chris PeBenito 40df56
		type smbd_t;
Chris PeBenito 40df56
	')
Chris PeBenito 40df56
Chris PeBenito 40df56
	dontaudit $1 smbd_t:fd use; 
Chris PeBenito 40df56
')
Chris PeBenito 40df56
Chris PeBenito 40df56
########################################
Chris PeBenito 40df56
## <summary>
Chris PeBenito 17de1b
##	Allow the specified domain to write to smbmount tcp sockets.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_write_smbmount_tcp_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type smbmount_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 smbmount_t:tcp_socket write;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Allow the specified domain to read and write to smbmount tcp sockets.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_rw_smbmount_tcp_sockets',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type smbmount_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	allow $1 smbmount_t:tcp_socket { read write };
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute winbind_helper in the winbind_helper domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_domtrans_winbind_helper',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type winbind_helper_t, winbind_helper_exec_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 0bfccd
	domtrans_pattern($1, winbind_helper_exec_t, winbind_helper_t)
Dan Walsh 3eaa99
	allow $1 winbind_helper_t:process signal;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Execute winbind_helper in the winbind_helper domain, and
Chris PeBenito 17de1b
##	allow the specified role the winbind_helper domain.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Dominick Grift 288845
##	Domain allowed to transition.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
## <param name="role">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito a7ee7f
##	Role allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito bbcd3c
## <rolecap/>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_run_winbind_helper',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type winbind_helper_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	samba_domtrans_winbind_helper($1)
Chris PeBenito 17de1b
	role $2 types winbind_helper_t;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Allow the specified domain to read the winbind pid files.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_read_winbind_pid',`
Chris PeBenito 17de1b
	gen_require(`
Chris PeBenito 17de1b
		type winbind_var_run_t;
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
	files_search_pids($1)
Chris PeBenito c0868a
	allow $1 winbind_var_run_t:file read_file_perms;
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
## <summary>
Chris PeBenito 17de1b
##	Connect to winbind.
Chris PeBenito 17de1b
## </summary>
Chris PeBenito 17de1b
## <param name="domain">
Chris PeBenito 17de1b
##	<summary>
Chris PeBenito 17de1b
##	Domain allowed access.
Chris PeBenito 17de1b
##	</summary>
Chris PeBenito 17de1b
## </param>
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
interface(`samba_stream_connect_winbind',`
Chris PeBenito b81bfc
	gen_require(`
Chris PeBenito b81bfc
		type samba_var_t, winbind_t, winbind_var_run_t;
Chris PeBenito b81bfc
	')
Chris PeBenito 9377a3
Chris PeBenito b81bfc
	files_search_pids($1)
Chris PeBenito b81bfc
	allow $1 samba_var_t:dir search_dir_perms;
Chris PeBenito b81bfc
	stream_connect_pattern($1, winbind_var_run_t, winbind_var_run_t, winbind_t)
Chris PeBenito 2a9837
Chris PeBenito b81bfc
	ifndef(`distro_redhat',`
Chris PeBenito 9377a3
		gen_require(`
Chris PeBenito 6073ea
			type winbind_tmp_t;
Chris PeBenito 9377a3
		')
Chris PeBenito 9377a3
Chris PeBenito 9377a3
		# the default for the socket is (poorly named):
Chris PeBenito 9377a3
		# /tmp/.winbindd/pipe
Chris PeBenito 9377a3
		files_search_tmp($1)
Chris PeBenito 0bfccd
		stream_connect_pattern($1, winbind_tmp_t, winbind_tmp_t, winbind_t)
Chris PeBenito 17de1b
	')
Chris PeBenito 17de1b
')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
########################################
Chris PeBenito 0c8917
## <summary>
Dan Walsh 3eaa99
##	Create a set of derived types for apache
Dan Walsh 3eaa99
##	web content.
Dan Walsh 3eaa99
## </summary>
Dan Walsh 3eaa99
## <param name="prefix">
Dan Walsh 3eaa99
##	<summary>
Dan Walsh 3eaa99
##	The prefix to be used for deriving type names.
Dan Walsh 3eaa99
##	</summary>
Dan Walsh 3eaa99
## </param>
Dan Walsh 3eaa99
#
Dan Walsh 3eaa99
template(`samba_helper_template',`
Dan Walsh 3eaa99
	gen_require(`
Dan Walsh 3eaa99
		type smbd_t;
Dominick Grift 23ac31
		role system_r;
Dan Walsh 3eaa99
	')
Dominick Grift dcf874
Dan Walsh 3eaa99
	#This type is for samba helper scripts
Dan Walsh 3eaa99
	type samba_$1_script_t;
Dan Walsh 3eaa99
	domain_type(samba_$1_script_t)
Dan Walsh 3eaa99
	role system_r types samba_$1_script_t;
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	# This type is used for executable scripts files
Dan Walsh 3eaa99
	type samba_$1_script_exec_t;
Dan Walsh 3eaa99
	corecmd_shell_entry_type(samba_$1_script_t)
Dan Walsh 3eaa99
	domain_entry_file(samba_$1_script_t, samba_$1_script_exec_t)
Dan Walsh 3eaa99
Dan Walsh 3eaa99
	domtrans_pattern(smbd_t, samba_$1_script_exec_t, samba_$1_script_t)
Dan Walsh 3eaa99
	allow smbd_t samba_$1_script_exec_t:file ioctl;
Dan Walsh 3eaa99
')
Dan Walsh 3eaa99
Dan Walsh 3eaa99
########################################
Dan Walsh 3eaa99
## <summary>
Chris PeBenito 0c8917
##	All of the rules required to administrate 
Chris PeBenito 0c8917
##	an samba environment
Chris PeBenito 0c8917
## </summary>
Chris PeBenito 0c8917
## <param name="domain">
Chris PeBenito 0c8917
##	<summary>
Chris PeBenito 0c8917
##	Domain allowed access.
Chris PeBenito 0c8917
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
## <param name="role">
Chris PeBenito 0c8917
##	<summary>
Chris PeBenito 0c8917
##	The role to be allowed to manage the samba domain.
Chris PeBenito 0c8917
##	</summary>
Chris PeBenito 0c8917
## </param>
Chris PeBenito 0c8917
## <rolecap/>
Chris PeBenito 0c8917
#
Chris PeBenito 0c8917
interface(`samba_admin',`
Chris PeBenito 0c8917
	gen_require(`
Dominick Grift 2f94f4
		type nmbd_t, nmbd_var_run_t, smbd_var_run_t;
Dominick Grift 2f94f4
		type smbd_t, smbd_tmp_t, samba_secrets_t;
Dominick Grift 2f94f4
		type samba_initrc_exec_t, samba_log_t, samba_var_t;
Dominick Grift 2f94f4
		type samba_etc_t, samba_share_t, winbind_log_t;
Dominick Grift 2528a2
		type swat_var_run_t, swat_tmp_t, samba_unconfined_script_exec_t;
Dominick Grift 2528a2
		type winbind_var_run_t, winbind_tmp_t, samba_unconfined_script_t;
Chris PeBenito 0c8917
	')
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	allow $1 smbd_t:process { ptrace signal_perms };
Chris PeBenito 0c8917
	ps_process_pattern($1, smbd_t)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	allow $1 nmbd_t:process { ptrace signal_perms };
Chris PeBenito 0c8917
	ps_process_pattern($1, nmbd_t)
Chris PeBenito 0c8917
Dominick Grift 819518
	allow $1 samba_unconfined_script_t:process { ptrace signal_perms };
Dominick Grift 2de234
	ps_process_pattern($1, samba_unconfined_script_t)
Dominick Grift dcf874
Chris PeBenito 0c8917
	samba_run_smbcontrol($1, $2, $3)
Chris PeBenito 0c8917
	samba_run_winbind_helper($1, $2, $3)
Chris PeBenito 0c8917
	samba_run_smbmount($1, $2, $3)
Chris PeBenito 0c8917
	samba_run_net($1, $2, $3)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	init_labeled_script_domtrans($1, samba_initrc_exec_t)
Chris PeBenito 0c8917
	domain_system_change_exemption($1)
Chris PeBenito 0c8917
	role_transition $2 samba_initrc_exec_t system_r;
Chris PeBenito 0c8917
	allow $2 system_r;
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, nmbd_var_run_t)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, samba_etc_t)
Chris PeBenito 0c8917
	files_list_etc($1)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, samba_log_t)
Chris PeBenito 0c8917
	logging_list_logs($1)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, samba_secrets_t)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, samba_share_t)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, samba_var_t)
Chris PeBenito 0c8917
	files_list_var($1)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, smbd_var_run_t)
Chris PeBenito 0c8917
	files_list_pids($1)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, smbd_tmp_t)
Chris PeBenito 0c8917
	files_list_tmp($1)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, swat_var_run_t)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, swat_tmp_t)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, winbind_log_t)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, winbind_tmp_t)
Chris PeBenito 0c8917
Chris PeBenito 0c8917
	admin_pattern($1, winbind_var_run_t)
Dan Walsh 3eaa99
	admin_pattern($1, samba_unconfined_script_exec_t)
Chris PeBenito 0c8917
')