Chris PeBenito b16c6b8
## <summary>Policy controlling access to storage devices</summary>
Chris PeBenito b16c6b8
Chris PeBenito 494e988
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to get the attributes of fixed disk
Chris PeBenito 414e415
##	device nodes.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b16c6b8
#
Chris PeBenito 1815bad
interface(`storage_getattr_fixed_disk_dev',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type fixed_disk_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito 0c73cd2
	allow $1 fixed_disk_device_t:blk_file getattr;
Chris PeBenito b16c6b8
')
Chris PeBenito b16c6b8
Chris PeBenito 494e988
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Do not audit attempts made by the caller to get
Chris PeBenito 414e415
##	the attributes of fixed disk device nodes.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process to not audit.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b16c6b8
#
Chris PeBenito 1815bad
interface(`storage_dontaudit_getattr_fixed_disk_dev',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type fixed_disk_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Chris PeBenito 0c73cd2
	dontaudit $1 fixed_disk_device_t:blk_file getattr;
Chris PeBenito d9845ae
	dontaudit $1 fixed_disk_device_t:chr_file getattr; # /dev/rawctl
Chris PeBenito b16c6b8
')
Chris PeBenito b16c6b8
Chris PeBenito 494e988
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to set the attributes of fixed disk
Chris PeBenito 414e415
##	device nodes.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b16c6b8
#
Chris PeBenito 1815bad
interface(`storage_setattr_fixed_disk_dev',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type fixed_disk_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito 0c73cd2
	allow $1 fixed_disk_device_t:blk_file setattr;
Chris PeBenito b16c6b8
')
Chris PeBenito b16c6b8
Chris PeBenito d35c621
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Do not audit attempts made by the caller to set
Chris PeBenito 414e415
##	the attributes of fixed disk device nodes.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process to not audit.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito d35c621
#
Chris PeBenito 1815bad
interface(`storage_dontaudit_setattr_fixed_disk_dev',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type fixed_disk_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Chris PeBenito 2e0a880
	dontaudit $1 fixed_disk_device_t:blk_file setattr;
Chris PeBenito b16c6b8
')
Chris PeBenito e181fe0
Chris PeBenito 494e988
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to directly read from a fixed disk.
Chris PeBenito 414e415
##	This is extremly dangerous as it can bypass the
Chris PeBenito 414e415
##	SELinux protections for filesystem objects, and
Chris PeBenito 414e415
##	should only be used by trusted domains.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b4cd153
#
Chris PeBenito 199895e
interface(`storage_raw_read_fixed_disk',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		attribute fixed_disk_raw_read;
Chris PeBenito d35c621
		type fixed_disk_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito c0868a7
	allow $1 fixed_disk_device_t:blk_file read_blk_file_perms;
Chris PeBenito 0c73cd2
	typeattribute $1 fixed_disk_raw_read;
Chris PeBenito b4cd153
')
Chris PeBenito b4cd153
Chris PeBenito 494e988
########################################
Chris PeBenito 25c6746
## <summary>
Chris PeBenito 25c6746
##	Do not audit attempts made by the caller to read
Chris PeBenito 25c6746
##	fixed disk device nodes.
Chris PeBenito 25c6746
## </summary>
Chris PeBenito 25c6746
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 25c6746
##	The type of the process to not audit.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 25c6746
## </param>
Chris PeBenito 25c6746
#
Chris PeBenito 25c6746
interface(`storage_dontaudit_read_fixed_disk',`
Chris PeBenito 25c6746
	gen_require(`
Chris PeBenito 25c6746
		type fixed_disk_device_t;
Chris PeBenito 25c6746
		
Chris PeBenito 25c6746
	')
Chris PeBenito 25c6746
Chris PeBenito 25c6746
	dontaudit $1 fixed_disk_device_t:blk_file { getattr ioctl read };
Chris PeBenito 25c6746
')
Chris PeBenito 25c6746
Chris PeBenito 25c6746
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to directly write to a fixed disk.
Chris PeBenito 414e415
##	This is extremly dangerous as it can bypass the
Chris PeBenito 414e415
##	SELinux protections for filesystem objects, and
Chris PeBenito 414e415
##	should only be used by trusted domains.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b4cd153
#
Chris PeBenito 199895e
interface(`storage_raw_write_fixed_disk',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		attribute fixed_disk_raw_write;
Chris PeBenito d35c621
		type fixed_disk_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito c0868a7
	allow $1 fixed_disk_device_t:blk_file write_blk_file_perms;
Chris PeBenito 0c73cd2
	typeattribute $1 fixed_disk_raw_write;
Chris PeBenito b4cd153
')
Chris PeBenito b4cd153
Chris PeBenito 494e988
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 07620c0
##	Do not audit attempts made by the caller to write
Chris PeBenito 07620c0
##	fixed disk device nodes.
Chris PeBenito 07620c0
## </summary>
Chris PeBenito 07620c0
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 07620c0
##	Domain to not audit.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 07620c0
## </param>
Chris PeBenito 07620c0
#
Chris PeBenito 07620c0
interface(`storage_dontaudit_write_fixed_disk',`
Chris PeBenito 07620c0
	gen_require(`
Chris PeBenito 07620c0
		type fixed_disk_device_t;
Chris PeBenito 07620c0
		
Chris PeBenito 07620c0
	')
Chris PeBenito 07620c0
Chris PeBenito c0868a7
	dontaudit $1 fixed_disk_device_t:blk_file write_blk_file_perms;
Chris PeBenito 07620c0
')
Chris PeBenito 07620c0
Chris PeBenito 07620c0
########################################
Chris PeBenito 07620c0
## <summary>
Chris PeBenito 414e415
##	Create, read, write, and delete fixed disk device nodes.
Chris PeBenito 783b383
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito f5c42bd
#
Chris PeBenito 199895e
interface(`storage_manage_fixed_disk',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		attribute fixed_disk_raw_read, fixed_disk_raw_write;
Chris PeBenito d35c621
		type fixed_disk_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito d534d35
	allow $1 self:capability mknod;
Chris PeBenito c0868a7
	allow $1 fixed_disk_device_t:blk_file manage_blk_file_perms;
Chris PeBenito 0c73cd2
	typeattribute $1 fixed_disk_raw_read, fixed_disk_raw_write;
Chris PeBenito a42ca7e
')
Chris PeBenito a42ca7e
Chris PeBenito a42ca7e
########################################
Chris PeBenito a42ca7e
## <summary>
Chris PeBenito 675a0ee
##	Create block devices in /dev with the fixed disk type
Chris PeBenito 675a0ee
##	via an automatic type transition.
Chris PeBenito 675a0ee
## </summary>
Chris PeBenito 675a0ee
## <param name="domain">
Chris PeBenito 675a0ee
##	<summary>
Chris PeBenito 675a0ee
##	The type of the process performing this action.
Chris PeBenito 675a0ee
##	</summary>
Chris PeBenito 675a0ee
## </param>
Chris PeBenito 675a0ee
#
Chris PeBenito 675a0ee
interface(`storage_dev_filetrans_fixed_disk',`
Chris PeBenito 675a0ee
	gen_require(`
Chris PeBenito 675a0ee
		type fixed_disk_device_t;
Chris PeBenito 675a0ee
	')
Chris PeBenito 675a0ee
Chris PeBenito 675a0ee
	dev_filetrans($1,fixed_disk_device_t,blk_file)
Chris PeBenito 675a0ee
')
Chris PeBenito 675a0ee
Chris PeBenito 675a0ee
########################################
Chris PeBenito 675a0ee
## <summary>
Chris PeBenito 675a0ee
##	Create block devices in on a tmpfs filesystem with the
Chris PeBenito 675a0ee
##	fixed disk type via an automatic type transition.
Chris PeBenito 675a0ee
## </summary>
Chris PeBenito 675a0ee
## <param name="domain">
Chris PeBenito 675a0ee
##	<summary>
Chris PeBenito 675a0ee
##	The type of the process performing this action.
Chris PeBenito 675a0ee
##	</summary>
Chris PeBenito 675a0ee
## </param>
Chris PeBenito 675a0ee
#
Chris PeBenito 675a0ee
interface(`storage_tmpfs_filetrans_fixed_disk',`
Chris PeBenito 675a0ee
	gen_require(`
Chris PeBenito 675a0ee
		type fixed_disk_device_t;
Chris PeBenito 675a0ee
	')
Chris PeBenito 675a0ee
Chris PeBenito 675a0ee
	fs_tmpfs_filetrans($1,fixed_disk_device_t,blk_file)
Chris PeBenito 675a0ee
')
Chris PeBenito 675a0ee
Chris PeBenito 675a0ee
########################################
Chris PeBenito 675a0ee
## <summary>
Chris PeBenito 783b383
##	Relabel fixed disk device nodes.
Chris PeBenito 783b383
## </summary>
Chris PeBenito 783b383
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 783b383
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 783b383
## </param>
Chris PeBenito 783b383
#
Chris PeBenito 783b383
interface(`storage_relabel_fixed_disk',`
Chris PeBenito 783b383
	gen_require(`
Chris PeBenito 783b383
		type fixed_disk_device_t;
Chris PeBenito 783b383
	')
Chris PeBenito 783b383
Chris PeBenito 783b383
	dev_list_all_dev_nodes($1)
Chris PeBenito c0868a7
	allow $1 fixed_disk_device_t:blk_file relabel_blk_file_perms;
Chris PeBenito 783b383
')
Chris PeBenito 783b383
Chris PeBenito 783b383
########################################
Chris PeBenito 783b383
## <summary>
Chris PeBenito 783b383
##	Enable a fixed disk device as swap space
Chris PeBenito 783b383
## </summary>
Chris PeBenito 783b383
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 783b383
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 783b383
## </param>
Chris PeBenito 783b383
#
Chris PeBenito 783b383
interface(`storage_swapon_fixed_disk',`
Chris PeBenito 783b383
	gen_require(`
Chris PeBenito 783b383
		type fixed_disk_device_t;
Chris PeBenito 783b383
	')
Chris PeBenito 783b383
Chris PeBenito 783b383
	dev_list_all_dev_nodes($1)
Chris PeBenito 783b383
	allow $1 fixed_disk_device_t:blk_file { getattr swapon };
Chris PeBenito 783b383
')
Chris PeBenito 783b383
Chris PeBenito 783b383
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to get the attributes of
Chris PeBenito 414e415
##	the generic SCSI interface device nodes.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito 7a2f20a
#
Chris PeBenito 1815bad
interface(`storage_getattr_scsi_generic_dev',`
Chris PeBenito 7a2f20a
	gen_require(`
Chris PeBenito 7a2f20a
		type scsi_generic_device_t;
Chris PeBenito 7a2f20a
	')
Chris PeBenito 7a2f20a
Chris PeBenito 7a2f20a
	dev_list_all_dev_nodes($1)
Chris PeBenito a5ec7cb
	allow $1 scsi_generic_device_t:chr_file getattr;
Chris PeBenito 7a2f20a
')
Chris PeBenito 7a2f20a
Chris PeBenito 7a2f20a
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to set the attributes of
Chris PeBenito 414e415
##	the generic SCSI interface device nodes.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito 7a2f20a
#
Chris PeBenito 1815bad
interface(`storage_setattr_scsi_generic_dev',`
Chris PeBenito 7a2f20a
	gen_require(`
Chris PeBenito 7a2f20a
		type scsi_generic_device_t;
Chris PeBenito 7a2f20a
	')
Chris PeBenito 7a2f20a
Chris PeBenito 7a2f20a
	dev_list_all_dev_nodes($1)
Chris PeBenito a5ec7cb
	allow $1 scsi_generic_device_t:chr_file setattr;
Chris PeBenito 7a2f20a
')
Chris PeBenito 7a2f20a
Chris PeBenito 7a2f20a
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to directly read, in a
Chris PeBenito 414e415
##	generic fashion, from any SCSI device.
Chris PeBenito 414e415
##	This is extremly dangerous as it can bypass the
Chris PeBenito 414e415
##	SELinux protections for filesystem objects, and
Chris PeBenito 414e415
##	should only be used by trusted domains.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b4cd153
#
Chris PeBenito 199895e
interface(`storage_read_scsi_generic',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		attribute scsi_generic_read;
Chris PeBenito d35c621
		type scsi_generic_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito c0868a7
	allow $1 scsi_generic_device_t:chr_file read_chr_file_perms;
Chris PeBenito 0c73cd2
	typeattribute $1 scsi_generic_read;
Chris PeBenito b4cd153
')
Chris PeBenito b4cd153
Chris PeBenito 494e988
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to directly write, in a
Chris PeBenito 414e415
##	generic fashion, from any SCSI device.
Chris PeBenito 414e415
##	This is extremly dangerous as it can bypass the
Chris PeBenito 414e415
##	SELinux protections for filesystem objects, and
Chris PeBenito 414e415
##	should only be used by trusted domains.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b4cd153
#
Chris PeBenito 199895e
interface(`storage_write_scsi_generic',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		attribute scsi_generic_write;
Chris PeBenito d35c621
		type scsi_generic_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito c0868a7
	allow $1 scsi_generic_device_t:chr_file write_chr_file_perms;
Chris PeBenito 0c73cd2
	typeattribute $1 scsi_generic_write;
Chris PeBenito b4cd153
')
Chris PeBenito b4cd153
Chris PeBenito b4cd153
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Set attributes of the device nodes
Chris PeBenito 414e415
##	for the SCSI generic inerface.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito 8a0da10
#
Chris PeBenito 1815bad
interface(`storage_setattr_scsi_generic_dev_dev',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type scsi_generic_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito a5ec7cb
	allow $1 scsi_generic_device_t:chr_file setattr;
Chris PeBenito 8a0da10
')
Chris PeBenito 8a0da10
Chris PeBenito 494e988
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 07620c0
##	Do not audit attempts to read or write
Chris PeBenito 07620c0
##	SCSI generic device interfaces.
Chris PeBenito 07620c0
## </summary>
Chris PeBenito 07620c0
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 07620c0
##	Domain to not audit.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 07620c0
## </param>
Chris PeBenito 07620c0
#
Chris PeBenito 07620c0
interface(`storage_dontaudit_rw_scsi_generic',`
Chris PeBenito 07620c0
	gen_require(`
Chris PeBenito 07620c0
		type scsi_generic_device_t;
Chris PeBenito 07620c0
	')
Chris PeBenito 07620c0
Chris PeBenito 07620c0
	dontaudit $1 scsi_generic_device_t:chr_file rw_file_perms;
Chris PeBenito 07620c0
')
Chris PeBenito 07620c0
Chris PeBenito 07620c0
########################################
Chris PeBenito 07620c0
## <summary>
Chris PeBenito 414e415
##	Allow the caller to get the attributes of removable
Chris PeBenito 414e415
##	devices device nodes.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b4cd153
#
Chris PeBenito 1815bad
interface(`storage_getattr_removable_dev',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type removable_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito 0c73cd2
	allow $1 removable_device_t:blk_file getattr;
Chris PeBenito b4cd153
')
Chris PeBenito b4cd153
Chris PeBenito 494e988
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Do not audit attempts made by the caller to get
Chris PeBenito 414e415
##	the attributes of removable devices device nodes.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process to not audit.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b16c6b8
#
Chris PeBenito 1815bad
interface(`storage_dontaudit_getattr_removable_dev',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type removable_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Chris PeBenito 0c73cd2
	dontaudit $1 removable_device_t:blk_file getattr;
Chris PeBenito b16c6b8
')
Chris PeBenito b16c6b8
Chris PeBenito b4cd153
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito ccc5978
##	Do not audit attempts made by the caller to read
Chris PeBenito ccc5978
##	removable devices device nodes.
Chris PeBenito ccc5978
## </summary>
Chris PeBenito ccc5978
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito ccc5978
##	The type of the process to not audit.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito ccc5978
## </param>
Chris PeBenito ccc5978
#
Chris PeBenito ccc5978
interface(`storage_dontaudit_read_removable_device',`
Chris PeBenito ccc5978
	gen_require(`
Chris PeBenito ccc5978
		type removable_device_t;
Chris PeBenito ccc5978
		
Chris PeBenito ccc5978
	')
Chris PeBenito ccc5978
Chris PeBenito ccc5978
	dontaudit $1 removable_device_t:blk_file { getattr ioctl read };
Chris PeBenito ccc5978
')
Chris PeBenito ccc5978
Chris PeBenito ccc5978
########################################
Chris PeBenito ccc5978
## <summary>
Chris PeBenito 414e415
##	Allow the caller to set the attributes of removable
Chris PeBenito 414e415
##	devices device nodes.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b4cd153
#
Chris PeBenito 1815bad
interface(`storage_setattr_removable_dev',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type removable_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito 0c73cd2
	allow $1 removable_device_t:blk_file setattr;
Chris PeBenito b4cd153
')
Chris PeBenito b4cd153
Chris PeBenito b4cd153
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Do not audit attempts made by the caller to set
Chris PeBenito 414e415
##	the attributes of removable devices device nodes.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process to not audit.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito 7a2f20a
#
Chris PeBenito 1815bad
interface(`storage_dontaudit_setattr_removable_dev',`
Chris PeBenito 7a2f20a
	gen_require(`
Chris PeBenito 7a2f20a
		type removable_device_t;
Chris PeBenito 7a2f20a
	')
Chris PeBenito 7a2f20a
Chris PeBenito 7a2f20a
	dontaudit $1 removable_device_t:blk_file setattr;
Chris PeBenito 7a2f20a
')
Chris PeBenito 7a2f20a
Chris PeBenito 7a2f20a
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to directly read from
Chris PeBenito 414e415
##	a removable device.
Chris PeBenito 414e415
##	This is extremly dangerous as it can bypass the
Chris PeBenito 414e415
##	SELinux protections for filesystem objects, and
Chris PeBenito 414e415
##	should only be used by trusted domains.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito 8a0da10
#
Chris PeBenito 199895e
interface(`storage_raw_read_removable_device',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type removable_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito c0868a7
	allow $1 removable_device_t:blk_file read_blk_file_perms;
Chris PeBenito 8a0da10
')
Chris PeBenito 8a0da10
Chris PeBenito 8a0da10
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 07620c0
##	Do not audit attempts to directly read removable devices.
Chris PeBenito 07620c0
## </summary>
Chris PeBenito 07620c0
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 07620c0
##	Domain to not audit.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 07620c0
## </param>
Chris PeBenito 07620c0
#
Chris PeBenito 07620c0
interface(`storage_dontaudit_raw_read_removable_device',`
Chris PeBenito 07620c0
	gen_require(`
Chris PeBenito 07620c0
		type removable_device_t;
Chris PeBenito 07620c0
	')
Chris PeBenito 07620c0
Chris PeBenito c0868a7
	dontaudit $1 removable_device_t:blk_file read_blk_file_perms;
Chris PeBenito 07620c0
')
Chris PeBenito 07620c0
Chris PeBenito 07620c0
########################################
Chris PeBenito 07620c0
## <summary>
Chris PeBenito 414e415
##	Allow the caller to directly write to
Chris PeBenito 414e415
##	a removable device.
Chris PeBenito 414e415
##	This is extremly dangerous as it can bypass the
Chris PeBenito 414e415
##	SELinux protections for filesystem objects, and
Chris PeBenito 414e415
##	should only be used by trusted domains.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito 8a0da10
#
Chris PeBenito 199895e
interface(`storage_raw_write_removable_device',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type removable_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito c0868a7
	allow $1 removable_device_t:blk_file write_blk_file_perms;
Chris PeBenito 8a0da10
')
Chris PeBenito 8a0da10
Chris PeBenito 8a0da10
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 07620c0
##	Do not audit attempts to directly write removable devices.
Chris PeBenito 07620c0
## </summary>
Chris PeBenito 07620c0
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 07620c0
##	Domain to not audit.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 07620c0
## </param>
Chris PeBenito 07620c0
#
Chris PeBenito 07620c0
interface(`storage_dontaudit_raw_write_removable_device',`
Chris PeBenito 07620c0
	gen_require(`
Chris PeBenito 07620c0
		type removable_device_t;
Chris PeBenito 07620c0
	')
Chris PeBenito 07620c0
Chris PeBenito c0868a7
	dontaudit $1 removable_device_t:blk_file write_blk_file_perms;
Chris PeBenito 07620c0
')
Chris PeBenito 07620c0
Chris PeBenito 07620c0
########################################
Chris PeBenito 07620c0
## <summary>
Chris PeBenito 414e415
##	Allow the caller to directly read
Chris PeBenito 414e415
##	a tape device.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b4cd153
#
Chris PeBenito 1815bad
interface(`storage_read_tape',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type tape_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito c0868a7
	allow $1 tape_device_t:chr_file read_chr_file_perms;
Chris PeBenito b4cd153
')
Chris PeBenito b4cd153
Chris PeBenito b4cd153
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to directly read
Chris PeBenito 414e415
##	a tape device.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito b4cd153
#
Chris PeBenito 1815bad
interface(`storage_write_tape',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type tape_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito c0868a7
	allow $1 tape_device_t:chr_file write_chr_file_perms;
Chris PeBenito b4cd153
')
Chris PeBenito b4cd153
Chris PeBenito 8a0da10
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to get the attributes
Chris PeBenito 414e415
##	of device nodes of tape devices.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito 8a0da10
#
Chris PeBenito 1815bad
interface(`storage_getattr_tape_dev',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type tape_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito a5ec7cb
	allow $1 tape_device_t:chr_file getattr;
Chris PeBenito 8a0da10
')
Chris PeBenito 8a0da10
Chris PeBenito 8a0da10
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 414e415
##	Allow the caller to set the attributes
Chris PeBenito 414e415
##	of device nodes of tape devices.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 414e415
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 414e415
##	The type of the process performing this action.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 414e415
## </param>
Chris PeBenito 8a0da10
#
Chris PeBenito 1815bad
interface(`storage_setattr_tape_dev',`
Chris PeBenito d35c621
	gen_require(`
Chris PeBenito d35c621
		type tape_device_t;
Chris PeBenito d35c621
	')
Chris PeBenito 0c73cd2
Karl MacMillan f0c985c
	dev_list_all_dev_nodes($1)
Chris PeBenito a5ec7cb
	allow $1 tape_device_t:chr_file setattr;
Chris PeBenito 8a0da10
')
Chris PeBenito 8a0da10
Chris PeBenito 9726b31
########################################
Chris PeBenito 9726b31
## <summary>
Chris PeBenito 9726b31
##	Unconfined access to storage devices.
Chris PeBenito 9726b31
## </summary>
Chris PeBenito 9726b31
## <param name="domain">
Chris PeBenito 885b83e
##	<summary>
Chris PeBenito 9726b31
##	Domain allowed access.
Chris PeBenito 885b83e
##	</summary>
Chris PeBenito 9726b31
## </param>
Chris PeBenito 9726b31
#
Chris PeBenito 9726b31
interface(`storage_unconfined',`
Chris PeBenito 9726b31
	gen_require(`
Chris PeBenito b518fc2
		attribute storage_unconfined_type;
Chris PeBenito 9726b31
	')
Chris PeBenito 9726b31
Chris PeBenito b518fc2
	typeattribute $1 storage_unconfined_type;
Chris PeBenito 9726b31
')