2005-06-13 19:22:00 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Basic filesystem types and interfaces.
|
2005-06-13 19:22:00 +00:00
|
|
|
## </summary>
|
2005-06-23 16:00:05 +00:00
|
|
|
## <desc>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <p>
|
|
|
|
## This module contains basic filesystem types and interfaces. This
|
|
|
|
## includes:
|
|
|
|
## <ul>
|
|
|
|
## <li>The concept of different file types including basic
|
|
|
|
## files, mount points, tmp files, etc.</li>
|
|
|
|
## <li>Access to groups of files and all files.</li>
|
|
|
|
## <li>Types and interfaces for the basic filesystem layout
|
|
|
|
## (/, /etc, /tmp, /usr, etc.).</li>
|
|
|
|
## </ul>
|
|
|
|
## </p>
|
2005-06-23 16:00:05 +00:00
|
|
|
## </desc>
|
2005-07-05 17:47:15 +00:00
|
|
|
## <required val="true">
|
|
|
|
## Contains the concept of a file.
|
|
|
|
## Comains the file initial SID.
|
|
|
|
## </required>
|
2005-04-20 19:07:16 +00:00
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_type(type)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_type',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-08 13:12:00 +00:00
|
|
|
fs_associate($1)
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_associate_noxattr($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
typeattribute $1 file_type;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-12 20:50:09 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_lock_file(type)
|
2005-05-12 20:50:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_lock_file',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute lockfile;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
typeattribute $1 lockfile;
|
2005-05-12 20:50:09 +00:00
|
|
|
')
|
|
|
|
|
2005-05-11 19:21:40 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_mountpoint(type)
|
2005-05-11 19:21:40 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_mountpoint',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute mountpoint;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
typeattribute $1 mountpoint;
|
2005-05-11 19:21:40 +00:00
|
|
|
')
|
|
|
|
|
2005-04-28 21:41:09 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_pid_file(type)
|
2005-04-28 21:41:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_pid_file',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute pidfile;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
typeattribute $1 pidfile;
|
2005-04-28 21:41:09 +00:00
|
|
|
')
|
|
|
|
|
2005-05-11 19:36:36 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_tmp_file(type)
|
2005-05-11 19:36:36 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_tmp_file',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute tmpfile;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
typeattribute $1 tmpfile;
|
2005-05-11 19:36:36 +00:00
|
|
|
')
|
|
|
|
|
2005-05-23 15:49:31 +00:00
|
|
|
########################################
|
2005-07-08 20:44:57 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Transform the type into a file, for use on a
|
|
|
|
## virtual memory filesystem (tmpfs).
|
2005-07-08 20:44:57 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="type">
|
|
|
|
## The type to be transformed.
|
|
|
|
## </param>
|
2005-05-23 15:49:31 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_tmpfs_file',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute tmpfsfile;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type($1)
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_associate_tmpfs($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
typeattribute $1 tmpfsfile;
|
2005-05-23 15:49:31 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2005-07-15 15:17:57 +00:00
|
|
|
## <summary>
|
|
|
|
## Get the attributes of all directories.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-07-15 15:17:57 +00:00
|
|
|
interface(`files_getattr_all_dirs',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir { getattr search };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_type:dir { getattr search };
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the attributes
|
|
|
|
## of all directories.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_dontaudit_getattr_all_dirs',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 file_type:dir getattr;
|
|
|
|
')
|
2005-05-25 20:58:21 +00:00
|
|
|
|
2005-07-15 15:17:57 +00:00
|
|
|
########################################
|
2005-08-11 14:49:58 +00:00
|
|
|
## <summary>
|
|
|
|
## List the contents of all directories.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
2005-07-15 15:17:57 +00:00
|
|
|
#
|
2005-08-11 14:49:58 +00:00
|
|
|
interface(`files_list_all_dirs',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_type:dir r_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Get the attributes of all files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
2005-07-15 15:17:57 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_getattr_all_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
2005-07-15 15:17:57 +00:00
|
|
|
class dir search;
|
2005-06-22 16:07:14 +00:00
|
|
|
class file getattr;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-07-15 15:17:57 +00:00
|
|
|
allow $1 file_type:dir search;
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 file_type:file getattr;
|
2005-07-15 15:17:57 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the attributes
|
|
|
|
## of all files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_dontaudit_getattr_all_files',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 file_type:file getattr;
|
|
|
|
')
|
|
|
|
|
2005-08-11 14:49:58 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read all files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_all_files',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir search;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_type:dir search;
|
|
|
|
allow $1 file_type:file r_file_perms;
|
|
|
|
|
|
|
|
optional_policy(`authlogin.te',`
|
|
|
|
auth_read_shadow($1)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2005-07-15 15:17:57 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Get the attributes of all symbolic links.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_getattr_all_symlinks',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir search;
|
|
|
|
class lnk_file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_type:dir search;
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 file_type:lnk_file getattr;
|
2005-07-15 15:17:57 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the attributes
|
|
|
|
## of all symbolic links.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_dontaudit_getattr_all_symlinks',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class lnk_file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 file_type:lnk_file getattr;
|
|
|
|
')
|
|
|
|
|
2005-08-11 14:49:58 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read all symbolic links.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_all_symlinks',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir search;
|
|
|
|
class lnk_file { getattr read };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_type:dir search;
|
|
|
|
allow $1 file_type:lnk_file { getattr read };
|
|
|
|
')
|
|
|
|
|
2005-07-15 15:17:57 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Get the attributes of all named pipes.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_getattr_all_pipes',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir search;
|
|
|
|
class fifo_file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_type:dir search;
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 file_type:fifo_file getattr;
|
2005-07-15 15:17:57 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the attributes
|
|
|
|
## of all named pipes.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_dontaudit_getattr_all_pipes',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class fifo_file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 file_type:fifo_file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Get the attributes of all named sockets.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_getattr_all_sockets',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir search;
|
|
|
|
class sock_file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_type:dir search;
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 file_type:sock_file getattr;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-07-15 15:17:57 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the attributes
|
|
|
|
## of all named sockets.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_dontaudit_getattr_all_sockets',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class sock_file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 file_type:sock_file getattr;
|
|
|
|
')
|
|
|
|
|
2005-04-28 18:59:01 +00:00
|
|
|
########################################
|
2005-07-08 20:44:57 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Relabel all files on the filesystem, except
|
|
|
|
## the listed exceptions.
|
2005-07-08 20:44:57 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the domain perfoming this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="exception_types" optional="true">
|
|
|
|
## The types to be excluded. Each type or attribute
|
|
|
|
## must be negated by the caller.
|
|
|
|
## </param>
|
2005-04-28 18:59:01 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_relabel_all_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir { r_dir_perms relabelfrom relabelto };
|
|
|
|
class file { relabelfrom relabelto };
|
|
|
|
class lnk_file { relabelfrom relabelto };
|
|
|
|
class fifo_file { relabelfrom relabelto };
|
|
|
|
class sock_file { relabelfrom relabelto };
|
|
|
|
class blk_file relabelfrom;
|
|
|
|
class chr_file relabelfrom;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 { file_type $2 }:dir { r_dir_perms relabelfrom relabelto };
|
|
|
|
allow $1 { file_type $2 }:file { getattr relabelfrom relabelto };
|
|
|
|
allow $1 { file_type $2 }:lnk_file { getattr relabelfrom relabelto };
|
|
|
|
allow $1 { file_type $2 }:fifo_file { getattr relabelfrom relabelto };
|
|
|
|
allow $1 { file_type $2 }:sock_file { getattr relabelfrom relabelto };
|
|
|
|
allow $1 { file_type $2 }:blk_file { getattr relabelfrom };
|
|
|
|
allow $1 { file_type $2 }:chr_file { getattr relabelfrom };
|
|
|
|
|
|
|
|
# satisfy the assertions:
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_relabelto_binary_pol($1)
|
2005-05-25 20:58:21 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-08 20:44:57 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Manage all files on the filesystem, except
|
|
|
|
## the listed exceptions.
|
2005-07-08 20:44:57 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the domain perfoming this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="exception_types" optional="true">
|
|
|
|
## The types to be excluded. Each type or attribute
|
|
|
|
## must be negated by the caller.
|
|
|
|
## </param>
|
2005-05-25 20:58:21 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_manage_all_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir create_dir_perms;
|
|
|
|
class file create_file_perms;
|
|
|
|
class lnk_file create_lnk_perms;
|
|
|
|
class fifo_file create_file_perms;
|
|
|
|
class sock_file create_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 { file_type $2 }:dir create_dir_perms;
|
|
|
|
allow $1 { file_type $2 }:file create_file_perms;
|
|
|
|
allow $1 { file_type $2 }:lnk_file create_lnk_perms;
|
|
|
|
allow $1 { file_type $2 }:fifo_file create_file_perms;
|
|
|
|
allow $1 { file_type $2 }:sock_file create_file_perms;
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
# satisfy the assertions:
|
2005-06-17 17:59:26 +00:00
|
|
|
seutil_create_binary_pol($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
bootloader_manage_kernel_modules($1)
|
2005-05-25 20:58:21 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2005-04-26 21:12:32 +00:00
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_search_all_dirs(domain)
|
2005-04-26 21:12:32 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_search_all_dirs',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir search;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 file_type:dir search;
|
2005-04-26 21:12:32 +00:00
|
|
|
')
|
|
|
|
|
2005-05-11 19:05:15 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_list_all_dirs(domain)
|
2005-05-11 19:05:15 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_list_all_dirs',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 file_type:dir r_dir_perms;
|
2005-05-11 19:05:15 +00:00
|
|
|
')
|
|
|
|
|
2005-05-02 18:40:42 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_dontaudit_search_all_dirs(domain)
|
2005-05-02 18:40:42 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_dontaudit_search_all_dirs',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class dir search;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 file_type:dir search;
|
2005-05-02 18:40:42 +00:00
|
|
|
')
|
|
|
|
|
2005-05-24 15:55:57 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-06-08 13:12:00 +00:00
|
|
|
# files_relabelto_all_file_type_fs(domain)
|
2005-05-24 15:55:57 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_relabelto_all_file_type_fs',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
filesystem relabelto;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 file_type:filesystem relabelto;
|
2005-05-24 15:55:57 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
#
|
2005-06-08 13:12:00 +00:00
|
|
|
# files_mount_all_file_type_fs(domain)
|
2005-05-24 15:55:57 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_mount_all_file_type_fs',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
filesystem mount;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 file_type:filesystem mount;
|
2005-05-24 15:55:57 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
#
|
2005-06-08 13:12:00 +00:00
|
|
|
# files_unmount_all_file_type_fs(domain)
|
2005-05-24 15:55:57 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_unmount_all_file_type_fs',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
filesystem mount;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 file_type:filesystem mount;
|
2005-05-24 15:55:57 +00:00
|
|
|
')
|
|
|
|
|
2005-04-28 21:41:09 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_mounton_all_mountpoints(domain)
|
2005-04-28 21:41:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_mounton_all_mountpoints',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute mountpoint;
|
|
|
|
class dir { getattr search mounton };
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 mountpoint:dir { getattr search mounton };
|
2005-04-28 21:41:09 +00:00
|
|
|
')
|
|
|
|
|
2005-04-28 18:59:01 +00:00
|
|
|
########################################
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_list_root(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_list_root',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type root_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 root_t:dir r_dir_perms;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 root_t:lnk_file r_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-08 20:44:57 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Create an object in the root directory, with a private
|
|
|
|
## type. If no object class is specified, the
|
|
|
|
## default is file.
|
2005-07-08 20:44:57 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="private type" optional="true">
|
|
|
|
## The type of the object to be created. If no type
|
|
|
|
## is specified, the type of the root directory will
|
|
|
|
## be used.
|
|
|
|
## </param>
|
|
|
|
## <param name="object" optional="true">
|
|
|
|
## The object class of the object being created. If
|
|
|
|
## no class is specified, file will be used.
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_create_root',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type root_t;
|
|
|
|
class dir create_dir_perms;
|
|
|
|
class file create_file_perms;
|
|
|
|
class lnk_file create_lnk_perms;
|
|
|
|
class fifo_file create_file_perms;
|
|
|
|
class sock_file create_file_perms;
|
|
|
|
class blk_file create_file_perms;
|
|
|
|
class chr_file create_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
allow $1 root_t:dir rw_dir_perms;
|
|
|
|
|
|
|
|
ifelse(`$3',`',`
|
|
|
|
ifelse(`$2',`',`
|
|
|
|
allow $1 root_t:file create_file_perms;
|
|
|
|
',`
|
|
|
|
type_transition $1 root_t:file $2;
|
|
|
|
')
|
|
|
|
',`
|
|
|
|
ifelse(`$2',`',`
|
|
|
|
allow $1 root_t:$3 create_file_perms;
|
|
|
|
',`
|
|
|
|
type_transition $1 root_t:$3 $2;
|
|
|
|
')
|
|
|
|
')
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-02 18:40:42 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_dontaudit_read_root_file(domain)
|
2005-05-02 18:40:42 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_dontaudit_read_root_file',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type root_t;
|
|
|
|
class file read;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 root_t:file read;
|
2005-05-02 18:40:42 +00:00
|
|
|
')
|
|
|
|
|
2005-04-19 18:57:13 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_dontaudit_rw_root_file(domain)
|
2005-04-19 18:57:13 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_dontaudit_rw_root_file',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type root_t;
|
|
|
|
class file { read write };
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 root_t:file { read write };
|
2005-04-19 18:57:13 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_dontaudit_rw_root_chr_dev(domain)
|
2005-04-19 18:57:13 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_dontaudit_rw_root_chr_dev',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type root_t;
|
|
|
|
class chr_file { read write };
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 root_t:chr_file { read write };
|
2005-04-19 18:57:13 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_delete_root_dir_entry(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_delete_root_dir_entry',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type root_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 root_t:dir rw_dir_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-04-28 21:41:09 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_unmount_rootfs(domain)
|
2005-04-28 21:41:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_unmount_rootfs',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type root_t;
|
|
|
|
class filesystem unmount;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 root_t:filesystem unmount;
|
2005-04-28 21:41:09 +00:00
|
|
|
')
|
|
|
|
|
2005-07-14 18:15:47 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the attributes of
|
|
|
|
## directories with the default file type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_dontaudit_getattr_default_dir',`
|
|
|
|
gen_require(`
|
|
|
|
type default_t;
|
|
|
|
class dir getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 default_t:dir getattr;
|
|
|
|
')
|
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## List contents of directories with the default file type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_list_default',`
|
|
|
|
gen_require(`
|
|
|
|
type default_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 default_t:dir r_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Mount a filesystem on a directory with the default file type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_mounton_default',`
|
|
|
|
gen_require(`
|
|
|
|
type default_t;
|
|
|
|
class dir { getattr search mounton };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 default_t:dir { getattr search mounton };
|
|
|
|
')
|
|
|
|
|
2005-07-14 18:15:47 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the attributes of
|
|
|
|
## files with the default file type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_dontaudit_getattr_default_files',`
|
|
|
|
gen_require(`
|
|
|
|
type default_t;
|
|
|
|
class files getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 default_t:file getattr;
|
|
|
|
')
|
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read files with the default file type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_default_files',`
|
|
|
|
gen_require(`
|
|
|
|
type default_t;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 default_t:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read symbolic links with the default file type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_default_symlinks',`
|
|
|
|
gen_require(`
|
|
|
|
type default_t;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 default_t:lnk_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read sockets with the default file type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_default_sockets',`
|
|
|
|
gen_require(`
|
|
|
|
type default_t;
|
|
|
|
class sock_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 default_t:sock_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read named pipes with the default file type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_default_pipes',`
|
|
|
|
gen_require(`
|
|
|
|
type default_t;
|
|
|
|
class fifo_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 default_t:fifo_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
2005-05-11 16:48:10 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_search_etc(domain)
|
2005-05-11 16:48:10 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_search_etc',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type etc_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 etc_t:dir search;
|
2005-05-11 16:48:10 +00:00
|
|
|
')
|
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Set the attributes of the /etc directories.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_setattr_etc_dir',`
|
|
|
|
gen_require(`
|
|
|
|
type etc_t;
|
|
|
|
class dir setattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 etc_t:dir setattr;
|
|
|
|
')
|
|
|
|
|
2005-05-11 16:48:10 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-17 17:59:26 +00:00
|
|
|
# files_list_etc(domain)
|
2005-05-11 16:48:10 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_list_etc',`
|
2005-06-17 17:59:26 +00:00
|
|
|
gen_require(`
|
|
|
|
type etc_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 etc_t:dir r_dir_perms;
|
2005-05-11 16:48:10 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2005-06-09 17:23:53 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_read_etc_files(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_read_etc_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type etc_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file r_file_perms;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 etc_t:dir r_dir_perms;
|
|
|
|
allow $1 etc_t:file r_file_perms;
|
|
|
|
allow $1 etc_t:lnk_file r_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_rw_etc_files(domain)
|
2005-05-04 19:15:13 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_rw_etc_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type etc_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file rw_file_perms;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 etc_t:dir r_dir_perms;
|
|
|
|
allow $1 etc_t:file rw_file_perms;
|
|
|
|
allow $1 etc_t:lnk_file r_file_perms;
|
2005-05-04 19:15:13 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_manage_etc_files(domain)
|
2005-05-04 19:15:13 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_manage_etc_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type etc_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class file create_file_perms;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 etc_t:dir rw_dir_perms;
|
|
|
|
allow $1 etc_t:file create_file_perms;
|
|
|
|
allow $1 etc_t:lnk_file r_file_perms;
|
2005-05-04 19:15:13 +00:00
|
|
|
')
|
|
|
|
|
2005-05-23 15:49:31 +00:00
|
|
|
########################################
|
2005-07-08 20:44:57 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Delete system configuration files in /etc.
|
2005-07-08 20:44:57 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-23 15:49:31 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_delete_etc_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type etc_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class file unlink;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 etc_t:dir rw_dir_perms;
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 etc_t:file unlink;
|
2005-05-23 15:49:31 +00:00
|
|
|
')
|
|
|
|
|
2005-05-04 19:15:13 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_exec_etc_files(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_exec_etc_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type etc_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 etc_t:dir r_dir_perms;
|
|
|
|
allow $1 etc_t:lnk_file r_file_perms;
|
|
|
|
can_exec($1,etc_t)
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-03 12:25:14 +00:00
|
|
|
# files_create_boot_flag(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
|
|
|
# /halt, /.autofsck, etc
|
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_create_boot_flag',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type root_t, etc_runtime_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class file { create read write setattr unlink};
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 root_t:dir rw_dir_perms;
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 etc_runtime_t:file { create read write setattr unlink };
|
|
|
|
type_transition $1 root_t:file etc_runtime_t;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_manage_etc_runtime_files(type)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_manage_etc_runtime_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type etc_t, etc_runtime_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class file create_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 etc_t:dir rw_dir_perms;
|
|
|
|
allow $1 etc_runtime_t:file create_file_perms;
|
2005-06-03 12:25:14 +00:00
|
|
|
type_transition $1 etc_t:file etc_runtime_t;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_read_etc_runtime_files(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_read_etc_runtime_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type etc_t, etc_runtime_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 etc_t:dir r_dir_perms;
|
|
|
|
allow $1 etc_runtime_t:file r_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_create_etc_config(domain,privatetype,[class(es)])
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_create_etc_config',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type etc_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 etc_t:dir rw_dir_perms;
|
|
|
|
ifelse(`$3',`',`
|
|
|
|
type_transition $1 etc_t:file $2;
|
|
|
|
',`
|
|
|
|
type_transition $1 etc_t:$3 $2;
|
|
|
|
')
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-06-01 13:51:54 +00:00
|
|
|
########################################
|
2005-06-27 20:59:28 +00:00
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to search directories on new filesystems
|
|
|
|
## that have not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-06-01 13:51:54 +00:00
|
|
|
#
|
2005-06-27 20:59:28 +00:00
|
|
|
interface(`files_dontaudit_search_isid_type_dir',`
|
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 file_t:dir search;
|
|
|
|
')
|
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## List the contents of directories on new filesystems
|
|
|
|
## that have not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_list_isid_type_dir',`
|
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_t:dir r_dir_perms;
|
|
|
|
')
|
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read and write directories on new filesystems
|
|
|
|
## that have not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-06-01 13:51:54 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_rw_isid_type_dir',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 file_t:dir rw_dir_perms;
|
2005-06-01 13:51:54 +00:00
|
|
|
')
|
|
|
|
|
2005-05-31 21:25:45 +00:00
|
|
|
########################################
|
2005-06-27 20:59:28 +00:00
|
|
|
## <summary>
|
|
|
|
## Create, read, write, and delete directories
|
|
|
|
## on new filesystems that have not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-31 21:25:45 +00:00
|
|
|
#
|
2005-06-27 20:59:28 +00:00
|
|
|
interface(`files_manage_isid_type_dir',`
|
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
|
|
|
class dir create_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_t:dir create_dir_perms;
|
|
|
|
')
|
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Mount a filesystem on a directory on new filesystems
|
|
|
|
## that has not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_mounton_isid_type_dir',`
|
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
|
|
|
class dir { getattr search mounton };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_t:dir { getattr search mounton };
|
|
|
|
')
|
|
|
|
|
2005-07-11 19:02:50 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read files on new filesystems
|
|
|
|
## that have not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_isid_type_file',`
|
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
|
|
|
class dir search;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_t:dir search;
|
|
|
|
allow $1 file_t:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create, read, write, and delete files
|
|
|
|
## on new filesystems that have not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-31 21:25:45 +00:00
|
|
|
#
|
2005-06-27 20:59:28 +00:00
|
|
|
interface(`files_manage_isid_type_file',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
2005-06-27 20:59:28 +00:00
|
|
|
class dir rw_dir_perms;
|
|
|
|
class file create_file_perms;
|
2005-06-22 16:07:14 +00:00
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
allow $1 file_t:dir rw_dir_perms;
|
|
|
|
allow $1 file_t:file create_file_perms;
|
2005-05-31 21:25:45 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-06-27 20:59:28 +00:00
|
|
|
## <summary>
|
|
|
|
## Create, read, write, and delete symbolic links
|
|
|
|
## on new filesystems that have not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-31 21:25:45 +00:00
|
|
|
#
|
2005-06-27 20:59:28 +00:00
|
|
|
interface(`files_manage_isid_type_symlink',`
|
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class lnk_file create_lnk_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_t:dir rw_dir_perms;
|
|
|
|
allow $1 file_t:lnk_file create_lnk_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read and write block device nodes on new filesystems
|
|
|
|
## that have not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-31 21:25:45 +00:00
|
|
|
#
|
2005-06-27 20:59:28 +00:00
|
|
|
interface(`files_rw_isid_type_blk_node',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
|
|
|
class dir search;
|
2005-06-27 20:59:28 +00:00
|
|
|
class blk_file rw_file_perms;
|
2005-06-22 16:07:14 +00:00
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
allow $1 file_t:dir search;
|
|
|
|
allow $1 file_t:blk_file rw_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create, read, write, and delete block device nodes
|
|
|
|
## on new filesystems that have not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_manage_isid_type_blk_node',`
|
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class blk_file create_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_t:dir rw_dir_perms;
|
|
|
|
allow $1 file_t:blk_file create_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create, read, write, and delete character device nodes
|
|
|
|
## on new filesystems that have not yet been labeled.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_manage_isid_type_chr_node',`
|
|
|
|
gen_require(`
|
|
|
|
type file_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class chr_file create_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 file_t:dir rw_dir_perms;
|
|
|
|
allow $1 file_t:chr_file create_file_perms;
|
2005-05-31 21:25:45 +00:00
|
|
|
')
|
|
|
|
|
2005-06-30 18:54:08 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2005-08-08 15:51:15 +00:00
|
|
|
## Search home directories root.
|
2005-06-30 18:54:08 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_search_home',`
|
|
|
|
gen_require(`
|
|
|
|
type home_root_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 home_root_t:dir search;
|
|
|
|
')
|
|
|
|
|
2005-08-08 15:51:15 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to search home directories root.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_dontaudit_search_home',`
|
|
|
|
gen_require(`
|
|
|
|
type home_root_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 home_root_t:dir search;
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
2005-06-28 17:48:59 +00:00
|
|
|
## <summary>
|
|
|
|
## Get listing of home directories.
|
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_list_home',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type home_root_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 home_root_t:dir r_dir_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-07-06 20:28:29 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create home directories
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="home_type">
|
|
|
|
## The type of the home directory
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_create_home_dirs',`
|
|
|
|
gen_require(`
|
|
|
|
type home_root_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 home_root_t:dir rw_dir_perms;
|
|
|
|
type_transition $1 home_root_t:dir $2;
|
|
|
|
')
|
|
|
|
|
2005-06-28 17:48:59 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create, read, write, and delete objects in
|
|
|
|
## lost+found directories.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_manage_lost_found',`
|
|
|
|
gen_require(`
|
|
|
|
type lost_found_t;
|
|
|
|
class dir create_dir_perms;
|
|
|
|
class file create_file_perms;
|
|
|
|
class sock_file create_file_perms;
|
|
|
|
class fifo_file create_file_perms;
|
|
|
|
class lnk_file create_lnk_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 lost_found_t:dir create_dir_perms;
|
|
|
|
allow $1 lost_found_t:file create_file_perms;
|
|
|
|
allow $1 lost_found_t:sock_file create_file_perms;
|
|
|
|
allow $1 lost_found_t:fifo_file create_file_perms;
|
|
|
|
allow $1 lost_found_t:lnk_file create_lnk_perms;
|
|
|
|
')
|
|
|
|
|
2005-05-26 20:38:45 +00:00
|
|
|
########################################
|
2005-06-27 18:37:33 +00:00
|
|
|
#
|
|
|
|
# files_search_mnt(domain)
|
|
|
|
#
|
|
|
|
interface(`files_search_mnt',`
|
|
|
|
gen_require(`
|
|
|
|
type mnt_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 mnt_t:dir search;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-05-26 20:38:45 +00:00
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_list_mnt(domain)
|
2005-05-26 20:38:45 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_list_mnt',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type mnt_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 mnt_t:dir r_dir_perms;
|
2005-05-26 20:38:45 +00:00
|
|
|
')
|
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create, read, write, and delete directories in /mnt.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_manage_mnt_dirs',`
|
|
|
|
gen_require(`
|
|
|
|
type mnt_t;
|
|
|
|
class dir create_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 mnt_t:dir create_dir_perms;
|
|
|
|
')
|
|
|
|
|
2005-08-08 15:51:15 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create, read, write, and delete files in /mnt.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_manage_mnt_files',`
|
|
|
|
gen_require(`
|
|
|
|
type mnt_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class file create_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 mnt_t:dir rw_dir_perms;
|
|
|
|
allow $1 mnt_t:file create_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create, read, write, and delete symbolic links in /mnt.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_manage_mnt_symlinks',`
|
|
|
|
gen_require(`
|
|
|
|
type mnt_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class lnk_file create_lnk_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 mnt_t:dir rw_dir_perms;
|
|
|
|
allow $1 mnt_t:lnk_file create_lnk_perms;
|
|
|
|
')
|
|
|
|
|
2005-07-11 19:02:50 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## List world-readable directories.
|
|
|
|
## </summary>
|
2005-07-11 19:15:54 +00:00
|
|
|
## <param name="domain">
|
2005-07-11 19:02:50 +00:00
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_list_world_readable',`
|
|
|
|
gen_require(`
|
|
|
|
type readable_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 readable_t:dir r_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read world-readable files.
|
|
|
|
## </summary>
|
2005-07-11 19:15:54 +00:00
|
|
|
## <param name="domain">
|
2005-07-11 19:02:50 +00:00
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_world_readable_files',`
|
|
|
|
gen_require(`
|
|
|
|
type readable_t;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 readable_t:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read world-readable symbolic links.
|
|
|
|
## </summary>
|
2005-07-11 19:15:54 +00:00
|
|
|
## <param name="domain">
|
2005-07-11 19:02:50 +00:00
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_world_readable_symlinks',`
|
|
|
|
gen_require(`
|
|
|
|
type readable_t;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 readable_t:lnk_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read world-readable named pipes.
|
|
|
|
## </summary>
|
2005-07-11 19:15:54 +00:00
|
|
|
## <param name="domain">
|
2005-07-11 19:02:50 +00:00
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_world_readable_pipes',`
|
|
|
|
gen_require(`
|
|
|
|
type readable_t;
|
|
|
|
class fifo_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 readable_t:fifo_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read world-readable sockets.
|
|
|
|
## </summary>
|
2005-07-11 19:15:54 +00:00
|
|
|
## <param name="domain">
|
2005-07-11 19:02:50 +00:00
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_world_readable_sockets',`
|
|
|
|
gen_require(`
|
|
|
|
type readable_t;
|
|
|
|
class sock_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 readable_t:sock_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
2005-06-29 20:53:53 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2005-08-05 15:32:27 +00:00
|
|
|
## Search the tmp directory (/tmp).
|
2005-06-29 20:53:53 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_search_tmp',`
|
|
|
|
gen_require(`
|
|
|
|
type tmp_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 tmp_t:dir search;
|
|
|
|
')
|
|
|
|
|
2005-08-05 15:32:27 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Set the attributes of all tmp directories.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_setattr_all_tmp_dirs',`
|
|
|
|
gen_require(`
|
|
|
|
attribute tmpfile;
|
|
|
|
class dir { search setattr };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 tmpfile:dir { search getattr };
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_create_tmp_files(domain,private_type,[object class(es)])
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_create_tmp_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type tmp_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 tmp_t:dir rw_dir_perms;
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
ifelse(`$3',`',`
|
|
|
|
type_transition $1 tmp_t:file $2;
|
|
|
|
',`
|
|
|
|
type_transition $1 tmp_t:$3 $2;
|
|
|
|
')
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-08-05 15:32:27 +00:00
|
|
|
# files_purge_tmp(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-08-05 15:32:27 +00:00
|
|
|
interface(`files_purge_tmp',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute tmpfile;
|
2005-08-05 15:32:27 +00:00
|
|
|
class dir { rw_dir_perms rmdir };
|
|
|
|
gen_require_set({ getattr unlink },notdevfile_class_set)
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 tmpfile:dir { rw_dir_perms rmdir };
|
|
|
|
allow $1 tmpfile:notdevfile_class_set { getattr unlink };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-25 20:58:21 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_search_usr(domain)
|
2005-05-25 20:58:21 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_search_usr',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type usr_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 usr_t:dir search;
|
2005-05-25 20:58:21 +00:00
|
|
|
')
|
|
|
|
|
2005-08-09 19:30:43 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Get the attributes of files in /usr.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_getattr_usr_files',`
|
|
|
|
gen_require(`
|
|
|
|
type usr_t;
|
|
|
|
class dir search;
|
|
|
|
class file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 usr_t:dir search;
|
|
|
|
allow $1 usr_t:file getattr;
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_read_usr_files(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_read_usr_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type usr_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file r_file_perms;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 usr_t:dir r_dir_perms;
|
|
|
|
allow $1 usr_t:{ file lnk_file } r_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-08-09 19:30:43 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read symbolic links in /usr.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_usr_symlinks',`
|
|
|
|
gen_require(`
|
|
|
|
type usr_t;
|
|
|
|
class dir search;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 usr_t:dir search;
|
|
|
|
allow $1 usr_t:lnk_file r_file_perms;
|
|
|
|
')
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
########################################
|
2005-07-08 20:44:57 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute programs in /usr/src in the caller domain.
|
2005-07-08 20:44:57 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-19 21:06:06 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_exec_usr_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type usr_t, src_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 usr_t:dir search;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 src_t:dir r_dir_perms;
|
|
|
|
allow $1 src_t:lnk_file r_file_perms;
|
|
|
|
can_exec($1,src_t)
|
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_read_usr_src_files(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_read_usr_src_files',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type usr_t, src_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file r_file_perms;
|
|
|
|
class lnk_file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 usr_t:dir search;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 src_t:dir r_dir_perms;
|
|
|
|
allow $1 src_t:{ file lnk_file } r_file_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_search_var(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_search_var',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-05 17:44:11 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_dontaudit_search_var(domain)
|
2005-05-05 17:44:11 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_dontaudit_search_var',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 var_t:dir search;
|
2005-05-05 17:44:11 +00:00
|
|
|
')
|
|
|
|
|
2005-06-27 20:59:28 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read files in the /var directory.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_read_var_files',`
|
2005-06-27 20:59:28 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t;
|
|
|
|
class dir search;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 var_t:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
2005-07-11 19:02:50 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read symbolic links in the /var directory.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_var_symlink',`
|
|
|
|
gen_require(`
|
|
|
|
type var_t;
|
|
|
|
class dir search;
|
|
|
|
class lnk_file { getattr read };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 var_t:lnk_file { getattr read };
|
|
|
|
')
|
|
|
|
|
2005-07-12 20:34:24 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Get the attributes of the /var/lib directory.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_getattr_var_lib_dir',`
|
|
|
|
gen_require(`
|
|
|
|
type var_t, var_lib_t;
|
|
|
|
class dir getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 var_lib_t:dir getattr;
|
|
|
|
')
|
|
|
|
|
2005-06-20 17:41:29 +00:00
|
|
|
########################################
|
2005-07-08 20:44:57 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Search the /var/lib directory.
|
2005-07-08 20:44:57 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-06-20 17:41:29 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_search_var_lib',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_lib_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 { var_t var_lib_t }:dir search;
|
|
|
|
')
|
|
|
|
|
2005-07-15 19:18:55 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Create objects in the /var/lib directory
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
## <param name="file_type">
|
|
|
|
## The type of the object to be created
|
|
|
|
## </param>
|
|
|
|
## <param name="object_class" optional="true">
|
|
|
|
## The object class. If not specified, file is used.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_create_var_lib',`
|
|
|
|
gen_require(`
|
|
|
|
type var_t, var_lib_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 var_lib_t:dir rw_dir_perms;
|
|
|
|
|
|
|
|
ifelse(`$3',`',`
|
|
|
|
type_transition $1 var_lib_t:file $2;
|
|
|
|
',`
|
|
|
|
type_transition $1 var_lib_t:$3 $2;
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read generic files in /var/lib
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_read_var_lib_files',`
|
|
|
|
gen_require(`
|
|
|
|
type var_t, var_lib_t;
|
|
|
|
class dir search;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 { var_t var_lib_t }:dir search;
|
|
|
|
allow $1 var_lib_t:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_manage_urandom_seed(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_manage_urandom_seed',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_lib_t;
|
|
|
|
class dir rw_file_perms;
|
|
|
|
class file { getattr create read write setattr unlink };
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
2005-06-10 01:01:13 +00:00
|
|
|
allow $1 var_lib_t:dir rw_dir_perms;
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 var_lib_t:file { getattr create read write setattr unlink };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-06-29 20:53:53 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-07-11 19:02:50 +00:00
|
|
|
# files_search_locks(domain)
|
2005-06-29 20:53:53 +00:00
|
|
|
#
|
2005-07-11 19:02:50 +00:00
|
|
|
interface(`files_search_locks',`
|
2005-06-29 20:53:53 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t;
|
|
|
|
type var_lock_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 { var_t var_lock_t }:dir search;
|
|
|
|
')
|
|
|
|
|
2005-07-11 19:02:50 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to search the
|
|
|
|
## locks directory (/var/lock).
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_dontaudit_search_locks',`
|
|
|
|
gen_require(`
|
|
|
|
type var_lock_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 var_lock_t:dir search;
|
|
|
|
')
|
|
|
|
|
2005-05-24 15:55:57 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_getattr_generic_locks(domain)
|
2005-05-24 15:55:57 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_getattr_generic_locks',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
2005-06-29 20:53:53 +00:00
|
|
|
type var_t;
|
2005-06-22 16:07:14 +00:00
|
|
|
type var_lock_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file getattr;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-29 20:53:53 +00:00
|
|
|
allow $1 var_t:dir search;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 var_lock_t:dir r_dir_perms;
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 var_lock_t:file getattr;
|
2005-05-24 15:55:57 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_manage_generic_locks(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_manage_generic_locks',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_lock_t;
|
|
|
|
class dir { getattr search create read write setattr add_name remove_name rmdir };
|
|
|
|
class file { getattr create read write setattr unlink };
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_lock_t:dir { getattr search create read write setattr add_name remove_name rmdir };
|
|
|
|
allow $1 var_lock_t:file { getattr create read write setattr unlink };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_delete_all_locks(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_delete_all_locks',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute lockfile;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class file { getattr unlink };
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
allow $1 lockfile:dir rw_dir_perms;
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 lockfile:file { getattr unlink };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-12 20:50:09 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_create_lock(domain,private_type,[object class(es)])
|
2005-05-12 20:50:09 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_create_lock',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_lock_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 var_lock_t:dir rw_dir_perms;
|
|
|
|
|
|
|
|
ifelse(`$3',`',`
|
|
|
|
type_transition $1 var_lock_t:file $2;
|
|
|
|
',`
|
|
|
|
type_transition $1 var_lock_t:$3 $2;
|
|
|
|
')
|
2005-05-12 20:50:09 +00:00
|
|
|
')
|
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the attributes
|
|
|
|
## of the /var/run directory.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_dontaudit_getattr_pid_dir',`
|
|
|
|
gen_require(`
|
|
|
|
type var_run_t;
|
|
|
|
class dir getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 var_run_t:dir getattr;
|
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_search_pids(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_search_pids',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_run_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 var_run_t:dir search;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-12 20:50:09 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_dontaudit_search_pids(domain)
|
2005-05-12 20:50:09 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_dontaudit_search_pids',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_run_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_run_t:dir search;
|
2005-05-12 20:50:09 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_list_pids(domain)
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_list_pids',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_run_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 var_run_t:dir r_dir_perms;
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-04-25 16:11:21 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_create_pid(domain,pidfile,[object class(es)])
|
2005-04-25 16:11:21 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_create_pid',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_run_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 var_run_t:dir rw_dir_perms;
|
|
|
|
|
|
|
|
ifelse(`$3',`',`
|
|
|
|
type_transition $1 var_run_t:file $2;
|
|
|
|
',`
|
|
|
|
type_transition $1 var_run_t:$3 $2;
|
|
|
|
')
|
2005-04-25 16:11:21 +00:00
|
|
|
')
|
|
|
|
|
2005-05-03 20:23:33 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_rw_generic_pids(domain)
|
2005-05-03 20:23:33 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_rw_generic_pids',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_run_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 var_run_t:dir r_dir_perms;
|
|
|
|
allow $1 var_run_t:file rw_file_perms;
|
2005-05-03 20:23:33 +00:00
|
|
|
')
|
|
|
|
|
2005-05-24 15:55:57 +00:00
|
|
|
########################################
|
2005-07-08 20:44:57 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Do not audit attempts to write to daemon runtime data files.
|
2005-07-08 20:44:57 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-24 15:55:57 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_dontaudit_write_all_pids',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute pidfile;
|
|
|
|
class file write;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 pidfile:file write;
|
2005-05-24 15:55:57 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-07-08 20:44:57 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Do not audit attempts to ioctl daemon runtime data files.
|
2005-07-08 20:44:57 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-24 15:55:57 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_dontaudit_ioctl_all_pids',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute pidfile;
|
|
|
|
class file ioctl;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 pidfile:file ioctl;
|
2005-05-24 15:55:57 +00:00
|
|
|
')
|
|
|
|
|
2005-05-31 23:02:11 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_read_all_pids(domain)
|
2005-05-31 23:02:11 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_read_all_pids',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute pidfile;
|
|
|
|
type var_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 pidfile:dir r_dir_perms;
|
|
|
|
allow $1 pidfile:file r_file_perms;
|
2005-05-31 23:02:11 +00:00
|
|
|
')
|
|
|
|
|
2005-05-03 20:23:33 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_delete_all_pids(domain)
|
2005-05-03 20:23:33 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_delete_all_pids',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute pidfile;
|
|
|
|
type var_t, var_run_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class file { getattr unlink };
|
|
|
|
class lnk_file { getattr unlink };
|
|
|
|
class sock_file { getattr unlink };
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 var_run_t:{ sock_file lnk_file } { getattr unlink };
|
|
|
|
allow $1 var_run_t:dir rmdir;
|
|
|
|
allow $1 pidfile:dir rw_dir_perms;
|
|
|
|
allow $1 pidfile:file { getattr unlink };
|
|
|
|
allow $1 pidfile:sock_file { getattr unlink };
|
2005-05-03 20:23:33 +00:00
|
|
|
')
|
2005-04-25 16:11:21 +00:00
|
|
|
|
2005-05-13 14:37:13 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_search_spool(domain)
|
2005-05-13 14:37:13 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_search_spool',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_spool_t;
|
|
|
|
class dir search;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 var_spool_t:dir search;
|
2005-05-13 14:37:13 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# files_list_spool(domain)
|
2005-05-13 14:37:13 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`files_list_spool',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_spool_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 var_spool_t:dir r_dir_perms;
|
2005-05-13 14:37:13 +00:00
|
|
|
')
|
|
|
|
|
2005-06-28 20:54:49 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_manage_generic_spool_dirs(domain)
|
2005-06-28 20:54:49 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_manage_generic_spool_dirs',`
|
2005-06-28 20:54:49 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_spool_t;
|
|
|
|
class dir create_dir_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
|
|
|
allow $1 var_spool_t:dir create_dir_perms;
|
|
|
|
')
|
|
|
|
|
2005-05-25 20:58:21 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_read_generic_spools(domain)
|
2005-05-25 20:58:21 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_read_generic_spools',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_spool_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 var_spool_t:dir r_dir_perms;
|
|
|
|
allow $1 var_spool_t:file r_file_perms;
|
2005-05-25 20:58:21 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
# files_manage_generic_spools(domain)
|
2005-05-25 20:58:21 +00:00
|
|
|
#
|
2005-06-29 14:26:41 +00:00
|
|
|
interface(`files_manage_generic_spools',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_t, var_spool_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class file create_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 var_t:dir search;
|
2005-06-10 01:01:13 +00:00
|
|
|
allow $1 var_spool_t:dir rw_dir_perms;
|
|
|
|
allow $1 var_spool_t:file create_file_perms;
|
2005-05-25 20:58:21 +00:00
|
|
|
')
|
2005-07-05 20:59:51 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Unconfined access to files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`files_unconfined',`
|
|
|
|
gen_require(`
|
|
|
|
attribute file_type;
|
|
|
|
class unix_stream_socket name_bind;
|
|
|
|
class unix_dgram_socket name_bind;
|
|
|
|
')
|
|
|
|
|
|
|
|
# Create/access any file in a labeled filesystem;
|
|
|
|
allow $1 file_type:{ file chr_file } ~execmod;
|
|
|
|
allow $1 file_type:{ dir lnk_file sock_file fifo_file blk_file } *;
|
|
|
|
|
|
|
|
# Mount/unmount any filesystem with the context= option.
|
|
|
|
allow $1 file_type:filesystem *;
|
|
|
|
|
|
|
|
# Bind to any network address.
|
|
|
|
# cjp: need to check this, I dont think this has any effect.
|
|
|
|
allow $1 file_type:{ unix_stream_socket unix_dgram_socket } name_bind;
|
|
|
|
')
|