Chris PeBenito 2e77b2
## <module name="files" layer="system">
Chris PeBenito 2e77b2
## <summary>Policy controlling access to general files</summary>
Chris PeBenito e181fe
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# files_make_file(type)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_make_file',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 763c44
	fs_associate($1)
Chris PeBenito 763c44
	fs_noxattr_associate($1)
Chris PeBenito 0c73cd
	typeattribute $1 file_type;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`files_make_file_depend',`
Chris PeBenito 0c73cd
	attribute file_type;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 075c4f
# files_make_lock_file(type)
Chris PeBenito 075c4f
#
Chris PeBenito 075c4f
define(`files_make_lock_file',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	files_make_file($1)
Chris PeBenito 0c73cd
	typeattribute $1 lockfile;
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito 075c4f
define(`files_make_lock_file_depend',`
Chris PeBenito 0c73cd
	attribute lockfile;
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito 075c4f
########################################
Chris PeBenito 075c4f
#
Chris PeBenito d25dd9
# files_make_mountpoint(type)
Chris PeBenito 38e24a
#
Chris PeBenito d25dd9
define(`files_make_mountpoint',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	files_make_file($1)
Chris PeBenito 0c73cd
	typeattribute $1 mountpoint;
Chris PeBenito 38e24a
')
Chris PeBenito 38e24a
Chris PeBenito d25dd9
define(`files_make_mountpoint_depend',`
Chris PeBenito 0c73cd
	attribute mountpoint;
Chris PeBenito 38e24a
')
Chris PeBenito 38e24a
Chris PeBenito 38e24a
########################################
Chris PeBenito 38e24a
#
Chris PeBenito d25dd9
# files_make_daemon_runtime_file(type)
Chris PeBenito a2d824
#
Chris PeBenito d25dd9
define(`files_make_daemon_runtime_file',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	files_make_file($1)
Chris PeBenito 0c73cd
	typeattribute $1 pidfile;
Chris PeBenito a2d824
')
Chris PeBenito a2d824
Chris PeBenito d25dd9
define(`files_make_daemon_runtime_file_depend',`
Chris PeBenito 0c73cd
	attribute pidfile;
Chris PeBenito d25dd9
')
Chris PeBenito d25dd9
Chris PeBenito d25dd9
########################################
Chris PeBenito d25dd9
#
Chris PeBenito d25dd9
# files_make_temporary_file(type)
Chris PeBenito d25dd9
#
Chris PeBenito d25dd9
define(`files_make_temporary_file',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	files_make_file($1)
Chris PeBenito 0c73cd
	typeattribute $1 tmpfile;
Chris PeBenito d25dd9
')
Chris PeBenito d25dd9
Chris PeBenito d25dd9
define(`files_make_temporary_file_depend',`
Chris PeBenito 0c73cd
	attribute tmpfile;
Chris PeBenito a2d824
')
Chris PeBenito a2d824
Chris PeBenito a2d824
########################################
Chris PeBenito 46410f
## <interface name="files_make_tmpfs_file">
Chris PeBenito 46410f
##	<description>
Chris PeBenito 46410f
##		Transform the type into a file, for use on a
Chris PeBenito 46410f
##		virtual memory filesystem (tmpfs).
Chris PeBenito 46410f
##	</description>
Chris PeBenito 46410f
##	<parameter name="type">
Chris PeBenito 46410f
##		The type to be transformed.
Chris PeBenito 46410f
##	</parameter>
Chris PeBenito 46410f
## </interface>
Chris PeBenito 46410f
#
Chris PeBenito 46410f
define(`files_make_tmpfs_file',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	files_make_file($1)
Chris PeBenito 763c44
	fs_tmpfs_associate($1)
Chris PeBenito 0c73cd
	typeattribute $1 tmpfsfile;
Chris PeBenito 46410f
')
Chris PeBenito 46410f
Chris PeBenito 46410f
define(`files_make_tmpfs_file_depend',`
Chris PeBenito 0c73cd
	attribute tmpfsfile;
Chris PeBenito 46410f
')
Chris PeBenito 46410f
Chris PeBenito 46410f
########################################
Chris PeBenito a2d824
#
Chris PeBenito 2e77b2
# files_get_all_file_attributes(domain)
Chris PeBenito efd8ed
Chris PeBenito 8a0da1
define(`files_get_all_file_attributes',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 file_type:dir { search getattr };
Chris PeBenito 0c73cd
	allow $1 file_type:file getattr;
Chris PeBenito 0c73cd
	allow $1 file_type:lnk_file getattr;
Chris PeBenito 0c73cd
	allow $1 file_type:fifo_file getattr;
Chris PeBenito 0c73cd
	allow $1 file_type:sock_file getattr;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 8a0da1
define(`files_get_all_file_attributes_depend',`
Chris PeBenito 0c73cd
	attribute file_type;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir { search getattr };
Chris PeBenito 0c73cd
	class file getattr;
Chris PeBenito 0c73cd
	class lnk_file getattr;
Chris PeBenito 0c73cd
	class fifo_file getattr;
Chris PeBenito 0c73cd
	class sock_file getattr;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito efd8ed
## <interface name="files_relabel_all_files">
Chris PeBenito efd8ed
##	<description>
Chris PeBenito efd8ed
##		Relabel all files on the filesystem, except
Chris PeBenito efd8ed
##		the listed exceptions.
Chris PeBenito efd8ed
##	</description>
Chris PeBenito efd8ed
##	<parameter name="domain">
Chris PeBenito efd8ed
##		The type of the domain perfoming this action.
Chris PeBenito efd8ed
##	</parameter>
Chris PeBenito efd8ed
##	<parameter name="exception_types" optional="true">
Chris PeBenito efd8ed
##		The types to be excluded.  Each type or attribute
Chris PeBenito efd8ed
##		must be negated by the caller.
Chris PeBenito efd8ed
##	</parameter>
Chris PeBenito efd8ed
## </interface>
Chris PeBenito f9438f
#
Chris PeBenito efd8ed
define(`files_relabel_all_files',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 { file_type $2 }:dir { r_dir_perms relabelfrom relabelto };
Chris PeBenito 0c73cd
	allow $1 { file_type $2 }:file { getattr relabelfrom relabelto };
Chris PeBenito 0c73cd
	allow $1 { file_type $2 }:lnk_file { getattr relabelfrom relabelto };
Chris PeBenito 0c73cd
	allow $1 { file_type $2 }:fifo_file { getattr relabelfrom relabelto };
Chris PeBenito 0c73cd
	allow $1 { file_type $2 }:sock_file { getattr relabelfrom relabelto };
Chris PeBenito 0c73cd
	allow $1 { file_type $2 }:blk_file { getattr relabelfrom };
Chris PeBenito 0c73cd
	allow $1 { file_type $2 }:chr_file { getattr relabelfrom };
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	# satisfy the assertions:
Chris PeBenito 0c73cd
	selinux_relabelto_binary_policy($1)
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito efd8ed
define(`files_relabel_all_files_depend',`
Chris PeBenito 0c73cd
	attribute file_type;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir { r_dir_perms relabelfrom relabelto };
Chris PeBenito 0c73cd
	class file { relabelfrom relabelto };
Chris PeBenito 0c73cd
	class lnk_file { relabelfrom relabelto };
Chris PeBenito 0c73cd
	class fifo_file { relabelfrom relabelto };
Chris PeBenito 0c73cd
	class sock_file { relabelfrom relabelto };
Chris PeBenito 0c73cd
	class blk_file relabelfrom;
Chris PeBenito 0c73cd
	class chr_file relabelfrom;
Chris PeBenito ee5772
')
Chris PeBenito ee5772
Chris PeBenito ee5772
########################################
Chris PeBenito efd8ed
## <interface name="files_manage_all_files">
Chris PeBenito efd8ed
##	<description>
Chris PeBenito efd8ed
##		Manage all files on the filesystem, except
Chris PeBenito efd8ed
##		the listed exceptions.
Chris PeBenito efd8ed
##	</description>
Chris PeBenito efd8ed
##	<parameter name="domain">
Chris PeBenito efd8ed
##		The type of the domain perfoming this action.
Chris PeBenito efd8ed
##	</parameter>
Chris PeBenito efd8ed
##	<parameter name="exception_types" optional="true">
Chris PeBenito efd8ed
##		The types to be excluded.  Each type or attribute
Chris PeBenito efd8ed
##		must be negated by the caller.
Chris PeBenito efd8ed
##	</parameter>
Chris PeBenito efd8ed
## </interface>
Chris PeBenito efd8ed
#
Chris PeBenito efd8ed
define(`files_manage_all_files',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 { file_type $2 }:dir create_dir_perms;
Chris PeBenito dd8229
	allow $1 { file_type $2 }:file create_file_perms;
Chris PeBenito dd8229
	allow $1 { file_type $2 }:lnk_file create_lnk_perms;
Chris PeBenito dd8229
	allow $1 { file_type $2 }:fifo_file create_file_perms;
Chris PeBenito dd8229
	allow $1 { file_type $2 }:sock_file create_file_perms;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	# satisfy the assertions:
Chris PeBenito 0c73cd
	selinux_write_binary_policy($1)
Chris PeBenito 0c73cd
	bootloader_manage_kernel_modules($1)
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito efd8ed
define(`files_manage_all_files_depend',`
Chris PeBenito 0c73cd
	attribute file_type;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir create_dir_perms;
Chris PeBenito dd8229
	class file create_file_perms;
Chris PeBenito dd8229
	class lnk_file create_lnk_perms;
Chris PeBenito dd8229
	class fifo_file create_file_perms;
Chris PeBenito dd8229
	class sock_file create_file_perms;
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito efd8ed
########################################
Chris PeBenito ee5772
#
Chris PeBenito 9f2f9e
# files_search_all_directories(domain)
Chris PeBenito f9438f
#
Chris PeBenito f9438f
define(`files_search_all_directories',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 file_type:dir search;
Chris PeBenito f9438f
')
Chris PeBenito f9438f
Chris PeBenito ee5772
define(`files_search_all_directories_depend',`
Chris PeBenito 0c73cd
	attribute file_type;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito f9438f
')
Chris PeBenito f9438f
Chris PeBenito f9438f
########################################
Chris PeBenito ee5772
#
Chris PeBenito 24280a
# files_read_all_directories(domain)
Chris PeBenito 24280a
#
Chris PeBenito 24280a
define(`files_read_all_directories',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 file_type:dir r_dir_perms;
Chris PeBenito 24280a
')
Chris PeBenito 24280a
Chris PeBenito 24280a
define(`files_read_all_directories_depend',`
Chris PeBenito 0c73cd
	attribute file_type;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir r_dir_perms;
Chris PeBenito 24280a
')
Chris PeBenito 24280a
Chris PeBenito 24280a
########################################
Chris PeBenito 24280a
#
Chris PeBenito 9f2f9e
# files_ignore_search_all_directories(domain)
Chris PeBenito 9f2f9e
#
Chris PeBenito 9f2f9e
define(`files_ignore_search_all_directories',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 file_type:dir search;
Chris PeBenito 9f2f9e
')
Chris PeBenito 9f2f9e
Chris PeBenito 9f2f9e
define(`files_ignore_search_all_directories_depend',`
Chris PeBenito 0c73cd
	attribute file_type;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito 9f2f9e
')
Chris PeBenito 9f2f9e
Chris PeBenito dc771f
#######################################
Chris PeBenito dc771f
#
Chris PeBenito 763c44
# files_relabelto_all_file_type_fs(domain)
Chris PeBenito dc771f
#
Chris PeBenito 763c44
define(`files_relabelto_all_file_type_fs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 file_type:filesystem relabelto;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito 763c44
define(`files_relabelto_all_file_type_fs_depend',`
Chris PeBenito 0c73cd
	attribute file_type;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	filesystem relabelto;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito dc771f
#######################################
Chris PeBenito dc771f
#
Chris PeBenito 763c44
# files_mount_all_file_type_fs(domain)
Chris PeBenito dc771f
#
Chris PeBenito 763c44
define(`files_mount_all_file_type_fs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 file_type:filesystem mount;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito 763c44
define(`files_mount_all_file_type_fs_depend',`
Chris PeBenito 0c73cd
	attribute file_type;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	filesystem mount;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito dc771f
#######################################
Chris PeBenito dc771f
#
Chris PeBenito 763c44
# files_unmount_all_file_type_fs(domain)
Chris PeBenito dc771f
#
Chris PeBenito 763c44
define(`files_unmount_all_file_type_fs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 file_type:filesystem mount;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito 763c44
define(`files_unmount_all_file_type_fs_depend',`
Chris PeBenito 0c73cd
	attribute file_type;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	filesystem mount;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito ee5772
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 2e77b2
# files_mount_on_all_mountpoints(domain)
Chris PeBenito a2d824
#
Chris PeBenito a2d824
define(`files_mount_on_all_mountpoints',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 mountpoint:dir { getattr search mounton };
Chris PeBenito a2d824
')
Chris PeBenito a2d824
Chris PeBenito a2d824
define(`files_mount_on_all_mountpoints_depend',`
Chris PeBenito 0c73cd
	attribute mountpoint;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir { getattr search mounton };
Chris PeBenito a2d824
')
Chris PeBenito a2d824
Chris PeBenito a2d824
########################################
Chris PeBenito a2d824
#
Chris PeBenito bd202f
# files_read_root_dir(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_read_root_dir',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 root_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 root_t:lnk_file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`files_read_root_dir_depend',`
Chris PeBenito 0c73cd
	type root_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir r_dir_perms;
Chris PeBenito dd8229
	class lnk_file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# files_create_root_dir_entry(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_create_root_dir_entry',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 root_t:dir ra_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`files_create_root_dir_entry_depend',`
Chris PeBenito 0c73cd
	type root_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir ra_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 9f2f9e
# files_ignore_read_rootfs_file(domain)
Chris PeBenito 9f2f9e
#
Chris PeBenito 9f2f9e
define(`files_ignore_read_rootfs_file',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 root_t:file read;
Chris PeBenito 9f2f9e
')
Chris PeBenito 9f2f9e
Chris PeBenito 9f2f9e
define(`files_ignore_read_rootfs_file_depend',`
Chris PeBenito 0c73cd
	type root_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file read;
Chris PeBenito 9f2f9e
')
Chris PeBenito 9f2f9e
Chris PeBenito 9f2f9e
########################################
Chris PeBenito 9f2f9e
#
Chris PeBenito bd202f
# files_ignore_modify_rootfs_file(domain)
Chris PeBenito 7aebdb
#
Chris PeBenito 7aebdb
define(`files_ignore_modify_rootfs_file',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 root_t:file { read write };
Chris PeBenito 7aebdb
')
Chris PeBenito 7aebdb
Chris PeBenito 7aebdb
define(`files_ignore_modify_rootfs_file_depend',`
Chris PeBenito 0c73cd
	type root_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file { read write };
Chris PeBenito 7aebdb
')
Chris PeBenito 7aebdb
Chris PeBenito 7aebdb
########################################
Chris PeBenito 7aebdb
#
Chris PeBenito bd202f
# files_ignore_modify_rootfs_device(domain)
Chris PeBenito 7aebdb
#
Chris PeBenito 7aebdb
define(`files_ignore_modify_rootfs_device',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 root_t:chr_file { read write };
Chris PeBenito 7aebdb
')
Chris PeBenito 7aebdb
Chris PeBenito 7aebdb
define(`files_ignore_modify_rootfs_device_depend',`
Chris PeBenito 0c73cd
	type root_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class chr_file { read write };
Chris PeBenito 7aebdb
')
Chris PeBenito 7aebdb
Chris PeBenito daa0e0
########################################
Chris PeBenito 2e77b2
## <interface name="files_create_private_root_dir_entry">
Chris PeBenito 2e77b2
##	<description>
Chris PeBenito 2e77b2
##		Create an object in the root directory, with a private
Chris PeBenito 2e77b2
##		type.  If no object class is specified, the
Chris PeBenito 2e77b2
##		default is file.
Chris PeBenito 2e77b2
##	</description>
Chris PeBenito 2e77b2
##	<parameter name="domain">
Chris PeBenito 2e77b2
##		The type of the process performing this action.
Chris PeBenito 2e77b2
##	</parameter>
Chris PeBenito 2e77b2
##	<parameter name="private type">
Chris PeBenito 2e77b2
##		The type of the object to be created.
Chris PeBenito 2e77b2
##	</parameter>
Chris PeBenito 2e77b2
##	<parameter name="object" optional="true">
Chris PeBenito 2e77b2
##		The type of the process performing this action.
Chris PeBenito 2e77b2
##	</parameter>
Chris PeBenito 2e77b2
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_create_private_root_dir_entry',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 root_t:dir rw_dir_perms;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	ifelse(`$3',`',`
Chris PeBenito 0c73cd
		type_transition $1 root_t:file $2;
Chris PeBenito 0c73cd
	',`
Chris PeBenito 0c73cd
		type_transition $1 root_t:$3 $2;
Chris PeBenito 0c73cd
	') dnl end ifelse
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`files_create_private_root_dir_entry_depend',`
Chris PeBenito b4cd15
type root_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
class dir rw_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# files_remove_root_dir_entry(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_remove_root_dir_entry',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 root_t:dir rw_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`files_remove_root_dir_entry_depend',`
Chris PeBenito 0c73cd
	type root_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir rw_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 763c44
# files_unmount_root_fs(domain)
Chris PeBenito a2d824
#
Chris PeBenito 763c44
define(`files_unmount_root_fs',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 root_t:filesystem unmount;
Chris PeBenito a2d824
')
Chris PeBenito a2d824
Chris PeBenito 763c44
define(`files_unmount_root_fs_depend',`
Chris PeBenito 0c73cd
	type root_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class filesystem unmount;
Chris PeBenito a2d824
')
Chris PeBenito a2d824
Chris PeBenito a2d824
########################################
Chris PeBenito a2d824
#
Chris PeBenito 3ec805
# files_search_general_system_config_directory(domain)
Chris PeBenito 3ec805
#
Chris PeBenito 3ec805
define(`files_search_general_system_config_directory',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 etc_t:dir search;
Chris PeBenito 3ec805
')
Chris PeBenito 3ec805
Chris PeBenito 3ec805
define(`files_search_general_system_config_directory_depend',`
Chris PeBenito 0c73cd
	type etc_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito 3ec805
')
Chris PeBenito 3ec805
Chris PeBenito 3ec805
########################################
Chris PeBenito 3ec805
#
Chris PeBenito 3ec805
# files_read_general_system_config_directory(domain)
Chris PeBenito 3ec805
#
Chris PeBenito 3ec805
define(`files_read_general_system_config_directory',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 etc_t:dir r_dir_perms;
Chris PeBenito 3ec805
')
Chris PeBenito 3ec805
Chris PeBenito 3ec805
define(`files_read_general_system_config_directory_depend',`
Chris PeBenito 0c73cd
	type etc_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito 3ec805
')
Chris PeBenito 3ec805
Chris PeBenito 3ec805
########################################
Chris PeBenito d90b27
#
Chris PeBenito 849380
# files_read_general_system_config(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_read_general_system_config',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 etc_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 etc_t:file r_file_perms;
Chris PeBenito dd8229
	allow $1 etc_t:lnk_file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`files_read_general_system_config_depend',`
Chris PeBenito 0c73cd
	type etc_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito dd8229
	class file r_file_perms;
Chris PeBenito dd8229
	class lnk_file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 849380
# files_modify_general_system_config(domain)
Chris PeBenito 849380
#
Chris PeBenito 849380
define(`files_modify_general_system_config',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 etc_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 etc_t:file rw_file_perms;
Chris PeBenito dd8229
	allow $1 etc_t:lnk_file r_file_perms;
Chris PeBenito 849380
')
Chris PeBenito 849380
Chris PeBenito 849380
define(`files_modify_general_system_config_depend',`
Chris PeBenito 0c73cd
	type etc_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito dd8229
	class file rw_file_perms;
Chris PeBenito dd8229
	class lnk_file r_file_perms;
Chris PeBenito 849380
')
Chris PeBenito 849380
Chris PeBenito 849380
########################################
Chris PeBenito 849380
#
Chris PeBenito 849380
# files_manage_general_system_config(domain)
Chris PeBenito 849380
#
Chris PeBenito 849380
define(`files_manage_general_system_config',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 etc_t:dir rw_dir_perms;
Chris PeBenito dd8229
	allow $1 etc_t:file create_file_perms;
Chris PeBenito dd8229
	allow $1 etc_t:lnk_file r_file_perms;
Chris PeBenito 849380
')
Chris PeBenito 849380
Chris PeBenito 849380
define(`files_manage_general_system_config_depend',`
Chris PeBenito 0c73cd
	type etc_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir rw_dir_perms;
Chris PeBenito dd8229
	class file create_file_perms;
Chris PeBenito dd8229
	class lnk_file r_file_perms;
Chris PeBenito 849380
')
Chris PeBenito 849380
Chris PeBenito 849380
########################################
Chris PeBenito 46410f
## <interface name="files_remove_general_system_config">
Chris PeBenito 46410f
##	<description>
Chris PeBenito 46410f
##		Delete system configuration files in /etc.
Chris PeBenito 46410f
##	</description>
Chris PeBenito 46410f
##	<parameter name="domain">
Chris PeBenito 46410f
##		The type of the process performing this action.
Chris PeBenito 46410f
##	</parameter>
Chris PeBenito 46410f
## </interface>
Chris PeBenito 46410f
#
Chris PeBenito 46410f
define(`files_remove_general_system_config',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 etc_t:dir rw_dir_perms;
Chris PeBenito 0c73cd
	allow $1 etc_t:file unlink;
Chris PeBenito 46410f
')
Chris PeBenito 46410f
Chris PeBenito 46410f
define(`files_remove_general_system_config_depend',`
Chris PeBenito 0c73cd
	type etc_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir rw_dir_perms;
Chris PeBenito 0c73cd
	class file unlink;
Chris PeBenito 46410f
')
Chris PeBenito 46410f
Chris PeBenito 46410f
########################################
Chris PeBenito 849380
#
Chris PeBenito bd202f
# files_execute_system_config_script(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_execute_system_config_script',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 etc_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 etc_t:lnk_file r_file_perms;
Chris PeBenito dd8229
	can_exec($1,etc_t)
Chris PeBenito dd8229
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`files_execute_system_config_script_depend',`
Chris PeBenito 0c73cd
	type etc_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito dd8229
	class lnk_file r_file_perms;
Chris PeBenito 0c73cd
	class file { getattr read execute execute_no_trans };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 0c73cd
# files_create_boot_flag(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
# /halt, /.autofsck, etc
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_create_boot_flag',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 root_t:dir rw_dir_perms;
Chris PeBenito 0c73cd
	allow $1 etc_runtime_t:file { create read write setattr unlink };
Chris PeBenito 0c73cd
	type_transition $1 root_t:file etc_runtime_t;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`files_create_boot_flag_depend',`
Chris PeBenito 0c73cd
	type root_t, etc_runtime_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir rw_dir_perms;
Chris PeBenito dd8229
	class file { create read write setattr unlink};
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito d490eb
# files_manage_runtime_system_config(type)
Chris PeBenito b4cd15
#
Chris PeBenito d490eb
define(`files_manage_runtime_system_config',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 etc_t:dir rw_dir_perms;
Chris PeBenito dd8229
	allow $1 etc_runtime_t:file create_file_perms;
Chris PeBenito 0c73cd
	type_transition $1 etc_t:file etc_runtime_t;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito d490eb
define(`files_manage_runtime_system_config_depend',`
Chris PeBenito 0c73cd
	type etc_t, etc_runtime_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir rw_dir_perms;
Chris PeBenito dd8229
	class file create_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# files_read_runtime_system_config(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_read_runtime_system_config',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 etc_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 etc_runtime_t:file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito d490eb
define(`files_read_runtime_system_config_depend',`
Chris PeBenito 0c73cd
	type etc_t, etc_runtime_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito dd8229
	class file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# files_create_private_config(domain,privatetype,[class(es)])
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_create_private_config',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 etc_t:dir rw_dir_perms;
Chris PeBenito 0c73cd
	ifelse(`$3',`',`
Chris PeBenito 0c73cd
		type_transition $1 etc_t:file $2;
Chris PeBenito 0c73cd
	',`
Chris PeBenito 0c73cd
		type_transition $1 etc_t:$3 $2;
Chris PeBenito 0c73cd
	')
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`files_create_private_config_depend',`
Chris PeBenito b4cd15
type etc_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
class dir rw_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito 3b857e
#
Chris PeBenito 129318
# files_modify_isid_type_dir(domain)
Chris PeBenito 129318
#
Chris PeBenito 129318
define(`files_modify_isid_type_dir',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 file_t:dir rw_dir_perms;
Chris PeBenito 129318
')
Chris PeBenito 129318
Chris PeBenito 129318
define(`files_modify_isid_type_dir_depend',`
Chris PeBenito 0c73cd
	type file_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir rw_dir_perms;
Chris PeBenito 129318
')
Chris PeBenito 129318
Chris PeBenito 129318
########################################
Chris PeBenito 129318
#
Chris PeBenito 3b857e
# files_ignore_get_isid_type_dir_attrib(domain)
Chris PeBenito 3b857e
#
Chris PeBenito 3b857e
define(`files_ignore_get_isid_type_dir_attrib',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 file_t:dir search;
Chris PeBenito 3b857e
')
Chris PeBenito 3b857e
Chris PeBenito 3b857e
define(`files_ignore_get_isid_type_dir_attrib_depend',`
Chris PeBenito 0c73cd
	type file_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito 3b857e
')
Chris PeBenito 3b857e
Chris PeBenito 3b857e
########################################
Chris PeBenito 3b857e
#
Chris PeBenito 3b857e
# files_ignore_search_isid_type_dir(domain)
Chris PeBenito 3b857e
#
Chris PeBenito 3b857e
define(`files_ignore_search_isid_type_dir',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 file_t:dir search;
Chris PeBenito 3b857e
')
Chris PeBenito 3b857e
Chris PeBenito 3b857e
define(`files_ignore_search_isid_type_dir_depend',`
Chris PeBenito 0c73cd
	type file_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito 3b857e
')
Chris PeBenito 3b857e
Chris PeBenito 3b857e
########################################
Chris PeBenito daa0e0
## <interface name="files_list_home_directories">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Get listing home home directories.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
define(`files_list_home_directories',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 home_root_t:dir r_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 3ce6cb
define(`files_list_home_directories_depend',`
Chris PeBenito 0c73cd
	type home_root_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito d490eb
# files_read_mnt_dir(domain)
Chris PeBenito d490eb
#
Chris PeBenito d490eb
define(`files_read_mnt_dir',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 mnt_t:dir r_dir_perms;
Chris PeBenito d490eb
')
Chris PeBenito d490eb
Chris PeBenito d490eb
define(`files_read_runtime_system_config_depend',`
Chris PeBenito 0c73cd
	type mnt_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito d490eb
')
Chris PeBenito d490eb
Chris PeBenito d490eb
########################################
Chris PeBenito d490eb
#
Chris PeBenito bd202f
# files_create_private_tmp_data(domain,private_type,[object class(es)])
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
define(`files_create_private_tmp_data',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 tmp_t:dir rw_dir_perms;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	ifelse(`$3',`',`
Chris PeBenito 0c73cd
		type_transition $1 tmp_t:file $2;
Chris PeBenito 0c73cd
	',`
Chris PeBenito 0c73cd
		type_transition $1 tmp_t:$3 $2;
Chris PeBenito 0c73cd
	')
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 3ce6cb
define(`files_create_private_tmp_data_depend',`
Chris PeBenito 0c73cd
	type tmp_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir rw_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# files_remove_all_tmp_data(domain)
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
define(`files_remove_all_tmp_data',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 tmpfile:dir { getattr search read write add_name remove_name rmdir };
Chris PeBenito 0c73cd
	allow $1 tmpfile:file { getattr unlink };
Chris PeBenito 0c73cd
	allow $1 tmpfile:lnk_file { getattr unlink };
Chris PeBenito 0c73cd
	allow $1 tmpfile:fifo_file { getattr unlink };
Chris PeBenito 0c73cd
	allow $1 tmpfile:sock_file { getattr unlink };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 3ce6cb
define(`files_remove_all_tmp_data_depend',`
Chris PeBenito 0c73cd
	attribute tmpfile;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir { getattr search read write add_name remove_name rmdir };
Chris PeBenito 0c73cd
	class file { getattr unlink };
Chris PeBenito 0c73cd
	class lnk_file { getattr unlink };
Chris PeBenito 0c73cd
	class fifo_file { getattr unlink };
Chris PeBenito 0c73cd
	class sock_file { getattr unlink };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito efd8ed
# files_search_general_application_resources_dir(domain)
Chris PeBenito efd8ed
#
Chris PeBenito efd8ed
define(`files_search_general_application_resources_dir',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 usr_t:dir search;
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito efd8ed
define(`files_search_general_application_resources_dir_depend',`
Chris PeBenito 0c73cd
	type usr_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito efd8ed
########################################
Chris PeBenito efd8ed
#
Chris PeBenito bd202f
# files_read_general_application_resources(domain)
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
define(`files_read_general_application_resources',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 usr_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 usr_t:{ file lnk_file } r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 3ce6cb
define(`files_read_general_application_resources_depend',`
Chris PeBenito 0c73cd
	type usr_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito dd8229
	class file r_file_perms;
Chris PeBenito dd8229
	class lnk_file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito daa0e0
## <interface name="files_execute_system_source_code_scripts">
Chris PeBenito daa0e0
##	<description>
Chris PeBenito daa0e0
##		Execute programs in /usr/src in the caller domain.
Chris PeBenito daa0e0
##	</description>
Chris PeBenito daa0e0
##	<parameter name="domain">
Chris PeBenito daa0e0
##		The type of the process performing this action.
Chris PeBenito daa0e0
##	</parameter>
Chris PeBenito daa0e0
## </interface>
Chris PeBenito daa0e0
#
Chris PeBenito daa0e0
define(`files_execute_system_source_code_scripts',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 usr_t:dir search;
Chris PeBenito dd8229
	allow $1 src_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 src_t:lnk_file r_file_perms;
Chris PeBenito dd8229
	can_exec($1,src_t)
Chris PeBenito dd8229
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
define(`files_read_system_source_code_depend',`
Chris PeBenito 0c73cd
	type usr_t, src_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito 0c73cd
	class file { getattr read execute execute_no_trans };
Chris PeBenito dd8229
	class lnk_file r_file_perms;
Chris PeBenito daa0e0
')
Chris PeBenito daa0e0
Chris PeBenito daa0e0
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
# files_read_system_source_code(domain)
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
define(`files_read_system_source_code',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 usr_t:dir search;
Chris PeBenito dd8229
	allow $1 src_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 src_t:{ file lnk_file } r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 3ce6cb
define(`files_read_system_source_code_depend',`
Chris PeBenito 0c73cd
	type usr_t, src_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito dd8229
	class file r_file_perms;
Chris PeBenito dd8229
	class lnk_file r_file_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
# files_search_system_state_data_directory(domain)
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
define(`files_search_system_state_data_directory',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 3ce6cb
define(`files_search_system_state_data_directory_depend',`
Chris PeBenito 0c73cd
	type var_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito d0eddb
')
Chris PeBenito d0eddb
Chris PeBenito d0eddb
########################################
Chris PeBenito d0eddb
#
Chris PeBenito d0eddb
# files_ignore_search_system_state_data_directory(domain)
Chris PeBenito d0eddb
#
Chris PeBenito d0eddb
define(`files_ignore_search_system_state_data_directory',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 var_t:dir search;
Chris PeBenito d0eddb
')
Chris PeBenito d0eddb
Chris PeBenito d0eddb
define(`files_ignore_search_system_state_data_directory_depend',`
Chris PeBenito 0c73cd
	type var_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
# files_manage_pseudorandom_saved_seed(domain)
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
define(`files_manage_pseudorandom_saved_seed',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito dd8229
	allow $1 var_lib_t:dir rw_file_perms;
Chris PeBenito 0c73cd
	allow $1 var_lib_t:file { getattr create read write setattr unlink };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 3ce6cb
define(`files_manage_pseudorandom_saved_seed_depend',`
Chris PeBenito 0c73cd
	type var_t, var_lib_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir rw_file_perms;
Chris PeBenito 0c73cd
	class file { getattr create read write setattr unlink };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito dc771f
# files_get_system_lock_file_attributes(domain)
Chris PeBenito dc771f
#
Chris PeBenito dc771f
define(`files_get_system_lock_file_attributes',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 var_lock_t:dir r_dir_perms;
Chris PeBenito 0c73cd
	allow $1 var_lock_t:file getattr;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito dc771f
define(`files_get_system_lock_file_attributes_depend',`
Chris PeBenito 0c73cd
	type var_lock_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito 0c73cd
	class file getattr;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito dc771f
########################################
Chris PeBenito dc771f
#
Chris PeBenito bd202f
# files_manage_system_lock_files(domain)
Chris PeBenito b4cd15
#
Chris PeBenito 033c80
define(`files_manage_system_lock_files',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_lock_t:dir { getattr search create read write setattr add_name remove_name rmdir };
Chris PeBenito 0c73cd
	allow $1 var_lock_t:file { getattr create read write setattr unlink };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 033c80
define(`files_manage_system_lock_files_depend',`
Chris PeBenito 0c73cd
	type var_lock_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir { getattr search create read write setattr add_name remove_name rmdir };
Chris PeBenito 0c73cd
	class file { getattr create read write setattr unlink };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito bd202f
# files_remove_all_lock_files(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`files_remove_all_lock_files',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	allow $1 lockfile:dir rw_file_perms;
Chris PeBenito 0c73cd
	allow $1 lockfile:file { getattr unlink };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`files_remove_all_lock_files_depend',`
Chris PeBenito 0c73cd
	attribute lockfile;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir rw_dir_perms;
Chris PeBenito 0c73cd
	class file { getattr unlink };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 075c4f
# files_create_private_lock_file(domain,private_type,[object class(es)])
Chris PeBenito 075c4f
#
Chris PeBenito 075c4f
define(`files_create_private_lock_file',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito 0c73cd
	allow $1 var_lock_t:dir rw_dir_perms;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	ifelse(`$3',`',`
Chris PeBenito 0c73cd
		type_transition $1 var_lock_t:file $2;
Chris PeBenito 0c73cd
	',`
Chris PeBenito 0c73cd
		type_transition $1 var_lock_t:$3 $2;
Chris PeBenito 0c73cd
	')
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito 075c4f
define(`files_create_private_lock_file_depend',`
Chris PeBenito 0c73cd
	type var_t, var_lock_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir rw_dir_perms;
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito 075c4f
########################################
Chris PeBenito 075c4f
#
Chris PeBenito 3ce6cb
# files_search_runtime_data_directory(domain)
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
define(`files_search_runtime_data_directory',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito 0c73cd
	allow $1 var_run_t:dir search;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 3ce6cb
define(`files_search_runtime_data_directory_depend',`
Chris PeBenito 0c73cd
	type var_t, var_run_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
########################################
Chris PeBenito b4cd15
#
Chris PeBenito 075c4f
# files_ignore_search_runtime_data_directory(domain)
Chris PeBenito 075c4f
#
Chris PeBenito 075c4f
define(`files_ignore_search_runtime_data_directory',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_run_t:dir search;
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito 075c4f
define(`files_ignore_search_runtime_data_directory_depend',`
Chris PeBenito 0c73cd
	type var_run_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito 075c4f
')
Chris PeBenito 075c4f
Chris PeBenito 075c4f
########################################
Chris PeBenito 075c4f
#
Chris PeBenito 3ce6cb
# files_read_runtime_data_directory(domain)
Chris PeBenito b4cd15
#
Chris PeBenito 3ce6cb
define(`files_read_runtime_data_directory',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito dd8229
	allow $1 var_run_t:dir r_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito 3ce6cb
define(`files_read_runtime_data_directory_depend',`
Chris PeBenito 0c73cd
	type var_t, var_run_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito b4cd15
')
Chris PeBenito a266e3
Chris PeBenito a266e3
########################################
Chris PeBenito a266e3
#
Chris PeBenito 3ce6cb
# files_create_daemon_runtime_data(domain,pidfile,[object class(es)])
Chris PeBenito a266e3
#
Chris PeBenito 3ce6cb
define(`files_create_daemon_runtime_data',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito 0c73cd
	allow $1 var_run_t:dir rw_dir_perms;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	ifelse(`$3',`',`
Chris PeBenito 0c73cd
		type_transition $1 var_run_t:file $2;
Chris PeBenito 0c73cd
	',`
Chris PeBenito 0c73cd
		type_transition $1 var_run_t:$3 $2;
Chris PeBenito 0c73cd
	')
Chris PeBenito a266e3
')
Chris PeBenito a266e3
Chris PeBenito 3ce6cb
define(`files_create_daemon_runtime_data_depend',`
Chris PeBenito 0c73cd
	type var_t, var_run_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir rw_dir_perms;
Chris PeBenito 3ce6cb
')
Chris PeBenito 3ce6cb
Chris PeBenito 3ce6cb
########################################
Chris PeBenito 3ce6cb
#
Chris PeBenito bd202f
# files_modify_system_runtime_data(domain)
Chris PeBenito 3ce6cb
#
Chris PeBenito 3ce6cb
define(`files_modify_system_runtime_data',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito dd8229
	allow $1 var_run_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 var_run_t:file rw_file_perms;
Chris PeBenito 3ce6cb
')
Chris PeBenito 3ce6cb
Chris PeBenito 3ce6cb
define(`files_modify_system_runtime_data_depend',`
Chris PeBenito 0c73cd
	type var_t, var_run_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito dd8229
	class file rw_file_perms;
Chris PeBenito 3ce6cb
')
Chris PeBenito 3ce6cb
Chris PeBenito 3ce6cb
########################################
Chris PeBenito dc771f
## <interface name="files_ignore_write_all_daemon_runtime_data">
Chris PeBenito dc771f
##	<description>
Chris PeBenito dc771f
##		Do not audit attempts to write to daemon runtime data files.
Chris PeBenito dc771f
##	</description>
Chris PeBenito dc771f
##	<parameter name="domain">
Chris PeBenito dc771f
##		The type of the process performing this action.
Chris PeBenito dc771f
##	</parameter>
Chris PeBenito dc771f
## </interface>
Chris PeBenito dc771f
#
Chris PeBenito dc771f
Chris PeBenito dc771f
define(`files_ignore_write_all_daemon_runtime_data',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 pidfile:file write;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito dc771f
define(`files_ignore_write_all_daemon_runtime_data_depend',`
Chris PeBenito 0c73cd
	attribute pidfile;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file write;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito dc771f
########################################
Chris PeBenito dc771f
## <interface name="files_ignore_ioctl_all_daemon_runtime_data">
Chris PeBenito dc771f
##	<description>
Chris PeBenito dc771f
##		Do not audit attempts to ioctl daemon runtime data files.
Chris PeBenito dc771f
##	</description>
Chris PeBenito dc771f
##	<parameter name="domain">
Chris PeBenito dc771f
##		The type of the process performing this action.
Chris PeBenito dc771f
##	</parameter>
Chris PeBenito dc771f
## </interface>
Chris PeBenito dc771f
#
Chris PeBenito dc771f
Chris PeBenito dc771f
define(`files_ignore_ioctl_all_daemon_runtime_data',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	dontaudit $1 pidfile:file ioctl;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito dc771f
define(`files_ignore_ioctl_all_daemon_runtime_data_depend',`
Chris PeBenito 0c73cd
	attribute pidfile;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class file ioctl;
Chris PeBenito dc771f
')
Chris PeBenito dc771f
Chris PeBenito dc771f
########################################
Chris PeBenito 3ce6cb
#
Chris PeBenito d115b2
# files_read_all_daemon_runtime_data(domain)
Chris PeBenito d115b2
#
Chris PeBenito d115b2
define(`files_read_all_daemon_runtime_data',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito 0c73cd
	allow $1 pidfile:dir r_dir_perms;
Chris PeBenito 0c73cd
	allow $1 pidfile:file r_file_perms;
Chris PeBenito d115b2
')
Chris PeBenito d115b2
Chris PeBenito d115b2
define(`files_read_all_daemon_runtime_data_depend',`
Chris PeBenito 0c73cd
	attribute pidfile;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	type var_t;
Chris PeBenito 0c73cd
	class dir r_dir_perms;
Chris PeBenito 0c73cd
	class file r_file_perms;
Chris PeBenito d115b2
')
Chris PeBenito d115b2
Chris PeBenito d115b2
########################################
Chris PeBenito d115b2
#
Chris PeBenito bd202f
# files_remove_all_daemon_runtime_data(domain)
Chris PeBenito 3ce6cb
#
Chris PeBenito 3ce6cb
define(`files_remove_all_daemon_runtime_data',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito 0c73cd
	allow $1 var_run_t:{ sock_file lnk_file } { getattr unlink };
Chris PeBenito 0c73cd
	allow $1 var_run_t:dir rmdir;
Chris PeBenito 0c73cd
	allow $1 pidfile:dir rw_dir_perms;
Chris PeBenito 0c73cd
	allow $1 pidfile:file { getattr unlink };
Chris PeBenito 0c73cd
	allow $1 pidfile:sock_file { getattr unlink };
Chris PeBenito 3ce6cb
')
Chris PeBenito a266e3
Chris PeBenito 3ce6cb
define(`files_remove_all_daemon_runtime_data_depend',`
Chris PeBenito 0c73cd
	attribute pidfile;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	type var_t, var_run_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir rw_dir_perms;
Chris PeBenito 0c73cd
	class file { getattr unlink };
Chris PeBenito 0c73cd
	class lnk_file { getattr unlink };
Chris PeBenito 0c73cd
	class sock_file { getattr unlink };
Chris PeBenito a266e3
')
Chris PeBenito 7bba9d
Chris PeBenito 7bba9d
########################################
Chris PeBenito 7bba9d
#
Chris PeBenito 7bba9d
# files_search_system_spool_directory(domain)
Chris PeBenito 7bba9d
#
Chris PeBenito 7bba9d
define(`files_search_system_spool_directory',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito 0c73cd
	allow $1 var_spool_t:dir search;
Chris PeBenito 7bba9d
')
Chris PeBenito 7bba9d
Chris PeBenito 7bba9d
define(`files_search_system_spool_directory_depend',`
Chris PeBenito 0c73cd
	type var_t, var_spool_t;
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	class dir search;
Chris PeBenito 7bba9d
')
Chris PeBenito 7bba9d
Chris PeBenito 7bba9d
########################################
Chris PeBenito 7bba9d
#
Chris PeBenito 7bba9d
# files_read_system_spool_directory(domain)
Chris PeBenito 7bba9d
#
Chris PeBenito 7bba9d
define(`files_read_system_spool_directory',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito dd8229
	allow $1 var_spool_t:dir r_dir_perms;
Chris PeBenito 7bba9d
')
Chris PeBenito 7bba9d
Chris PeBenito 7bba9d
define(`files_read_system_spool_directory_depend',`
Chris PeBenito 0c73cd
	type var_t, var_spool_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito 7bba9d
')
Chris PeBenito 2e77b2
Chris PeBenito efd8ed
########################################
Chris PeBenito efd8ed
#
Chris PeBenito efd8ed
# files_read_system_spools(domain)
Chris PeBenito efd8ed
#
Chris PeBenito efd8ed
define(`files_read_system_spools',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito dd8229
	allow $1 var_spool_t:dir r_dir_perms;
Chris PeBenito dd8229
	allow $1 var_spool_t:file r_file_perms;
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito efd8ed
define(`files_read_system_spools_depend',`
Chris PeBenito 0c73cd
	type var_t, var_spool_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir r_dir_perms;
Chris PeBenito dd8229
	class file r_file_perms;
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito efd8ed
########################################
Chris PeBenito efd8ed
#
Chris PeBenito efd8ed
# files_manage_system_spools(domain)
Chris PeBenito efd8ed
#
Chris PeBenito efd8ed
define(`files_manage_system_spools',`
Chris PeBenito 0c73cd
	requires_block_template(`$0'_depend)
Chris PeBenito 0c73cd
Chris PeBenito 0c73cd
	allow $1 var_t:dir search;
Chris PeBenito dd8229
	allow $1 var_spool_t:dir rw_file_perms;
Chris PeBenito 0c73cd
	allow $1 var_spool_t:file { getattr create read write append unlink setattr };
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito efd8ed
define(`files_manage_system_spools_depend',`
Chris PeBenito 0c73cd
	type var_t, var_spool_t;
Chris PeBenito 0c73cd
Chris PeBenito dd8229
	class dir rw_file_perms;
Chris PeBenito 0c73cd
	class file { getattr create read write append unlink setattr };
Chris PeBenito efd8ed
')
Chris PeBenito efd8ed
Chris PeBenito 2e77b2
## </module>