selinux-refpolicy/policy/modules/system/userdomain.if

4662 lines
102 KiB
Plaintext
Raw Normal View History

2005-05-18 21:00:30 +00:00
## <summary>Policy for user domains</summary>
#######################################
## <summary>
2006-09-06 22:07:25 +00:00
## The template containing the most basic rules common to all users.
## </summary>
## <desc>
## <p>
2006-09-06 22:07:25 +00:00
## The template containing the most basic rules common to all users.
## </p>
## <p>
2006-09-06 22:07:25 +00:00
## This template creates a user domain, types, and
## rules for the user's tty and pty.
## </p>
## </desc>
## <param name="userdomain_prefix">
## <summary>
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
## </param>
2006-09-06 22:07:25 +00:00
## <rolebase/>
#
2006-09-06 22:07:25 +00:00
template(`userdom_base_user_template',`
gen_require(`
attribute userdomain;
2008-11-05 16:10:46 +00:00
type user_devpts_t, user_tty_device_t;
class context contains;
role $1_r;
')
attribute $1_file_type;
type $1_t, userdomain;
2005-06-13 17:35:46 +00:00
domain_type($1_t)
corecmd_shell_entry_type($1_t)
2006-05-01 19:11:54 +00:00
corecmd_bin_entry_type($1_t)
domain_user_exemption_target($1_t)
2008-11-05 16:10:46 +00:00
ubac_constrained($1_t)
role $1_r types $1_t;
allow system_r $1_r;
2008-11-05 16:10:46 +00:00
term_user_pty($1_t, user_devpts_t)
2008-11-05 16:10:46 +00:00
term_user_tty($1_t, user_tty_device_t)
allow $1_t self:process { signal_perms getsched setsched share getpgid setpgid setcap getsession getattr };
allow $1_t self:fd use;
allow $1_t self:key manage_key_perms;
2006-12-12 20:08:08 +00:00
allow $1_t self:fifo_file rw_fifo_file_perms;
2006-04-24 14:52:01 +00:00
allow $1_t self:unix_dgram_socket { create_socket_perms sendto };
allow $1_t self:unix_stream_socket { create_stream_socket_perms connectto };
2005-06-09 18:08:26 +00:00
allow $1_t self:shm create_shm_perms;
allow $1_t self:sem create_sem_perms;
allow $1_t self:msgq create_msgq_perms;
allow $1_t self:msg { send receive };
allow $1_t self:context contains;
dontaudit $1_t self:socket create;
2008-11-05 16:10:46 +00:00
allow $1_t user_devpts_t:chr_file { setattr rw_chr_file_perms };
2008-11-13 18:44:23 +00:00
term_create_pty($1_t, user_devpts_t)
2008-11-05 16:10:46 +00:00
# avoid annoying messages on terminal hangup on role change
dontaudit $1_t user_devpts_t:chr_file ioctl;
2008-11-05 16:10:46 +00:00
allow $1_t user_tty_device_t:chr_file { setattr rw_chr_file_perms };
# avoid annoying messages on terminal hangup on role change
dontaudit $1_t user_tty_device_t:chr_file ioctl;
kernel_read_kernel_sysctls($1_t)
2005-11-29 15:49:18 +00:00
kernel_dontaudit_list_unlabeled($1_t)
kernel_dontaudit_getattr_unlabeled_files($1_t)
2005-11-29 15:49:18 +00:00
kernel_dontaudit_getattr_unlabeled_symlinks($1_t)
kernel_dontaudit_getattr_unlabeled_pipes($1_t)
kernel_dontaudit_getattr_unlabeled_sockets($1_t)
kernel_dontaudit_getattr_unlabeled_blk_files($1_t)
kernel_dontaudit_getattr_unlabeled_chr_files($1_t)
dev_dontaudit_getattr_all_blk_files($1_t)
dev_dontaudit_getattr_all_chr_files($1_t)
# for X session unlock
allow $1_t self:netlink_audit_socket { create_socket_perms nlmsg_relay };
# for KDE
allow $1_t self:netlink_kobject_uevent_socket connected_socket_perms;
2005-07-19 18:40:31 +00:00
# When the user domain runs ps, there will be a number of access
2008-12-03 19:16:20 +00:00
# denials when ps tries to search /proc. Do not audit these denials.
2005-07-19 18:40:31 +00:00
domain_dontaudit_read_all_domains_state($1_t)
2005-11-29 15:49:18 +00:00
domain_dontaudit_getattr_all_domains($1_t)
2005-07-19 18:40:31 +00:00
domain_dontaudit_getsession_all_domains($1_t)
2006-09-06 22:07:25 +00:00
files_read_etc_files($1_t)
files_watch_etc_dirs($1_t)
2006-09-06 22:07:25 +00:00
files_read_etc_runtime_files($1_t)
files_read_usr_files($1_t)
files_watch_usr_dirs($1_t)
files_watch_runtime_dirs($1_t)
2006-09-06 22:07:25 +00:00
# Read directories and files with the readable_t type.
# This type is a general type for "world"-readable files.
files_list_world_readable($1_t)
files_read_world_readable_files($1_t)
files_read_world_readable_symlinks($1_t)
files_read_world_readable_pipes($1_t)
files_read_world_readable_sockets($1_t)
# old broswer_domain():
files_dontaudit_list_non_security($1_t)
files_dontaudit_getattr_non_security_files($1_t)
files_dontaudit_getattr_non_security_symlinks($1_t)
files_dontaudit_getattr_non_security_pipes($1_t)
files_dontaudit_getattr_non_security_sockets($1_t)
2006-09-06 22:07:25 +00:00
libs_exec_ld_so($1_t)
miscfiles_read_localization($1_t)
miscfiles_read_generic_certs($1_t)
miscfiles_watch_fonts_dirs($1_t)
sysnet_read_config($1_t)
2006-09-06 22:07:25 +00:00
# kdeinit wants systemd status
init_get_system_status($1_t)
optional_policy(`
apt_read_cache($1_t)
apt_read_db($1_t)
')
2006-09-06 22:07:25 +00:00
tunable_policy(`allow_execmem',`
# Allow loading DSOs that require executable stack.
allow $1_t self:process execmem;
')
tunable_policy(`allow_execmem && allow_execstack',`
# Allow making the stack executable via mprotect.
allow $1_t self:process execstack;
')
optional_policy(`
devicekit_dbus_chat_disk($1_t)
devicekit_dbus_chat_power($1_t)
')
optional_policy(`
kerneloops_dbus_chat($1_t)
')
2006-09-06 22:07:25 +00:00
')
tunable-managed user content access template To simplify policy management on the various application domains with respect to user content access, a template is introduced which generates four tunable_policy() blocks. - The *_read_generic_user_content boolean will enable the application domain to read generic user resources (labeled with user_home_t). - The *_read_all_user_content boolean does the same, but for all user resources (those associated with the user_home_content_type attribute). - The *_manage_generic_user_content boolean enables the application to manage generic user resources (labeled with user_home_t) - The *_manage_all_user_content boolean does the same, but for all user reosurces (those associated with the user_home_content_type attribute). Although it would be even better to generate the booleans themselves as well (which is what Gentoo does with this template), it would result in booleans without proper documentation. Calls such as "semanage boolean -l" would fail to properly show a description on the boolean - something Gentoo resolves by keeping this documentation separate in a doc/gentoo_tunables.xml file. In this patch, we assume that the calling modules will define the booleans themselves (with appropriate documentation). The template checks for the existence of the booleans. This approach is more in line with how domain-specific booleans are managed up to now. Changes since v2: - Fix typo in gen_require (had a closing : instead of ;) Changes since v1: - Use in-line XML comment and tunable definition Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2018-03-25 11:56:41 +00:00
#######################################
## <summary>
## Template for handling user content through standard tunables
## </summary>
## <desc>
## <p>
## This template generates the tunable blocks for accessing
## end user content, either the generic one (user_home_t)
## or the complete one (based on user_home_content_type).
## </p>
## <p>
## It calls the *_read_generic_user_content,
## *_read_all_user_content, *_manage_generic_user_content, and
## *_manage_all_user_content booleans.
## </p>
## </desc>
## <param name="prefix">
## <summary>
## The application domain prefix to use, meant for the boolean
## calls
## </summary>
## </param>
## <param name="domain">
## <summary>
## The application domain which is granted the necessary privileges
## </summary>
## </param>
## <rolebase/>
#
template(`userdom_user_content_access_template',`
## <desc>
## <p>
## Grant the $1 domains read access to generic user content
## </p>
## </desc>
gen_tunable(`$1_read_generic_user_content', true)
## <desc>
## <p>
## Grant the $1 domains read access to all user content
## </p>
## </desc>
gen_tunable(`$1_read_all_user_content', false)
## <desc>
## <p>
## Grant the $1 domains manage rights on generic user content
## </p>
## </desc>
gen_tunable(`$1_manage_generic_user_content', false)
## <desc>
## <p>
## Grant the $1 domains manage rights on all user content
## </p>
## </desc>
gen_tunable(`$1_manage_all_user_content', false)
tunable_policy(`$1_read_generic_user_content',`
userdom_list_user_tmp($2)
userdom_list_user_home_content($2)
userdom_read_user_home_content_files($2)
userdom_read_user_home_content_symlinks($2)
userdom_read_user_tmp_files($2)
userdom_read_user_tmp_symlinks($2)
',`
files_dontaudit_list_home($2)
files_dontaudit_list_tmp($2)
userdom_dontaudit_list_user_home_dirs($2)
userdom_dontaudit_list_user_tmp($2)
userdom_dontaudit_read_user_home_content_files($2)
userdom_dontaudit_read_user_tmp_files($2)
')
tunable_policy(`$1_read_all_user_content',`
userdom_list_user_tmp($2)
userdom_read_all_user_home_content($2)
')
tunable_policy(`$1_manage_generic_user_content',`
userdom_manage_user_tmp_dirs($2)
userdom_manage_user_tmp_files($2)
userdom_manage_user_tmp_symlinks($2)
userdom_manage_user_home_content_dirs($2)
userdom_manage_user_home_content_files($2)
userdom_manage_user_home_content_symlinks($2)
')
tunable_policy(`$1_manage_all_user_content',`
userdom_manage_all_user_home_content($2)
')
')
2006-09-06 22:07:25 +00:00
#######################################
## <summary>
2008-11-05 16:10:46 +00:00
## Allow a home directory for which the
## role has read-only access.
2006-09-06 22:07:25 +00:00
## </summary>
## <desc>
## <p>
2008-11-05 16:10:46 +00:00
## Allow a home directory for which the
## role has read-only access.
2006-09-06 22:07:25 +00:00
## </p>
## <p>
## This does not allow execute access.
## </p>
## </desc>
## <param name="role" unused="true">
2006-09-06 22:07:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## The user role
## </summary>
## </param>
## <param name="userdomain">
## <summary>
## The user domain
2006-09-06 22:07:25 +00:00
## </summary>
## </param>
## <rolebase/>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_ro_home_role',`
gen_require(`
2008-11-05 16:10:46 +00:00
type user_home_t, user_home_dir_t;
')
2006-09-06 22:07:25 +00:00
##############################
#
# Domain access to home dir
#
2008-11-05 16:10:46 +00:00
type_member $2 user_home_dir_t:dir user_home_dir_t;
2006-09-06 22:07:25 +00:00
# read-only home directory
2008-11-05 16:10:46 +00:00
allow $2 user_home_dir_t:dir list_dir_perms;
allow $2 user_home_t:dir list_dir_perms;
allow $2 user_home_t:file entrypoint;
read_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t)
read_lnk_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t)
read_fifo_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t)
read_sock_files_pattern($2, { user_home_t user_home_dir_t }, user_home_t)
files_list_home($2)
2006-09-06 22:07:25 +00:00
allow $2 { user_home_t user_home_dir_t }:dir { watch watch_mount watch_sb watch_with_perm watch_reads };
allow $2 user_home_t:file { watch watch_mount watch_sb watch_with_perm watch_reads };
allow $2 user_home_t:lnk_file { watch watch_mount watch_sb watch_with_perm watch_reads };
allow $2 user_home_t:sock_file { watch watch_mount watch_sb watch_with_perm watch_reads };
allow $2 user_home_t:fifo_file { watch watch_mount watch_sb watch_with_perm watch_reads };
2006-09-06 22:07:25 +00:00
tunable_policy(`use_nfs_home_dirs',`
2008-11-05 16:10:46 +00:00
fs_list_nfs($2)
fs_read_nfs_files($2)
fs_read_nfs_symlinks($2)
fs_read_nfs_named_sockets($2)
fs_read_nfs_named_pipes($2)
2006-09-06 22:07:25 +00:00
',`
2008-11-05 16:10:46 +00:00
fs_dontaudit_list_nfs($2)
fs_dontaudit_read_nfs_files($2)
2006-09-06 22:07:25 +00:00
')
tunable_policy(`use_samba_home_dirs',`
2008-11-05 16:10:46 +00:00
fs_list_cifs($2)
fs_read_cifs_files($2)
fs_read_cifs_symlinks($2)
fs_read_cifs_named_sockets($2)
fs_read_cifs_named_pipes($2)
2006-09-06 22:07:25 +00:00
',`
2008-11-05 16:10:46 +00:00
fs_dontaudit_list_cifs($2)
fs_dontaudit_read_cifs_files($2)
2006-09-06 22:07:25 +00:00
')
')
#######################################
## <summary>
2008-11-05 16:10:46 +00:00
## Allow a home directory for which the
## role has full access.
2006-09-06 22:07:25 +00:00
## </summary>
## <desc>
## <p>
2008-11-05 16:10:46 +00:00
## Allow a home directory for which the
## role has full access.
2006-09-06 22:07:25 +00:00
## </p>
## <p>
## This does not allow execute access.
## </p>
## </desc>
## <param name="role" unused="true">
2006-09-06 22:07:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## The user role
## </summary>
## </param>
## <param name="userdomain">
## <summary>
## The user domain
2006-09-06 22:07:25 +00:00
## </summary>
## </param>
## <rolebase/>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_home_role',`
gen_require(`
type user_home_t, user_home_dir_t, user_cert_t;
')
2006-09-06 22:07:25 +00:00
##############################
#
# Domain access to home dir
#
2008-11-05 16:10:46 +00:00
type_member $2 user_home_dir_t:dir user_home_dir_t;
2006-09-06 22:07:25 +00:00
# full control of the home directory
2008-11-05 16:10:46 +00:00
allow $2 user_home_t:file entrypoint;
manage_dirs_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
manage_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
manage_lnk_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
manage_sock_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
manage_fifo_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
relabel_dirs_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
relabel_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
relabel_lnk_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
relabel_sock_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
relabel_fifo_files_pattern($2, { user_home_dir_t user_home_t }, user_home_t)
filetrans_pattern($2, user_home_dir_t, user_home_t, { dir file lnk_file sock_file fifo_file })
files_list_home($2)
2006-09-06 22:07:25 +00:00
2006-12-12 20:08:08 +00:00
# cjp: this should probably be removed:
2008-11-05 16:10:46 +00:00
allow $2 user_home_dir_t:dir { manage_dir_perms relabel_dir_perms };
2006-12-12 20:08:08 +00:00
allow $2 { user_home_t user_home_dir_t }:dir { watch watch_mount watch_sb watch_with_perm watch_reads };
allow $2 user_home_t:file { watch watch_mount watch_sb watch_with_perm watch_reads };
allow $2 user_home_t:lnk_file { watch watch_mount watch_sb watch_with_perm watch_reads };
allow $2 user_home_t:sock_file { watch watch_mount watch_sb watch_with_perm watch_reads };
allow $2 user_home_t:fifo_file { watch watch_mount watch_sb watch_with_perm watch_reads };
userdom_manage_user_certs($2)
userdom_user_home_dir_filetrans($2, user_cert_t, dir, ".pki")
2006-09-06 22:07:25 +00:00
tunable_policy(`use_nfs_home_dirs',`
2008-11-05 16:10:46 +00:00
fs_manage_nfs_dirs($2)
fs_manage_nfs_files($2)
fs_manage_nfs_symlinks($2)
fs_manage_nfs_named_sockets($2)
fs_manage_nfs_named_pipes($2)
2006-09-06 22:07:25 +00:00
',`
2008-11-05 16:10:46 +00:00
fs_dontaudit_manage_nfs_dirs($2)
fs_dontaudit_manage_nfs_files($2)
2006-09-06 22:07:25 +00:00
')
tunable_policy(`use_samba_home_dirs',`
2008-11-05 16:10:46 +00:00
fs_manage_cifs_dirs($2)
fs_manage_cifs_files($2)
fs_manage_cifs_symlinks($2)
fs_manage_cifs_named_sockets($2)
fs_manage_cifs_named_pipes($2)
2006-09-06 22:07:25 +00:00
',`
2008-11-05 16:10:46 +00:00
fs_dontaudit_manage_cifs_dirs($2)
fs_dontaudit_manage_cifs_files($2)
2006-09-06 22:07:25 +00:00
')
')
#######################################
## <summary>
2008-11-05 16:10:46 +00:00
## Manage user temporary files
2006-09-06 22:07:25 +00:00
## </summary>
## <param name="role" unused="true">
2006-09-06 22:07:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Role allowed access.
2006-09-06 22:07:25 +00:00
## </summary>
## </param>
2008-11-05 16:10:46 +00:00
## <param name="domain">
2006-09-06 22:07:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
2006-09-06 22:07:25 +00:00
## </summary>
## </param>
## <rolebase/>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_tmp_role',`
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
')
2008-11-05 16:10:46 +00:00
files_poly_member_tmp($2, user_tmp_t)
2006-09-06 22:07:25 +00:00
2008-11-05 16:10:46 +00:00
manage_dirs_pattern($2, user_tmp_t, user_tmp_t)
manage_files_pattern($2, user_tmp_t, user_tmp_t)
manage_lnk_files_pattern($2, user_tmp_t, user_tmp_t)
manage_sock_files_pattern($2, user_tmp_t, user_tmp_t)
manage_fifo_files_pattern($2, user_tmp_t, user_tmp_t)
files_tmp_filetrans($2, user_tmp_t, { dir file lnk_file sock_file fifo_file })
userdom_user_runtime_filetrans_user_tmp($2, { dir file lnk_file sock_file fifo_file })
2006-09-06 22:07:25 +00:00
')
#######################################
## <summary>
2008-11-05 16:10:46 +00:00
## The execute access user temporary files.
2006-09-06 22:07:25 +00:00
## </summary>
2008-11-05 16:10:46 +00:00
## <param name="domain">
2006-09-06 22:07:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
2006-09-06 22:07:25 +00:00
## </summary>
## </param>
## <rolebase/>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_exec_user_tmp_files',`
gen_require(`
type user_tmp_t;
')
exec_files_pattern($1, user_tmp_t, user_tmp_t)
files_search_tmp($1)
userdom_search_user_runtime($1)
2006-09-06 22:07:25 +00:00
')
#######################################
## <summary>
2008-11-05 16:10:46 +00:00
## Role access for the user tmpfs type
2006-09-06 22:07:25 +00:00
## that the user has full access.
## </summary>
## <desc>
## <p>
2008-11-05 16:10:46 +00:00
## Role access for the user tmpfs type
2006-09-06 22:07:25 +00:00
## that the user has full access.
## </p>
## <p>
## This does not allow execute access.
## </p>
## </desc>
## <param name="role" unused="true">
2006-09-06 22:07:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Role allowed access.
2006-09-06 22:07:25 +00:00
## </summary>
## </param>
2008-11-05 16:10:46 +00:00
## <param name="domain">
2006-09-06 22:07:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
2006-09-06 22:07:25 +00:00
## </summary>
## </param>
2008-11-05 16:10:46 +00:00
## <rolecap/>
2006-09-06 22:07:25 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_tmpfs_role',`
2006-09-06 22:07:25 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmpfs_t;
2006-09-06 22:07:25 +00:00
')
2008-11-05 16:10:46 +00:00
manage_dirs_pattern($2, user_tmpfs_t, user_tmpfs_t)
manage_files_pattern($2, user_tmpfs_t, user_tmpfs_t)
manage_lnk_files_pattern($2, user_tmpfs_t, user_tmpfs_t)
manage_sock_files_pattern($2, user_tmpfs_t, user_tmpfs_t)
manage_fifo_files_pattern($2, user_tmpfs_t, user_tmpfs_t)
fs_tmpfs_filetrans($2, user_tmpfs_t, { dir file lnk_file sock_file fifo_file })
2006-09-06 22:07:25 +00:00
')
#######################################
## <summary>
## The template allowing the user basic
## network permissions
## </summary>
## <param name="userdomain_prefix">
## <summary>
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
## </param>
## <rolebase/>
#
template(`userdom_basic_networking_template',`
gen_require(`
type $1_t;
')
allow $1_t self:tcp_socket create_stream_socket_perms;
allow $1_t self:udp_socket create_socket_perms;
corenet_all_recvfrom_netlabel($1_t)
corenet_tcp_sendrecv_generic_if($1_t)
corenet_udp_sendrecv_generic_if($1_t)
corenet_tcp_sendrecv_generic_node($1_t)
corenet_udp_sendrecv_generic_node($1_t)
2006-09-06 22:07:25 +00:00
corenet_tcp_connect_all_ports($1_t)
corenet_sendrecv_all_client_packets($1_t)
corenet_all_recvfrom_labeled($1_t, $1_t)
optional_policy(`
init_tcp_recvfrom_all_daemons($1_t)
init_udp_recvfrom_all_daemons($1_t)
')
optional_policy(`
ipsec_match_default_spd($1_t)
')
2006-09-06 22:07:25 +00:00
')
#######################################
## <summary>
## The template for allowing the user to change passwords.
## </summary>
## <param name="userdomain_prefix">
## <summary>
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
## </param>
## <rolebase/>
#
template(`userdom_change_password_template',`
gen_require(`
2008-11-05 16:10:46 +00:00
type $1_t;
2006-09-06 22:07:25 +00:00
role $1_r;
')
optional_policy(`
2011-03-21 15:14:34 +00:00
usermanage_run_chfn($1_t, $1_r)
usermanage_run_passwd($1_t, $1_r)
2006-09-06 22:07:25 +00:00
')
')
#######################################
## <summary>
## The template containing rules common to unprivileged
## users and administrative users.
## </summary>
## <desc>
## <p>
## This template creates a user domain, types, and
## rules for the user's tty, pty, tmp, and tmpfs files.
## </p>
## </desc>
## <param name="userdomain_prefix">
## <summary>
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
## </param>
#
template(`userdom_common_user_template',`
gen_require(`
attribute unpriv_userdomain;
')
2006-09-06 22:07:25 +00:00
userdom_basic_networking_template($1)
##############################
#
# User domain Local policy
#
# evolution and gnome-session try to create a netlink socket
dontaudit $1_t self:netlink_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown };
dontaudit $1_t self:netlink_route_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown nlmsg_read nlmsg_write };
# gnome-settings-daemon and some applications create a netlink socket
allow $1_t self:netlink_kobject_uevent_socket create_socket_perms;
2006-09-06 22:07:25 +00:00
allow $1_t unpriv_userdomain:fd use;
kernel_read_system_state($1_t)
kernel_read_network_state($1_t)
kernel_read_net_sysctls($1_t)
# Very permissive allowing every domain to see every type:
kernel_get_sysvipc_info($1_t)
# Find CDROM devices:
kernel_read_device_sysctls($1_t)
2008-11-05 16:10:46 +00:00
corecmd_exec_bin($1_t)
corenet_udp_bind_generic_node($1_t)
2006-09-06 22:07:25 +00:00
corenet_udp_bind_generic_port($1_t)
dev_read_rand($1_t)
dev_write_sound($1_t)
dev_read_sound($1_t)
dev_read_sound_mixer($1_t)
dev_write_sound_mixer($1_t)
dev_read_wireless($1_t)
2006-09-06 22:07:25 +00:00
files_exec_etc_files($1_t)
files_search_locks($1_t)
# List mounted filesystems (cdrom, FAT, NTFS and so on)
files_list_mnt($1_t)
2006-09-06 22:07:25 +00:00
# cjp: perhaps should cut back on file reads:
files_read_var_files($1_t)
files_read_var_symlinks($1_t)
files_read_generic_spool($1_t)
files_read_var_lib_files($1_t)
# Stat lost+found.
files_getattr_lost_found_dirs($1_t)
files_watch_etc_dirs($1_t)
files_watch_usr_dirs($1_t)
2006-09-06 22:07:25 +00:00
fs_rw_cgroup_files($1_t)
2006-09-06 22:07:25 +00:00
# cjp: some of this probably can be removed
selinux_get_fs_mount($1_t)
selinux_validate_context($1_t)
selinux_compute_access_vector($1_t)
selinux_compute_create_context($1_t)
selinux_compute_relabel_context($1_t)
selinux_compute_user_contexts($1_t)
# for eject
storage_getattr_fixed_disk_dev($1_t)
auth_use_nsswitch($1_t)
2006-09-06 22:07:25 +00:00
auth_read_login_records($1_t)
auth_search_pam_console_data($1_t)
2011-03-21 15:14:34 +00:00
auth_run_pam($1_t, $1_r)
auth_run_utempter($1_t, $1_r)
2006-09-06 22:07:25 +00:00
init_read_utmp($1_t)
2005-09-19 21:17:45 +00:00
seutil_read_file_contexts($1_t)
seutil_read_default_contexts($1_t)
2011-03-21 15:14:34 +00:00
seutil_run_newrole($1_t, $1_r)
seutil_exec_checkpolicy($1_t)
seutil_exec_setfiles($1_t)
2006-09-06 22:07:25 +00:00
# for when the network connection is killed
# this is needed when a login role can change
# to this one.
seutil_dontaudit_signal_newrole($1_t)
2005-09-19 21:17:45 +00:00
ifndef(`enable_mls',`
tunable_policy(`user_write_removable',`
# Read/write floppies and other removable devices
storage_raw_read_removable_device($1_t)
storage_raw_write_removable_device($1_t)
',`
# Read floppies
storage_raw_read_removable_device($1_t)
')
')
2005-06-13 20:44:23 +00:00
tunable_policy(`user_direct_mouse',`
2005-06-13 16:22:32 +00:00
dev_read_mouse($1_t)
2005-06-13 20:44:23 +00:00
')
tunable_policy(`user_rw_noexattrfile',`
fs_manage_noxattr_fs_dirs($1_t)
fs_manage_noxattr_fs_files($1_t)
fs_manage_noxattr_fs_symlinks($1_t)
',`
fs_read_noxattr_fs_files($1_t)
fs_read_noxattr_fs_symlinks($1_t)
')
2005-06-13 20:44:23 +00:00
tunable_policy(`user_ttyfile_stat',`
term_getattr_all_ttys($1_t)
2005-06-13 20:44:23 +00:00
')
tunable_policy(`user_write_removable',`
# Read/write USB devices (e.g. external removable USB mass storage devices)
dev_rw_generic_usb_dev($1_t)
',`
# Read USB devices (e.g. external removable USB mass storage devices)
dev_read_generic_usb_dev($1_t)
')
optional_policy(`
alsa_home_filetrans_alsa_home($1_t, file, ".asoundrc")
alsa_manage_home_files($1_t)
alsa_read_config($1_t)
alsa_relabel_home_files($1_t)
')
optional_policy(`
2005-11-29 15:49:18 +00:00
# Allow graphical boot to check battery lifespan
acpi_stream_connect($1_t)
2005-11-29 15:49:18 +00:00
')
optional_policy(`
2005-10-21 16:39:28 +00:00
canna_stream_connect($1_t)
')
optional_policy(`
2008-11-05 16:10:46 +00:00
dbus_system_bus_client($1_t)
2005-11-25 16:43:03 +00:00
optional_policy(`
accountsd_dbus_chat($1_t)
')
2006-09-06 22:07:25 +00:00
optional_policy(`
bluetooth_dbus_chat($1_t)
')
optional_policy(`
colord_dbus_chat($1_t)
')
optional_policy(`
consolekit_dbus_chat($1_t)
')
optional_policy(`
2005-11-29 21:27:15 +00:00
cups_dbus_chat_config($1_t)
')
optional_policy(`
devicekit_dbus_chat_disk($1_t)
devicekit_dbus_chat_power($1_t)
')
optional_policy(`
2005-11-29 15:49:18 +00:00
hal_dbus_chat($1_t)
')
optional_policy(`
2005-11-25 16:43:03 +00:00
networkmanager_dbus_chat($1_t)
')
optional_policy(`
policykit_dbus_chat($1_t)
')
optional_policy(`
rtkit_daemon_dbus_chat($1_t)
')
optional_policy(`
2016-08-14 20:08:12 +00:00
xserver_dbus_chat_xdm($1_t)
')
2005-08-31 20:58:12 +00:00
')
2017-02-19 21:13:14 +00:00
optional_policy(`
dpkg_read_db($1_t)
')
optional_policy(`
gssproxy_stream_connect($1_t)
')
optional_policy(`
hwloc_exec_dhwd($1_t)
hwloc_read_runtime_files($1_t)
')
optional_policy(`
inetd_use_fds($1_t)
2006-02-02 21:08:12 +00:00
inetd_rw_tcp_sockets($1_t)
2005-07-12 20:34:24 +00:00
')
optional_policy(`
inn_read_config($1_t)
inn_read_news_lib($1_t)
inn_read_news_spool($1_t)
')
optional_policy(`
kerberos_manage_krb5_home_files($1_t)
kerberos_relabel_krb5_home_files($1_t)
kerberos_home_filetrans_krb5_home($1_t, file, ".k5login")
')
optional_policy(`
locate_read_lib_files($1_t)
')
optional_policy(`
mpd_manage_user_data_content($1_t)
mpd_relabel_user_data_content($1_t)
')
2006-09-06 22:07:25 +00:00
# for running depmod as part of the kernel packaging process
optional_policy(`
modutils_read_module_config($1_t)
')
optional_policy(`
mta_rw_spool($1_t)
')
optional_policy(`
mysql_manage_mysqld_home_files($1_t)
mysql_relabel_mysqld_home_files($1_t)
mysql_home_filetrans_mysqld_home($1_t, file, ".my.cnf")
2012-10-31 14:52:36 +00:00
tunable_policy(`allow_user_mysql_connect',`
mysql_stream_connect($1_t)
')
2005-08-03 17:56:26 +00:00
')
optional_policy(`
oident_manage_user_content($1_t)
oident_relabel_user_content($1_t)
oident_home_filetrans_oidentd_home($1_t, file, ".oidentd.conf")
')
optional_policy(`
2005-07-19 18:40:31 +00:00
# to allow monitoring of pcmcia status
pcmcia_read_runtime_files($1_t)
2005-07-19 18:40:31 +00:00
')
optional_policy(`
pcscd_read_runtime_files($1_t)
pcscd_stream_connect($1_t)
')
optional_policy(`
tunable_policy(`allow_user_postgresql_connect',`
postgresql_stream_connect($1_t)
postgresql_tcp_connect($1_t)
')
')
optional_policy(`
ppp_manage_home_files($1_t)
ppp_relabel_home_files($1_t)
ppp_home_filetrans_ppp_home($1_t, file, ".ppprc")
')
2006-04-14 19:13:17 +00:00
optional_policy(`
resmgr_stream_connect($1_t)
')
optional_policy(`
2005-11-25 17:39:35 +00:00
rpc_dontaudit_getattr_exports($1_t)
2005-11-29 15:49:18 +00:00
rpc_manage_nfs_rw_content($1_t)
2005-11-25 17:39:35 +00:00
')
optional_policy(`
2006-02-02 21:08:12 +00:00
samba_stream_connect_winbind($1_t)
2005-11-29 15:49:18 +00:00
')
optional_policy(`
2006-01-04 20:44:30 +00:00
slrnpull_search_spool($1_t)
')
optional_policy(`
systemd_role_template($1, $1_r, $1_t)
')
optional_policy(`
2011-03-21 15:14:34 +00:00
usernetctl_run($1_t, $1_r)
2006-01-17 23:01:14 +00:00
')
optional_policy(`
virt_home_filetrans_virt_home($1_t, dir, ".libvirt")
virt_home_filetrans_virt_home($1_t, dir, ".virtinst")
virt_home_filetrans_virt_content($1_t, dir, "isos")
virt_home_filetrans_svirt_home($1_t, dir, "qemu")
2016-12-06 12:28:10 +00:00
virt_home_filetrans_virt_home($1_t, dir, "VirtualMachines")
')
2005-07-19 18:40:31 +00:00
')
#######################################
## <summary>
## The template for creating a login user.
## </summary>
## <desc>
## <p>
## This template creates a user domain, types, and
## rules for the user's tty, pty, home directories,
## tmp, and tmpfs files.
## </p>
## </desc>
## <param name="userdomain_prefix">
## <summary>
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
## </param>
#
template(`userdom_login_user_template', `
2008-06-24 12:53:30 +00:00
gen_require(`
class context contains;
')
userdom_base_user_template($1)
2008-11-05 16:10:46 +00:00
userdom_manage_home_role($1_r, $1_t)
2008-11-05 16:10:46 +00:00
userdom_manage_tmp_role($1_r, $1_t)
userdom_manage_tmpfs_role($1_r, $1_t)
2008-11-05 16:10:46 +00:00
userdom_exec_user_tmp_files($1_t)
userdom_exec_user_home_content_files($1_t)
userdom_map_user_tmpfs_files($1_t)
userdom_change_password_template($1)
##############################
#
# User domain Local policy
#
allow $1_t self:capability { chown fowner setgid };
dontaudit $1_t self:capability { fsetid sys_nice };
allow $1_t self:process { transition signal_perms ptrace getsched setsched getsession getpgid setpgid getcap setcap share getattr setfscreate noatsecure siginh rlimitinh dyntransition setkeycreate setsockcreate getrlimit };
dontaudit $1_t self:process setrlimit;
dontaudit $1_t self:netlink_route_socket { create ioctl read getattr write setattr append bind connect getopt setopt shutdown nlmsg_read nlmsg_write };
allow $1_t self:context contains;
kernel_dontaudit_read_system_state($1_t)
dev_read_sysfs($1_t)
dev_read_urand($1_t)
domain_use_interactive_fds($1_t)
# Command completion can fire hundreds of denials
domain_dontaudit_exec_all_entry_files($1_t)
files_dontaudit_list_default($1_t)
files_dontaudit_read_default_files($1_t)
# Stat lost+found.
files_getattr_lost_found_dirs($1_t)
fs_get_all_fs_quotas($1_t)
fs_getattr_all_fs($1_t)
fs_getattr_all_dirs($1_t)
fs_search_auto_mountpoints($1_t)
fs_list_cgroup_dirs($1_t)
fs_list_inotifyfs($1_t)
fs_rw_anon_inodefs_files($1_t)
fs_dontaudit_rw_cgroup_files($1_t)
auth_dontaudit_write_login_records($1_t)
application_exec_all($1_t)
# The library functions always try to open read-write first,
2011-03-21 15:14:34 +00:00
# then fall back to read-only if it fails.
init_dontaudit_rw_utmp($1_t)
# Stop warnings about access to /dev/console
init_dontaudit_use_fds($1_t)
init_dontaudit_use_script_fds($1_t)
libs_exec_lib_files($1_t)
logging_dontaudit_getattr_all_logs($1_t)
miscfiles_read_man_pages($1_t)
# map is needed for man-dbs apropos program
miscfiles_map_man_cache($1_t)
miscfiles_read_public_files($1_t)
# for running TeX programs
miscfiles_read_tetex_data($1_t)
miscfiles_exec_tetex_data($1_t)
seutil_read_config($1_t)
optional_policy(`
cups_read_config($1_t)
cups_stream_connect($1_t)
cups_stream_connect_ptal($1_t)
')
optional_policy(`
kerberos_use($1_t)
')
optional_policy(`
mta_dontaudit_read_spool_symlinks($1_t)
')
optional_policy(`
quota_dontaudit_getattr_db($1_t)
')
optional_policy(`
rpm_read_db($1_t)
rpm_dontaudit_manage_db($1_t)
')
')
#######################################
## <summary>
## The template for creating a unprivileged login user.
## </summary>
## <desc>
## <p>
## This template creates a user domain, types, and
## rules for the user's tty, pty, home directories,
## tmp, and tmpfs files.
## </p>
## </desc>
## <param name="userdomain_prefix">
## <summary>
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
## </param>
#
template(`userdom_restricted_user_template',`
gen_require(`
attribute unpriv_userdomain;
')
userdom_login_user_template($1)
2005-09-02 19:11:07 +00:00
typeattribute $1_t unpriv_userdomain;
2006-02-20 21:33:25 +00:00
domain_interactive_fd($1_t)
##############################
#
# Local policy
#
optional_policy(`
2011-03-21 15:14:34 +00:00
loadkeys_run($1_t, $1_r)
')
')
#######################################
## <summary>
## The template for creating a unprivileged xwindows login user.
## </summary>
## <desc>
## <p>
## The template for creating a unprivileged xwindows login user.
## </p>
## <p>
## This template creates a user domain, types, and
## rules for the user's tty, pty, home directories,
## tmp, and tmpfs files.
## </p>
## </desc>
## <param name="userdomain_prefix">
## <summary>
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
## </param>
#
template(`userdom_restricted_xwindows_user_template',`
userdom_restricted_user_template($1)
##############################
#
# Local policy
#
2008-11-05 16:10:46 +00:00
auth_role($1_r, $1_t)
auth_search_pam_console_data($1_t)
dev_read_sound($1_t)
dev_write_sound($1_t)
# gnome keyring wants to read this.
dev_dontaudit_read_rand($1_t)
logging_send_syslog_msg($1_t)
logging_dontaudit_send_audit_msgs($1_t)
# Need to to this just so screensaver will work. Should be moved to screensaver domain
logging_send_audit_msgs($1_t)
selinux_get_enforce_mode($1_t)
xserver_restricted_role($1_r, $1_t)
optional_policy(`
alsa_read_config($1_t)
')
optional_policy(`
2008-11-05 16:10:46 +00:00
dbus_role_template($1, $1_r, $1_t)
dbus_system_bus_client($1_t)
optional_policy(`
consolekit_dbus_chat($1_t)
')
optional_policy(`
cups_dbus_chat($1_t)
')
optional_policy(`
gnome_role_template($1, $1_r, $1_t)
')
optional_policy(`
wm_role_template($1, $1_r, $1_t)
')
')
optional_policy(`
2008-11-05 16:10:46 +00:00
java_role($1_r, $1_t)
')
optional_policy(`
pulseaudio_role($1_r, $1_t)
')
optional_policy(`
setroubleshoot_dontaudit_stream_connect($1_t)
')
')
#######################################
## <summary>
## The template for creating a unprivileged user roughly
## equivalent to a regular linux user.
## </summary>
## <desc>
## <p>
## The template for creating a unprivileged user roughly
## equivalent to a regular linux user.
## </p>
## <p>
## This template creates a user domain, types, and
## rules for the user's tty, pty, home directories,
## tmp, and tmpfs files.
## </p>
## </desc>
## <param name="userdomain_prefix">
## <summary>
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
## </param>
#
template(`userdom_unpriv_user_template', `
##############################
#
# Declarations
#
# Inherit rules for ordinary users.
userdom_restricted_user_template($1)
userdom_common_user_template($1)
##############################
#
# Local policy
#
# port access is audited even if dac would not have allowed it, so dontaudit it here
2005-06-10 01:01:13 +00:00
corenet_dontaudit_tcp_bind_all_reserved_ports($1_t)
2006-09-06 22:07:25 +00:00
# Need the following rule to allow users to run vpnc
corenet_tcp_bind_xserver_port($1_t)
2005-07-19 18:40:31 +00:00
files_exec_usr_files($1_t)
miscfiles_manage_public_files($1_t)
miscfiles_watch_public_dirs($1_t)
2005-06-13 20:44:23 +00:00
tunable_policy(`user_dmesg',`
kernel_read_ring_buffer($1_t)
2005-06-13 20:44:23 +00:00
',`
2005-06-10 01:01:13 +00:00
kernel_dontaudit_read_ring_buffer($1_t)
2005-06-13 20:44:23 +00:00
')
tunable_policy(`user_exec_noexattrfile',`
fs_exec_noxattr($1_t)
')
# Allow users to run TCP servers (bind to ports and accept connection from
# the same domain and outside users) disabling this forces FTP passive mode
# and may change other protocols
2005-06-13 20:44:23 +00:00
tunable_policy(`user_tcp_server',`
corenet_tcp_bind_generic_node($1_t)
2005-06-10 01:01:13 +00:00
corenet_tcp_bind_generic_port($1_t)
2005-06-13 20:44:23 +00:00
')
# Allow users to run UDP servers (bind to ports and accept connection from
# the same domain and outside users)
tunable_policy(`user_udp_server',`
corenet_udp_bind_generic_node($1_t)
corenet_udp_bind_generic_port($1_t)
')
optional_policy(`
2011-03-21 15:14:34 +00:00
netutils_run_ping_cond($1_t, $1_r)
netutils_run_traceroute_cond($1_t, $1_r)
2005-09-27 19:40:44 +00:00
')
2005-10-14 20:00:07 +00:00
# Run pppd in pppd_t by default for user
optional_policy(`
2011-03-21 15:14:34 +00:00
ppp_run_cond($1_t, $1_r)
2005-10-14 20:00:07 +00:00
')
optional_policy(`
setroubleshoot_stream_connect($1_t)
')
2017-02-24 01:03:23 +00:00
optional_policy(`
systemd_dbus_chat_logind($1_t)
')
# Allow controlling usbguard
optional_policy(`
tunable_policy(`usbguard_user_modify_rule_files',`
usbguard_stream_connect($1_t)
')
')
')
2005-05-18 13:18:49 +00:00
#######################################
## <summary>
## The template for creating an administrative user.
## </summary>
## <desc>
## <p>
## This template creates a user domain, types, and
## rules for the user's tty, pty, home directories,
## tmp, and tmpfs files.
## </p>
2005-07-19 18:40:31 +00:00
## <p>
## The privileges given to administrative users are:
## <ul>
## <li>Raw disk access</li>
## <li>Set all sysctls</li>
## <li>All kernel ring buffer controls</li>
## <li>Create, read, write, and delete all files but shadow</li>
## <li>Manage source and binary format SELinux policy</li>
## <li>Run insmod</li>
## </ul>
2005-07-19 18:40:31 +00:00
## </p>
## </desc>
## <param name="userdomain_prefix">
## <summary>
## The prefix of the user domain (e.g., sysadm
## is the prefix for sysadm_t).
## </summary>
## </param>
2005-05-18 13:18:49 +00:00
#
2006-09-06 22:07:25 +00:00
template(`userdom_admin_user_template',`
2005-09-21 14:49:41 +00:00
gen_require(`
2009-08-31 13:03:51 +00:00
attribute admindomain;
2008-11-05 16:10:46 +00:00
class passwd { passwd chfn chsh rootok };
2005-09-21 14:49:41 +00:00
')
##############################
#
# Declarations
#
# Inherit rules for ordinary users.
userdom_login_user_template($1)
2006-09-06 22:07:25 +00:00
userdom_common_user_template($1)
2006-02-02 21:08:12 +00:00
domain_obj_id_change_exemption($1_t)
role system_r types $1_t;
2009-08-31 13:03:51 +00:00
typeattribute $1_t admindomain;
2009-08-31 12:44:11 +00:00
2005-09-21 14:49:41 +00:00
ifdef(`direct_sysadm_daemon',`
2006-02-02 21:08:12 +00:00
domain_system_change_exemption($1_t)
2005-09-21 14:49:41 +00:00
')
2008-10-17 15:52:39 +00:00
##############################
#
# $1_t local policy
#
allow $1_t self:capability { chown dac_override dac_read_search fowner fsetid kill setgid setuid setpcap linux_immutable net_bind_service net_broadcast net_admin net_raw ipc_lock ipc_owner sys_rawio sys_chroot sys_ptrace sys_pacct sys_admin sys_boot sys_nice sys_resource sys_time sys_tty_config mknod lease setfcap };
allow $1_t self:process { setexec setfscreate };
2009-08-31 12:44:11 +00:00
allow $1_t self:netlink_audit_socket nlmsg_readpriv;
allow $1_t self:tun_socket create;
# Set password information for other users.
allow $1_t self:passwd { passwd chfn chsh };
# Skip authentication when pam_rootok is specified.
allow $1_t self:passwd rootok;
kernel_read_software_raid_state($1_t)
kernel_getattr_core_if($1_t)
2005-06-10 01:01:13 +00:00
kernel_getattr_message_if($1_t)
kernel_change_ring_buffer_level($1_t)
kernel_clear_ring_buffer($1_t)
kernel_read_ring_buffer($1_t)
kernel_get_sysvipc_info($1_t)
kernel_rw_all_sysctls($1_t)
# signal unlabeled processes:
kernel_kill_unlabeled($1_t)
kernel_signal_unlabeled($1_t)
kernel_sigstop_unlabeled($1_t)
kernel_signull_unlabeled($1_t)
kernel_sigchld_unlabeled($1_t)
2005-07-19 18:40:31 +00:00
corenet_tcp_bind_generic_port($1_t)
# allow setting up tunnels
2006-02-16 21:33:18 +00:00
corenet_rw_tun_tap_dev($1_t)
2005-07-19 18:40:31 +00:00
dev_getattr_generic_blk_files($1_t)
dev_getattr_generic_chr_files($1_t)
2006-09-06 22:07:25 +00:00
# for lsof
dev_getattr_mtrr_dev($1_t)
# Allow MAKEDEV to work
dev_create_all_blk_files($1_t)
dev_create_all_chr_files($1_t)
dev_delete_all_blk_files($1_t)
dev_delete_all_chr_files($1_t)
dev_rename_all_blk_files($1_t)
dev_rename_all_chr_files($1_t)
dev_create_generic_symlinks($1_t)
dev_rw_wireless($1_t)
2005-06-13 17:35:46 +00:00
domain_setpriority_all_domains($1_t)
domain_read_all_domains_state($1_t)
2005-09-16 14:54:36 +00:00
domain_getattr_all_domains($1_t)
domain_dontaudit_ptrace_all_domains($1_t)
# signal all domains:
domain_kill_all_domains($1_t)
domain_signal_all_domains($1_t)
domain_signull_all_domains($1_t)
domain_sigstop_all_domains($1_t)
domain_sigstop_all_domains($1_t)
domain_sigchld_all_domains($1_t)
2005-07-19 18:40:31 +00:00
# for lsof
domain_getattr_all_sockets($1_t)
2005-10-07 18:48:43 +00:00
files_exec_usr_src_files($1_t)
2006-09-06 22:07:25 +00:00
fs_getattr_all_fs($1_t)
fs_set_all_quotas($1_t)
fs_exec_noxattr($1_t)
storage_read_tape($1_t)
storage_write_tape($1_t)
2006-09-06 22:07:25 +00:00
storage_raw_read_removable_device($1_t)
storage_raw_write_removable_device($1_t)
term_use_all_terms($1_t)
auth_getattr_shadow($1_t)
# Manage almost all files
files_manage_non_auth_files($1_t)
files_map_non_auth_files($1_t)
2006-09-06 22:07:25 +00:00
# Relabel almost all files
files_relabel_non_auth_files($1_t)
2006-09-06 22:07:25 +00:00
init_telinit($1_t)
2005-06-13 17:35:46 +00:00
logging_send_syslog_msg($1_t)
modutils_domtrans($1_t)
# The following rule is temporary until such time that a complete
# policy management infrastructure is in place so that an administrator
# cannot directly manipulate policy files with arbitrary programs.
2006-02-02 21:08:12 +00:00
seutil_manage_src_policy($1_t)
# Violates the goal of limiting write access to checkpolicy.
# But presently necessary for installing the file_contexts file.
2006-02-02 21:08:12 +00:00
seutil_manage_bin_policy($1_t)
2008-11-05 16:10:46 +00:00
userdom_manage_user_home_content_dirs($1_t)
userdom_manage_user_home_content_files($1_t)
userdom_manage_user_home_content_symlinks($1_t)
userdom_manage_user_home_content_pipes($1_t)
userdom_manage_user_home_content_sockets($1_t)
userdom_user_home_dir_filetrans_user_home_content($1_t, { dir file lnk_file fifo_file sock_file })
optional_policy(`
postgresql_unconfined($1_t)
')
optional_policy(`
userhelper_exec($1_t)
')
')
########################################
## <summary>
## Allow user to run as a secadm
## </summary>
## <desc>
## <p>
## Create objects in a user home directory
## with an automatic type transition to
## a specified private type.
## </p>
## <p>
## This is a templated interface, and should only
## be called from a per-userdomain template.
## </p>
## </desc>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="role">
## <summary>
## The role of the object to create.
## </summary>
## </param>
#
template(`userdom_security_admin_template',`
allow $1 self:capability { dac_override dac_read_search };
corecmd_exec_shell($1)
domain_obj_id_change_exemption($1)
dev_relabel_all_dev_nodes($1)
files_create_boot_flag($1)
# Necessary for managing /boot/efi
fs_manage_dos_files($1)
kernel_relabelfrom_unlabeled_dirs($1)
kernel_relabelfrom_unlabeled_files($1)
kernel_relabelfrom_unlabeled_symlinks($1)
kernel_relabelfrom_unlabeled_pipes($1)
kernel_relabelfrom_unlabeled_sockets($1)
kernel_relabelfrom_unlabeled_blk_devs($1)
kernel_relabelfrom_unlabeled_chr_devs($1)
mls_process_read_all_levels($1)
mls_file_read_all_levels($1)
mls_file_upgrade($1)
mls_file_downgrade($1)
selinux_set_enforce_mode($1)
selinux_set_all_booleans($1)
selinux_set_parameters($1)
files_relabel_non_auth_files($1)
auth_relabel_shadow($1)
init_exec($1)
logging_send_syslog_msg($1)
logging_read_audit_log($1)
logging_read_generic_logs($1)
logging_read_audit_config($1)
seutil_manage_bin_policy($1)
2011-03-21 15:14:34 +00:00
seutil_run_checkpolicy($1, $2)
seutil_run_loadpolicy($1, $2)
seutil_run_semanage($1, $2)
2008-11-05 16:10:46 +00:00
seutil_run_setfiles($1, $2)
optional_policy(`
2011-03-21 15:14:34 +00:00
aide_run($1, $2)
')
optional_policy(`
consoletype_exec($1)
')
optional_policy(`
dmesg_exec($1)
')
2011-03-21 15:14:34 +00:00
optional_policy(`
ipsec_run_setkey($1, $2)
')
optional_policy(`
2011-03-21 15:14:34 +00:00
netlabel_run_mgmt($1, $2)
2005-09-19 21:17:45 +00:00
')
2010-12-15 16:02:29 +00:00
optional_policy(`
samhain_run($1, $2)
')
2005-05-18 13:18:49 +00:00
')
2005-05-18 21:00:30 +00:00
########################################
## <summary>
## Make the specified type usable as
## a user application domain type.
## </summary>
## <param name="type">
## <summary>
## Type to be used as a user application domain.
## </summary>
## </param>
#
interface(`userdom_user_application_type',`
application_type($1)
ubac_constrained($1)
')
########################################
## <summary>
## Make the specified type usable as
## a user application domain.
## </summary>
## <param name="type">
## <summary>
## Type to be used as a user application domain.
## </summary>
## </param>
## <param name="type">
## <summary>
## Type to be used as the domain entry point.
## </summary>
## </param>
#
interface(`userdom_user_application_domain',`
application_domain($1, $2)
ubac_constrained($1)
')
2006-09-11 15:26:25 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Make the specified type usable in a
## user home directory.
2006-09-11 15:26:25 +00:00
## </summary>
2008-11-05 16:10:46 +00:00
## <param name="type">
2006-09-11 15:26:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Type to be used as a file in the
## user home directory.
2006-09-11 15:26:25 +00:00
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_user_home_content',`
gen_require(`
attribute user_home_content_type;
2008-11-05 16:10:46 +00:00
type user_home_t;
')
typeattribute $1 user_home_content_type;
2008-11-05 16:10:46 +00:00
allow $1 user_home_t:filesystem associate;
files_type($1)
files_poly_member($1)
2008-11-05 16:10:46 +00:00
ubac_constrained($1)
2006-09-11 15:26:25 +00:00
')
########################################
## <summary>
## Make the specified type usable as a
## user temporary file.
## </summary>
## <param name="type">
## <summary>
## Type to be used as a file in the
## temporary directories.
## </summary>
## </param>
#
interface(`userdom_user_tmp_file',`
files_tmp_file($1)
ubac_constrained($1)
')
########################################
## <summary>
## Make the specified type usable as a
## user tmpfs file.
## </summary>
## <param name="type">
## <summary>
## Type to be used as a file in
## tmpfs directories.
## </summary>
## </param>
#
interface(`userdom_user_tmpfs_file',`
files_tmpfs_file($1)
ubac_constrained($1)
')
2009-08-31 12:44:11 +00:00
########################################
## <summary>
## Allow domain to attach to TUN devices created by administrative users.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_attach_admin_tun_iface',`
gen_require(`
2009-08-31 13:03:51 +00:00
attribute admindomain;
2009-08-31 12:44:11 +00:00
')
2009-08-31 13:03:51 +00:00
allow $1 admindomain:tun_socket relabelfrom;
2009-08-31 12:44:11 +00:00
allow $1 self:tun_socket relabelto;
')
2006-09-11 15:26:25 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Set the attributes of a user pty.
2006-09-11 15:26:25 +00:00
## </summary>
2008-11-05 16:10:46 +00:00
## <param name="domain">
2006-09-11 15:26:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
2006-09-11 15:26:25 +00:00
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_setattr_user_ptys',`
gen_require(`
type user_devpts_t;
')
allow $1 user_devpts_t:chr_file setattr_chr_file_perms;
2006-09-11 15:26:25 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create a user pty.
2006-09-11 15:26:25 +00:00
## </summary>
2008-11-05 16:10:46 +00:00
## <param name="domain">
2006-09-11 15:26:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
2006-09-11 15:26:25 +00:00
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_create_user_pty',`
gen_require(`
type user_devpts_t;
')
term_create_pty($1, user_devpts_t)
2006-09-11 15:26:25 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Get the attributes of user home directories.
2006-09-11 15:26:25 +00:00
## </summary>
2008-11-05 16:10:46 +00:00
## <param name="domain">
2006-09-11 15:26:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
2006-09-11 15:26:25 +00:00
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_getattr_user_home_dirs',`
gen_require(`
type user_home_dir_t;
')
allow $1 user_home_dir_t:dir getattr_dir_perms;
files_search_home($1)
2006-09-11 15:26:25 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to get the attributes of user home directories.
2006-09-11 15:26:25 +00:00
## </summary>
2008-11-05 16:10:46 +00:00
## <param name="domain">
2006-09-11 15:26:25 +00:00
## <summary>
## Domain to not audit.
2006-09-11 15:26:25 +00:00
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_getattr_user_home_dirs',`
gen_require(`
type user_home_dir_t;
')
dontaudit $1 user_home_dir_t:dir getattr_dir_perms;
2006-09-11 15:26:25 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Search user home directories.
2006-09-11 15:26:25 +00:00
## </summary>
2008-11-05 16:10:46 +00:00
## <param name="domain">
2006-09-11 15:26:25 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
2006-09-11 15:26:25 +00:00
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_search_user_home_dirs',`
gen_require(`
type user_home_dir_t;
')
allow $1 user_home_dir_t:dir search_dir_perms;
files_search_home($1)
2006-09-11 15:26:25 +00:00
')
########################################
## <summary>
## Do not audit attempts to search user home directories.
2006-09-11 15:26:25 +00:00
## </summary>
## <desc>
## <p>
## Do not audit attempts to search user home directories.
## This will suppress SELinux denial messages when the specified
## domain is denied the permission to search these directories.
## </p>
## </desc>
2008-11-05 16:10:46 +00:00
## <param name="domain">
2006-09-11 15:26:25 +00:00
## <summary>
## Domain to not audit.
2006-09-11 15:26:25 +00:00
## </summary>
## </param>
## <infoflow type="none"/>
2006-09-11 15:26:25 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_search_user_home_dirs',`
gen_require(`
type user_home_dir_t;
')
dontaudit $1 user_home_dir_t:dir search_dir_perms;
2006-09-11 15:26:25 +00:00
')
########################################
## <summary>
2008-12-03 19:16:20 +00:00
## List user home directories.
2006-09-11 15:26:25 +00:00
## </summary>
2008-11-05 16:10:46 +00:00
## <param name="domain">
2006-09-11 15:26:25 +00:00
## <summary>
2008-12-03 19:16:20 +00:00
## Domain allowed access.
2006-09-11 15:26:25 +00:00
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_list_user_home_dirs',`
gen_require(`
type user_home_dir_t;
')
2006-09-11 15:26:25 +00:00
2008-11-05 16:10:46 +00:00
allow $1 user_home_dir_t:dir list_dir_perms;
files_search_home($1)
2006-01-12 16:00:55 +00:00
')
2006-01-18 16:40:04 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to list user home subdirectories.
2006-01-18 16:40:04 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
2006-01-18 16:40:04 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_list_user_home_dirs',`
2006-01-18 16:40:04 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_home_dir_t;
2006-01-18 16:40:04 +00:00
')
2008-11-05 16:10:46 +00:00
dontaudit $1 user_home_dir_t:dir list_dir_perms;
2006-01-18 16:40:04 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create user home directories.
2006-01-18 16:40:04 +00:00
## </summary>
## <param name="domain">
## <summary>
2006-01-18 16:40:04 +00:00
## Domain allowed access.
## </summary>
2006-01-18 16:40:04 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_create_user_home_dirs',`
gen_require(`
type user_home_dir_t;
')
allow $1 user_home_dir_t:dir create_dir_perms;
2006-01-18 16:40:04 +00:00
')
########################################
## <summary>
## Manage user home directories.
2006-01-18 16:40:04 +00:00
## </summary>
## <param name="domain">
## <summary>
2006-01-18 16:40:04 +00:00
## Domain allowed access.
## </summary>
2006-01-18 16:40:04 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_home_dirs',`
2006-01-18 16:40:04 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_home_dir_t;
2006-01-18 16:40:04 +00:00
')
2008-11-05 16:10:46 +00:00
allow $1 user_home_dir_t:dir manage_dir_perms;
2006-01-18 16:40:04 +00:00
')
2005-05-26 20:38:45 +00:00
########################################
2005-06-27 16:30:55 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Relabel to user home directories.
2005-06-27 16:30:55 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
2005-05-26 20:38:45 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_relabelto_user_home_dirs',`
gen_require(`
type user_home_dir_t;
')
2005-05-26 20:38:45 +00:00
2008-11-05 16:10:46 +00:00
allow $1 user_home_dir_t:dir relabelto;
2006-01-18 16:40:04 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create directories in the home dir root with
## the user home directory type.
2006-01-18 16:40:04 +00:00
## </summary>
## <param name="domain">
## <summary>
2006-01-18 16:40:04 +00:00
## Domain allowed access.
## </summary>
2006-01-18 16:40:04 +00:00
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
2006-01-18 16:40:04 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_home_filetrans_user_home_dir',`
gen_require(`
type user_home_dir_t;
')
2006-01-18 16:40:04 +00:00
files_home_filetrans($1, user_home_dir_t, dir, $2)
2006-01-18 16:40:04 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do a domain transition to the specified
## domain when executing a program in the
## user home directory.
## </summary>
## <desc>
## <p>
2008-11-05 16:10:46 +00:00
## Do a domain transition to the specified
## domain when executing a program in the
## user home directory.
## </p>
## <p>
2008-11-05 16:10:46 +00:00
## No interprocess communication (signals, pipes,
## etc.) is provided by this interface since
## the domains are not owned by this module.
## </p>
## </desc>
2008-11-05 16:10:46 +00:00
## <param name="source_domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
2008-11-05 16:10:46 +00:00
## <param name="target_domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain to transition to.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_user_home_domtrans',`
gen_require(`
type user_home_dir_t, user_home_t;
')
domain_auto_transition_pattern($1, user_home_t, $2)
2008-11-05 16:10:46 +00:00
allow $1 user_home_dir_t:dir search_dir_perms;
files_search_home($1)
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to search user home content directories.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_search_user_home_content',`
gen_require(`
type user_home_t;
')
2008-11-05 16:10:46 +00:00
dontaudit $1 user_home_t:dir search_dir_perms;
')
########################################
## <summary>
## List all users home content directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_list_all_user_home_content',`
gen_require(`
attribute user_home_content_type;
')
userdom_search_user_home_dirs($1)
allow $1 user_home_content_type:dir list_dir_perms;
')
########################################
## <summary>
## List contents of users home directory.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_list_user_home_content',`
gen_require(`
type user_home_t;
')
allow $1 user_home_t:dir list_dir_perms;
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create, read, write, and delete directories
## in a user home subdirectory.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_home_content_dirs',`
gen_require(`
type user_home_dir_t, user_home_t;
')
manage_dirs_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
files_search_home($1)
')
########################################
## <summary>
## Delete all user home content directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_all_user_home_content_dirs',`
gen_require(`
attribute user_home_content_type;
type user_home_dir_t;
')
userdom_search_user_home_dirs($1)
delete_files_pattern($1, { user_home_dir_t user_home_content_type }, user_home_content_type)
')
2009-07-28 13:35:46 +00:00
########################################
## <summary>
## Delete directories in a user home subdirectory.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_user_home_content_dirs',`
gen_require(`
type user_home_t;
')
allow $1 user_home_t:dir delete_dir_perms;
')
########################################
## <summary>
## Set attributes of all user home content directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_setattr_all_user_home_content_dirs',`
gen_require(`
attribute user_home_content_type;
')
userdom_search_user_home_dirs($1)
allow $1 user_home_content_type:dir setattr_dir_perms;
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to set the
## attributes of user home files.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_setattr_user_home_content_files',`
gen_require(`
type user_home_t;
')
dontaudit $1 user_home_t:file setattr_file_perms;
')
########################################
## <summary>
## Map user home files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_map_user_home_content_files',`
gen_require(`
type user_home_t;
')
allow $1 user_home_t:file map;
')
2005-06-30 18:54:08 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Mmap user home files.
2005-06-30 18:54:08 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-06-30 18:54:08 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_mmap_user_home_content_files',`
gen_require(`
type user_home_dir_t, user_home_t;
')
2005-06-30 18:54:08 +00:00
mmap_exec_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
2008-11-05 16:10:46 +00:00
files_search_home($1)
2005-09-27 19:40:44 +00:00
')
2005-11-08 22:00:30 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Read user home files.
2005-11-08 22:00:30 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-11-08 22:00:30 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_read_user_home_content_files',`
gen_require(`
type user_home_dir_t, user_home_t;
')
read_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
files_search_home($1)
2005-11-08 22:00:30 +00:00
')
########################################
2005-06-27 16:30:55 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to read user home files.
2005-06-27 16:30:55 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain to not audit.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
2005-05-18 21:00:30 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_read_user_home_content_files',`
gen_require(`
type user_home_t;
')
dontaudit $1 user_home_t:dir list_dir_perms;
dontaudit $1 user_home_t:file read_file_perms;
2005-06-30 18:54:08 +00:00
')
########################################
## <summary>
## Read all user home content, including application-specific resources.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access
## </summary>
## </param>
#
interface(`userdom_read_all_user_home_content',`
gen_require(`
attribute user_home_content_type;
')
list_dirs_pattern($1, user_home_content_type, user_home_content_type)
read_files_pattern($1, user_home_content_type, user_home_content_type)
read_lnk_files_pattern($1, user_home_content_type, user_home_content_type)
read_fifo_files_pattern($1, user_home_content_type, user_home_content_type)
read_sock_files_pattern($1, user_home_content_type, user_home_content_type)
')
########################################
## <summary>
## Manage all user home content, including application-specific resources.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access
## </summary>
## </param>
#
interface(`userdom_manage_all_user_home_content',`
gen_require(`
tunable-managed user content access template To simplify policy management on the various application domains with respect to user content access, a template is introduced which generates four tunable_policy() blocks. - The *_read_generic_user_content boolean will enable the application domain to read generic user resources (labeled with user_home_t). - The *_read_all_user_content boolean does the same, but for all user resources (those associated with the user_home_content_type attribute). - The *_manage_generic_user_content boolean enables the application to manage generic user resources (labeled with user_home_t) - The *_manage_all_user_content boolean does the same, but for all user reosurces (those associated with the user_home_content_type attribute). Although it would be even better to generate the booleans themselves as well (which is what Gentoo does with this template), it would result in booleans without proper documentation. Calls such as "semanage boolean -l" would fail to properly show a description on the boolean - something Gentoo resolves by keeping this documentation separate in a doc/gentoo_tunables.xml file. In this patch, we assume that the calling modules will define the booleans themselves (with appropriate documentation). The template checks for the existence of the booleans. This approach is more in line with how domain-specific booleans are managed up to now. Changes since v2: - Fix typo in gen_require (had a closing : instead of ;) Changes since v1: - Use in-line XML comment and tunable definition Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
2018-03-25 11:56:41 +00:00
attribute user_home_content_type;
')
manage_dirs_pattern($1, user_home_content_type, user_home_content_type)
manage_files_pattern($1, user_home_content_type, user_home_content_type)
manage_lnk_files_pattern($1, user_home_content_type, user_home_content_type)
manage_fifo_files_pattern($1, user_home_content_type, user_home_content_type)
manage_sock_files_pattern($1, user_home_content_type, user_home_content_type)
')
2005-07-15 20:45:26 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to append user home files.
2005-07-15 20:45:26 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-07-15 20:45:26 +00:00
## Domain to not audit.
## </summary>
2005-07-15 20:45:26 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_append_user_home_content_files',`
gen_require(`
type user_home_t;
')
dontaudit $1 user_home_t:file append_file_perms;
2005-07-15 20:45:26 +00:00
')
2005-06-30 18:54:08 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to write user home files.
2005-06-30 18:54:08 +00:00
## </summary>
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain to not audit.
## </summary>
2005-06-30 18:54:08 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_write_user_home_content_files',`
gen_require(`
type user_home_t;
')
dontaudit $1 user_home_t:file write_file_perms;
')
########################################
## <summary>
## Delete all user home content files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_all_user_home_content_files',`
gen_require(`
attribute user_home_content_type;
type user_home_dir_t;
')
userdom_search_user_home_content($1)
delete_files_pattern($1, { user_home_dir_t user_home_content_type }, user_home_content_type)
')
2009-07-28 13:35:46 +00:00
########################################
## <summary>
## Delete files in a user home subdirectory.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_user_home_content_files',`
gen_require(`
type user_home_t;
')
allow $1 user_home_t:file delete_file_perms;
')
2005-10-07 21:45:04 +00:00
########################################
## <summary>
## Do not audit attempts to relabel user home files.
2005-10-07 21:45:04 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-10-07 21:45:04 +00:00
## Domain to not audit.
## </summary>
2005-10-07 21:45:04 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_relabel_user_home_content_files',`
gen_require(`
type user_home_t;
')
dontaudit $1 user_home_t:file relabel_file_perms;
2005-10-07 21:45:04 +00:00
')
2005-06-21 21:07:46 +00:00
########################################
2005-06-27 16:30:55 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Read user home subdirectory symbolic links.
2005-06-27 16:30:55 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
2005-06-21 21:07:46 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_read_user_home_content_symlinks',`
gen_require(`
type user_home_dir_t, user_home_t;
')
read_lnk_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
files_search_home($1)
')
2005-06-08 13:12:00 +00:00
########################################
2005-06-27 16:30:55 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Execute user home files.
2005-06-27 16:30:55 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
2008-11-05 16:10:46 +00:00
## <rolecap/>
2005-06-08 13:12:00 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_exec_user_home_content_files',`
gen_require(`
type user_home_dir_t, user_home_t;
')
files_search_home($1)
exec_files_pattern($1, { user_home_dir_t user_home_t }, user_home_t)
tunable_policy(`use_nfs_home_dirs',`
fs_exec_nfs_files($1)
')
tunable_policy(`use_samba_home_dirs',`
fs_exec_cifs_files($1)
')
2005-06-08 13:12:00 +00:00
')
2005-06-30 18:54:08 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to execute user home files.
2005-06-30 18:54:08 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
2005-06-30 18:54:08 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_exec_user_home_content_files',`
gen_require(`
type user_home_t;
')
dontaudit $1 user_home_t:file exec_file_perms;
2005-06-30 18:54:08 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create, read, write, and delete files
## in a user home subdirectory.
2005-06-30 18:54:08 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-06-30 18:54:08 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_home_content_files',`
gen_require(`
type user_home_dir_t, user_home_t;
')
manage_files_pattern($1, user_home_t, user_home_t)
allow $1 user_home_dir_t:dir search_dir_perms;
files_search_home($1)
2005-06-30 18:54:08 +00:00
')
2005-10-11 15:36:53 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to create, read, write, and delete directories
## in a user home subdirectory.
2005-10-11 15:36:53 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
2005-10-11 15:36:53 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_manage_user_home_content_dirs',`
gen_require(`
type user_home_t;
2008-11-05 16:10:46 +00:00
')
dontaudit $1 user_home_t:dir manage_dir_perms;
2005-10-11 15:36:53 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create, read, write, and delete symbolic links
## in a user home subdirectory.
## </summary>
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_home_content_symlinks',`
gen_require(`
type user_home_dir_t, user_home_t;
')
manage_lnk_files_pattern($1, user_home_t, user_home_t)
allow $1 user_home_dir_t:dir search_dir_perms;
files_search_home($1)
')
########################################
## <summary>
## Delete all user home content symbolic links.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_all_user_home_content_symlinks',`
gen_require(`
attribute user_home_content_type;
type user_home_dir_t;
')
userdom_search_user_home_dirs($1)
delete_lnk_files_pattern($1, { user_home_dir_t user_home_content_type }, user_home_content_type)
')
2009-07-28 13:35:46 +00:00
########################################
## <summary>
## Delete symbolic links in a user home directory.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_user_home_content_symlinks',`
gen_require(`
type user_home_t;
')
allow $1 user_home_t:lnk_file delete_lnk_file_perms;
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create, read, write, and delete named pipes
## in a user home subdirectory.
## </summary>
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_home_content_pipes',`
gen_require(`
type user_home_dir_t, user_home_t;
')
manage_fifo_files_pattern($1, user_home_t, user_home_t)
allow $1 user_home_dir_t:dir search_dir_perms;
files_search_home($1)
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create, read, write, and delete named sockets
## in a user home subdirectory.
## </summary>
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_home_content_sockets',`
gen_require(`
type user_home_dir_t, user_home_t;
')
allow $1 user_home_dir_t:dir search_dir_perms;
manage_sock_files_pattern($1, user_home_t, user_home_t)
files_search_home($1)
')
2005-11-08 22:00:30 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create objects in a user home directory
## with an automatic type transition to
## a specified private type.
2005-11-08 22:00:30 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-11-08 22:00:30 +00:00
## </param>
2008-11-05 16:10:46 +00:00
## <param name="private_type">
## <summary>
2008-11-05 16:10:46 +00:00
## The type of the object to create.
## </summary>
2005-09-05 16:47:19 +00:00
## </param>
2008-11-05 16:10:46 +00:00
## <param name="object_class">
## <summary>
2008-11-05 16:10:46 +00:00
## The class of the object to be created.
## </summary>
2006-01-18 14:48:24 +00:00
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
2006-01-18 14:48:24 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_user_home_dir_filetrans',`
gen_require(`
type user_home_dir_t;
')
filetrans_pattern($1, user_home_dir_t, $2, $3, $4)
2008-11-05 16:10:46 +00:00
files_search_home($1)
2006-01-18 14:48:24 +00:00
')
2005-10-22 19:58:58 +00:00
########################################
## <summary>
## Create objects in a directory located
## in a user home directory with an
## automatic type transition to
2008-11-05 16:10:46 +00:00
## a specified private type.
2005-10-22 19:58:58 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-10-22 19:58:58 +00:00
## Domain allowed access.
## </summary>
2005-10-22 19:58:58 +00:00
## </param>
2008-11-05 16:10:46 +00:00
## <param name="private_type">
## <summary>
2008-11-05 16:10:46 +00:00
## The type of the object to create.
## </summary>
2006-02-03 14:48:12 +00:00
## </param>
## <param name="object_class">
## <summary>
2005-10-22 19:58:58 +00:00
## The class of the object to be created.
## </summary>
2005-10-22 19:58:58 +00:00
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
2005-10-22 19:58:58 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_user_home_content_filetrans',`
gen_require(`
type user_home_dir_t, user_home_t;
')
filetrans_pattern($1, user_home_t, $2, $3, $4)
2008-11-05 16:10:46 +00:00
allow $1 user_home_dir_t:dir search_dir_perms;
files_search_home($1)
2005-10-22 19:58:58 +00:00
')
########################################
## <summary>
## Automatically use the user_cert_t label for selected resources
## created in a users home directory
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access
## </summary>
## </param>
## <param name="class">
## <summary>
## Resource type(s) for which the label should be used
## </summary>
## </param>
## <param name="filename" optional="true">
## <summary>
## Name of the resource that is being created
## </summary>
## </param>
#
interface(`userdom_user_home_dir_filetrans_user_cert',`
gen_require(`
type user_cert_t;
')
userdom_user_home_dir_filetrans($1, user_cert_t, $2, $3)
')
2005-10-22 19:58:58 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create objects in a user home directory
## with an automatic type transition to
## the user home file type.
2005-10-22 19:58:58 +00:00
## </summary>
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
## </summary>
## </param>
## <param name="object_class">
## <summary>
## The class of the object to be created.
## </summary>
2005-10-22 19:58:58 +00:00
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
2005-10-22 19:58:58 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_user_home_dir_filetrans_user_home_content',`
gen_require(`
type user_home_dir_t, user_home_t;
')
filetrans_pattern($1, user_home_dir_t, user_home_t, $2, $3)
2008-11-05 16:10:46 +00:00
files_search_home($1)
2005-10-22 19:58:58 +00:00
')
########################################
## <summary>
## Read user SSL certificates.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`userdom_read_user_certs',`
gen_require(`
type user_cert_t;
')
allow $1 user_cert_t:dir list_dir_perms;
read_files_pattern($1, user_cert_t, user_cert_t)
read_lnk_files_pattern($1, user_cert_t, user_cert_t)
files_search_home($1)
')
########################################
## <summary>
## Do not audit attempts to manage
## the user SSL certificates.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <rolecap/>
#
interface(`userdom_dontaudit_manage_user_certs',`
gen_require(`
type user_cert_t;
')
dontaudit $1 user_cert_t:dir manage_dir_perms;
dontaudit $1 user_cert_t:file manage_file_perms;
dontaudit $1 user_cert_t:lnk_file manage_lnk_file_perms;
')
########################################
## <summary>
## Manage user SSL certificates.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_manage_user_certs',`
gen_require(`
type user_cert_t;
')
manage_dirs_pattern($1, user_cert_t, user_cert_t)
manage_files_pattern($1, user_cert_t, user_cert_t)
manage_lnk_files_pattern($1, user_cert_t, user_cert_t)
files_search_home($1)
')
2005-06-30 18:54:08 +00:00
########################################
## <summary>
2008-12-03 19:16:20 +00:00
## Write to user temporary named sockets.
2005-06-30 18:54:08 +00:00
## </summary>
## <param name="domain">
## <summary>
2008-12-03 19:16:20 +00:00
## Domain allowed access.
## </summary>
2005-06-30 18:54:08 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_write_user_tmp_sockets',`
gen_require(`
type user_tmp_t;
')
allow $1 user_tmp_t:sock_file write_sock_file_perms;
2008-11-05 16:10:46 +00:00
files_search_tmp($1)
userdom_search_user_runtime($1)
')
2005-06-30 18:54:08 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## List user temporary directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_list_user_tmp',`
gen_require(`
type user_tmp_t, user_runtime_t;
2008-11-05 16:10:46 +00:00
')
allow $1 user_tmp_t:dir list_dir_perms;
allow $1 user_runtime_t:dir list_dir_perms;
2008-11-05 16:10:46 +00:00
files_search_tmp($1)
userdom_search_user_runtime($1)
2005-06-30 18:54:08 +00:00
')
2006-03-28 18:29:52 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to list user
## temporary directories.
2006-03-28 18:29:52 +00:00
## </summary>
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain to not audit.
2006-03-28 18:29:52 +00:00
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_list_user_tmp',`
2006-03-28 18:29:52 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
2006-03-28 18:29:52 +00:00
')
2008-11-05 16:10:46 +00:00
dontaudit $1 user_tmp_t:dir list_dir_perms;
2006-03-28 18:29:52 +00:00
')
########################################
## <summary>
## Delete users temporary directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_user_tmp_dirs',`
gen_require(`
type user_tmp_t;
')
delete_dirs_pattern($1, user_tmp_t, user_tmp_t)
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to manage users
## temporary directories.
## </summary>
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain to not audit.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_manage_user_tmp_dirs',`
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
')
2008-11-05 16:10:46 +00:00
dontaudit $1 user_tmp_t:dir manage_dir_perms;
')
########################################
2005-06-27 16:30:55 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Read user temporary files.
2005-06-27 16:30:55 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_read_user_tmp_files',`
2005-06-21 21:07:46 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
2005-06-21 21:07:46 +00:00
')
2008-11-05 16:10:46 +00:00
read_files_pattern($1, user_tmp_t, user_tmp_t)
allow $1 user_tmp_t:dir list_dir_perms;
files_search_tmp($1)
userdom_search_user_runtime($1)
')
########################################
## <summary>
## Map user temporary files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_map_user_tmp_files',`
gen_require(`
type user_tmp_t;
')
allow $1 user_tmp_t:file map;
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to read users
## temporary files.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_read_user_tmp_files',`
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
')
2008-11-05 16:10:46 +00:00
dontaudit $1 user_tmp_t:file read_file_perms;
')
########################################
2005-06-27 16:30:55 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to append users
## temporary files.
2005-06-27 16:30:55 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain to not audit.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_append_user_tmp_files',`
2005-06-21 21:07:46 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
2005-06-21 21:07:46 +00:00
')
dontaudit $1 user_tmp_t:file append_file_perms;
')
2005-10-05 19:52:53 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Read and write user temporary files.
2005-10-05 19:52:53 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-10-05 19:52:53 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_rw_user_tmp_files',`
2005-10-05 19:52:53 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
2005-10-05 19:52:53 +00:00
')
2008-11-05 16:10:46 +00:00
allow $1 user_tmp_t:dir list_dir_perms;
rw_files_pattern($1, user_tmp_t, user_tmp_t)
files_search_tmp($1)
userdom_search_user_runtime($1)
2005-10-05 19:52:53 +00:00
')
########################################
## <summary>
## Delete users temporary files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_user_tmp_files',`
gen_require(`
type user_tmp_t;
')
delete_files_pattern($1, user_tmp_t, user_tmp_t)
')
2005-10-05 19:52:53 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to manage users
## temporary files.
2005-10-05 19:52:53 +00:00
## </summary>
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain to not audit.
## </summary>
2005-10-05 19:52:53 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_manage_user_tmp_files',`
2005-10-05 19:52:53 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
2005-10-05 19:52:53 +00:00
')
2008-11-05 16:10:46 +00:00
dontaudit $1 user_tmp_t:file manage_file_perms;
2005-10-05 19:52:53 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Read user temporary symbolic links.
2005-10-05 19:52:53 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-10-05 19:52:53 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_read_user_tmp_symlinks',`
2005-10-05 19:52:53 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
2005-10-05 19:52:53 +00:00
')
2008-11-05 16:10:46 +00:00
read_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
allow $1 user_tmp_t:dir list_dir_perms;
files_search_tmp($1)
userdom_search_user_runtime($1)
2005-10-05 19:52:53 +00:00
')
########################################
## <summary>
## Delete users temporary symbolic links.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_user_tmp_symlinks',`
gen_require(`
type user_tmp_t;
')
delete_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
')
2005-10-25 17:50:00 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create, read, write, and delete user
## temporary directories.
2005-10-25 17:50:00 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-10-25 17:50:00 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_tmp_dirs',`
2005-10-25 17:50:00 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
2005-10-25 17:50:00 +00:00
')
2008-11-05 16:10:46 +00:00
manage_dirs_pattern($1, user_tmp_t, user_tmp_t)
files_search_tmp($1)
userdom_search_user_runtime($1)
2005-10-25 17:50:00 +00:00
')
########################################
## <summary>
## Delete users temporary named pipes.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_user_tmp_named_pipes',`
gen_require(`
type user_tmp_t;
')
delete_fifo_files_pattern($1, user_tmp_t, user_tmp_t)
')
########################################
2005-06-27 16:30:55 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Create, read, write, and delete user
## temporary files.
2005-06-27 16:30:55 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-06-27 16:30:55 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_tmp_files',`
2005-06-27 16:30:55 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
2005-06-27 16:30:55 +00:00
')
2008-11-05 16:10:46 +00:00
manage_files_pattern($1, user_tmp_t, user_tmp_t)
files_search_tmp($1)
userdom_search_user_runtime($1)
2005-06-27 16:30:55 +00:00
')
########################################
## <summary>
## Delete users temporary named sockets.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_user_tmp_named_sockets',`
gen_require(`
type user_tmp_t;
')
delete_sock_files_pattern($1, user_tmp_t, user_tmp_t)
')
2005-06-27 16:30:55 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create, read, write, and delete user
## temporary symbolic links.
2005-06-27 16:30:55 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
2005-05-18 21:00:30 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_tmp_symlinks',`
2005-06-21 21:07:46 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
2005-06-21 21:07:46 +00:00
')
2008-11-05 16:10:46 +00:00
manage_lnk_files_pattern($1, user_tmp_t, user_tmp_t)
files_search_tmp($1)
userdom_search_user_runtime($1)
2005-05-18 21:00:30 +00:00
')
########################################
2005-06-27 16:30:55 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Create, read, write, and delete user
## temporary named pipes.
2005-06-27 16:30:55 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_tmp_pipes',`
2005-06-21 21:07:46 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
2005-06-21 21:07:46 +00:00
')
2008-11-05 16:10:46 +00:00
manage_fifo_files_pattern($1, user_tmp_t, user_tmp_t)
files_search_tmp($1)
userdom_search_user_runtime($1)
')
2005-06-21 21:07:46 +00:00
########################################
2005-06-27 16:30:55 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Create, read, write, and delete user
## temporary named sockets.
2005-06-27 16:30:55 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
2005-08-17 14:14:07 +00:00
## Domain allowed access.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
2005-06-21 21:07:46 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_user_tmp_sockets',`
gen_require(`
type user_tmp_t;
')
manage_sock_files_pattern($1, user_tmp_t, user_tmp_t)
files_search_tmp($1)
userdom_search_user_runtime($1)
')
2005-10-26 21:03:19 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Create objects in a user temporary directory
## with an automatic type transition to
## a specified private type.
2005-10-26 21:03:19 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-10-26 21:03:19 +00:00
## Domain allowed access.
## </summary>
2005-10-26 21:03:19 +00:00
## </param>
2008-11-05 16:10:46 +00:00
## <param name="private_type">
## <summary>
## The type of the object to create.
## </summary>
## </param>
## <param name="object_class">
## <summary>
## The class of the object to be created.
## </summary>
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
2005-10-26 21:03:19 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_user_tmp_filetrans',`
gen_require(`
type user_tmp_t;
')
filetrans_pattern($1, user_tmp_t, $2, $3, $4)
2008-11-05 16:10:46 +00:00
files_search_tmp($1)
userdom_search_user_runtime($1)
2005-10-26 21:03:19 +00:00
')
########################################
2005-06-27 16:30:55 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Create objects in the temporary directory
## with an automatic type transition to
## the user temporary type.
2005-08-17 14:14:07 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-08-17 14:14:07 +00:00
## Domain allowed access.
## </summary>
2005-08-17 14:14:07 +00:00
## </param>
## <param name="object_class">
## <summary>
2005-08-17 14:14:07 +00:00
## The class of the object to be created.
## </summary>
2005-08-17 14:14:07 +00:00
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
2005-08-17 14:14:07 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_tmp_filetrans_user_tmp',`
gen_require(`
type user_tmp_t;
')
files_tmp_filetrans($1, user_tmp_t, $2, $3)
2005-08-17 14:14:07 +00:00
')
########################################
## <summary>
## Map user tmpfs files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_map_user_tmpfs_files',`
gen_require(`
type user_tmpfs_t;
')
allow $1 user_tmpfs_t:file map;
')
2009-08-31 13:38:47 +00:00
########################################
## <summary>
## Read user tmpfs files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_read_user_tmpfs_files',`
gen_require(`
type user_tmpfs_t;
')
read_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
allow $1 user_tmpfs_t:dir list_dir_perms;
fs_search_tmpfs($1)
')
########################################
## <summary>
## dontaudit Read attempts of user tmpfs files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_dontaudit_read_user_tmpfs_files',`
gen_require(`
type user_tmpfs_t;
')
dontaudit $1 user_tmpfs_t:file read_file_perms;
dontaudit $1 user_tmpfs_t:dir list_dir_perms;
')
########################################
## <summary>
## relabel to/from user tmpfs dirs
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_relabel_user_tmpfs_dirs',`
gen_require(`
type user_tmpfs_t;
')
allow $1 user_tmpfs_t:dir { list_dir_perms relabel_dir_perms };
fs_search_tmpfs($1)
')
########################################
## <summary>
## relabel to/from user tmpfs files
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_relabel_user_tmpfs_files',`
gen_require(`
type user_tmpfs_t;
')
allow $1 user_tmpfs_t:dir list_dir_perms;
allow $1 user_tmpfs_t:file relabel_file_perms;
fs_search_tmpfs($1)
')
########################################
## <summary>
## Make the specified type usable in
## the directory /run/user/%{USERID}/.
## </summary>
## <param name="type">
## <summary>
## Type to be used as a file in the
## user_runtime_content_dir_t.
## </summary>
## </param>
#
interface(`userdom_user_runtime_content',`
gen_require(`
attribute user_runtime_content_type;
')
typeattribute $1 user_runtime_content_type;
files_type($1)
ubac_constrained($1)
')
########################################
## <summary>
## Search users runtime directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_search_user_runtime',`
gen_require(`
type user_runtime_t;
')
allow $1 user_runtime_t:dir search_dir_perms;
userdom_search_user_runtime_root($1)
')
########################################
## <summary>
## Search user runtime root directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_search_user_runtime_root',`
gen_require(`
type user_runtime_root_t;
')
allow $1 user_runtime_root_t:dir search_dir_perms;
files_search_runtime($1)
')
########################################
## <summary>
## Create, read, write, and delete user
## runtime root dirs.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_manage_user_runtime_root_dirs',`
gen_require(`
type user_runtime_root_t;
')
allow $1 user_runtime_root_t:dir manage_dir_perms;
files_search_runtime($1)
')
########################################
## <summary>
## Relabel to and from user runtime root dirs.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_relabel_user_runtime_root_dirs',`
gen_require(`
type user_runtime_root_t;
')
allow $1 user_runtime_root_t:dir relabel_dir_perms;
')
########################################
## <summary>
## Create, read, write, and delete user
## runtime dirs.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_manage_user_runtime_dirs',`
gen_require(`
type user_runtime_t;
')
allow $1 user_runtime_t:dir manage_dir_perms;
userdom_search_user_runtime_root($1)
')
########################################
## <summary>
## Mount a filesystem on user runtime dir
## directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_mounton_user_runtime_dirs',`
gen_require(`
type user_runtime_t;
')
allow $1 user_runtime_t:dir mounton;
')
########################################
## <summary>
## Relabel to user runtime directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_relabelto_user_runtime_dirs',`
gen_require(`
type user_runtime_t;
')
allow $1 user_runtime_t:dir relabelto;
')
########################################
## <summary>
## Relabel from user runtime directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_relabelfrom_user_runtime_dirs',`
gen_require(`
type user_runtime_t;
')
allow $1 user_runtime_t:dir relabelfrom;
')
########################################
## <summary>
## delete user runtime files
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_user_runtime_files',`
gen_require(`
type user_runtime_t;
')
allow $1 user_runtime_t:dir list_dir_perms;
allow $1 user_runtime_t:file delete_file_perms;
')
########################################
## <summary>
## Search users runtime directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_search_all_user_runtime',`
gen_require(`
attribute user_runtime_content_type;
')
allow $1 user_runtime_content_type:dir search_dir_perms;
userdom_search_user_runtime_root($1)
')
########################################
## <summary>
## List user runtime directories.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_list_all_user_runtime',`
gen_require(`
attribute user_runtime_content_type;
')
allow $1 user_runtime_content_type:dir list_dir_perms;
userdom_search_user_runtime($1)
')
########################################
## <summary>
## delete user runtime directories
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_all_user_runtime_dirs',`
gen_require(`
attribute user_runtime_content_type;
')
allow $1 user_runtime_content_type:dir { delete_dir_perms del_entry_dir_perms list_dir_perms };
')
########################################
## <summary>
## delete user runtime files
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_all_user_runtime_files',`
gen_require(`
attribute user_runtime_content_type;
')
allow $1 user_runtime_content_type:dir list_dir_perms;
allow $1 user_runtime_content_type:file delete_file_perms;
')
########################################
## <summary>
## delete user runtime symlink files
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_all_user_runtime_symlinks',`
gen_require(`
attribute user_runtime_content_type;
')
allow $1 user_runtime_content_type:dir list_dir_perms;
allow $1 user_runtime_content_type:lnk_file delete_lnk_file_perms;
')
########################################
## <summary>
## delete user runtime fifo files
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_all_user_runtime_named_pipes',`
gen_require(`
attribute user_runtime_content_type;
')
allow $1 user_runtime_content_type:dir list_dir_perms;
allow $1 user_runtime_content_type:fifo_file delete_fifo_file_perms;
')
########################################
## <summary>
## delete user runtime socket files
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_delete_all_user_runtime_named_sockets',`
gen_require(`
attribute user_runtime_content_type;
')
allow $1 user_runtime_content_type:dir list_dir_perms;
allow $1 user_runtime_content_type:sock_file delete_sock_file_perms;
')
########################################
## <summary>
## Create objects in the pid directory
## with an automatic type transition to
## the user runtime root type. (Deprecated)
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="object_class">
## <summary>
## The class of the object to be created.
## </summary>
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
#
interface(`userdom_pid_filetrans_user_runtime_root',`
refpolicywarn(`$0($*) has been deprecated, please use userdom_runtime_filetrans_user_runtime_root() instead.')
userdom_runtime_filetrans_user_runtime_root($1, $2, $3)
')
########################################
## <summary>
## Create objects in the runtime directory
## with an automatic type transition to
## the user runtime root type.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="object_class">
## <summary>
## The class of the object to be created.
## </summary>
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
#
interface(`userdom_runtime_filetrans_user_runtime_root',`
gen_require(`
type user_runtime_root_t;
')
files_runtime_filetrans($1, user_runtime_root_t, $2, $3)
')
########################################
## <summary>
## Create objects in a user runtime
## directory with an automatic type
## transition to a specified private
## type.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="private_type">
## <summary>
## The type of the object to create.
## </summary>
## </param>
## <param name="object_class">
## <summary>
## The class of the object to be created.
## </summary>
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
#
interface(`userdom_user_runtime_filetrans',`
gen_require(`
type user_runtime_t;
')
filetrans_pattern($1, user_runtime_t, $2, $3, $4)
userdom_search_user_runtime_root($1)
')
########################################
## <summary>
## Create objects in the user runtime directory
## with an automatic type transition to
## the user temporary type.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="object_class">
## <summary>
## The class of the object to be created.
## </summary>
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
#
interface(`userdom_user_runtime_filetrans_user_tmp',`
gen_require(`
type user_tmp_t;
')
userdom_user_runtime_filetrans($1, user_tmp_t, $2, $3)
')
########################################
## <summary>
## Create objects in the user runtime root
## directory with an automatic type transition
## to the user runtime dir type.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="object_class">
## <summary>
## The class of the object to be created.
## </summary>
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
#
interface(`userdom_user_runtime_root_filetrans_user_runtime',`
gen_require(`
type user_runtime_root_t, user_runtime_t;
')
filetrans_pattern($1, user_runtime_root_t, user_runtime_t, $2, $3)
files_search_runtime($1)
')
########################################
## <summary>
## Create objects in the user runtime root
## directory with an automatic type transition
## to the user runtime dir type.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="object_class">
## <summary>
## The class of the object to be created.
## </summary>
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
#
interface(`userdom_user_run_filetrans_user_runtime',`
gen_require(`
type user_runtime_t;
')
fs_tmpfs_filetrans($1, user_runtime_t, $2, $3)
')
########################################
2009-08-31 13:38:47 +00:00
## <summary>
## Read and write user tmpfs files.
2009-08-31 13:38:47 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_rw_user_tmpfs_files',`
2009-08-31 13:38:47 +00:00
gen_require(`
type user_tmpfs_t;
')
rw_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
read_lnk_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2009-08-31 13:38:47 +00:00
allow $1 user_tmpfs_t:dir list_dir_perms;
fs_search_tmpfs($1)
')
2005-10-07 21:45:04 +00:00
########################################
## <summary>
## Delete user tmpfs files.
2005-10-07 21:45:04 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-10-07 21:45:04 +00:00
## Domain allowed access.
## </summary>
2005-10-07 21:45:04 +00:00
## </param>
#
interface(`userdom_delete_user_tmpfs_files',`
2008-11-05 16:10:46 +00:00
gen_require(`
type user_tmpfs_t;
')
delete_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
2008-11-05 16:10:46 +00:00
fs_search_tmpfs($1)
2005-10-07 21:45:04 +00:00
')
########################################
## <summary>
## Create, read, write, and delete user tmpfs files.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_manage_user_tmpfs_files',`
gen_require(`
type user_tmpfs_t;
')
manage_files_pattern($1, user_tmpfs_t, user_tmpfs_t)
allow $1 user_tmpfs_t:dir list_dir_perms;
fs_search_tmpfs($1)
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Get the attributes of a user domain tty.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_getattr_user_ttys',`
gen_require(`
type user_tty_device_t;
')
allow $1 user_tty_device_t:chr_file getattr_chr_file_perms;
')
2005-08-17 14:14:07 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to get the attributes of a user domain tty.
2005-08-17 14:14:07 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
2005-08-17 14:14:07 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_getattr_user_ttys',`
gen_require(`
type user_tty_device_t;
')
dontaudit $1 user_tty_device_t:chr_file getattr_chr_file_perms;
2005-08-17 14:14:07 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Set the attributes of a user domain tty.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_setattr_user_ttys',`
gen_require(`
type user_tty_device_t;
')
allow $1 user_tty_device_t:chr_file setattr_chr_file_perms;
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to set the attributes of a user domain tty.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_setattr_user_ttys',`
gen_require(`
type user_tty_device_t;
')
dontaudit $1 user_tty_device_t:chr_file setattr_chr_file_perms;
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Read and write a user domain tty.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_use_user_ttys',`
gen_require(`
type user_tty_device_t;
')
allow $1 user_tty_device_t:chr_file rw_term_perms;
')
2005-08-17 14:14:07 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Read and write a user domain pty.
2005-08-17 14:14:07 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-08-17 14:14:07 +00:00
## Domain allowed access.
## </summary>
2005-08-17 14:14:07 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_use_user_ptys',`
gen_require(`
type user_devpts_t;
')
term_list_ptys($1)
2008-11-05 16:10:46 +00:00
allow $1 user_devpts_t:chr_file rw_term_perms;
2005-08-17 14:14:07 +00:00
')
2017-02-24 01:03:23 +00:00
########################################
## <summary>
## Read and write a user TTYs and PTYs.
2017-02-24 01:03:23 +00:00
## </summary>
## <desc>
## <p>
## Allow the specified domain to read and write user
## TTYs and PTYs. This will allow the domain to
## interact with the user via the terminal. Typically
## all interactive applications will require this
## access.
## </p>
## <p>
## However, this also allows the applications to spy
## on user sessions or inject information into the
## user session. Thus, this access should likely
## not be allowed for non-interactive domains.
## </p>
2017-02-24 01:03:23 +00:00
## </desc>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
2017-02-24 01:03:23 +00:00
## </param>
## <infoflow type="both" weight="10"/>
#
interface(`userdom_use_inherited_user_terminals',`
gen_require(`
type user_devpts_t, user_tty_device_t;
2017-02-24 01:03:23 +00:00
')
term_list_ptys($1)
allow $1 { user_devpts_t user_tty_device_t }:chr_file rw_inherited_term_perms;
2017-02-24 01:03:23 +00:00
')
########################################
## <summary>
## Read, write and open a user TTYs and PTYs.
## </summary>
## <desc>
## <p>
## Allow the specified domain to read and write user
## TTYs and PTYs. This will allow the domain to
## interact with the user via the terminal. Typically
## all interactive applications will require this
## access.
## </p>
## <p>
## This interface will also allow to open these user
## terminals, which should not be necessary in general
## and userdom_use_inherited_user_terminals() should
## be sufficient.
## </p>
## <p>
## However, this also allows the applications to spy
## on user sessions or inject information into the
## user session. Thus, this access should likely
## not be allowed for non-interactive domains.
## </p>
## </desc>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <infoflow type="both" weight="10"/>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_use_user_terminals',`
userdom_use_user_ptys($1)
userdom_use_user_ttys($1)
')
2005-08-17 14:14:07 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to read and write
## a user domain tty and pty.
2005-08-17 14:14:07 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
2005-08-17 14:14:07 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_use_user_terminals',`
gen_require(`
type user_tty_device_t, user_devpts_t;
')
dontaudit $1 user_tty_device_t:chr_file rw_term_perms;
dontaudit $1 user_devpts_t:chr_file rw_term_perms;
2005-08-17 14:14:07 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Execute a shell in all user domains. This
## is an explicit transition, requiring the
## caller to use setexeccon().
2005-08-17 14:14:07 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2005-08-17 14:14:07 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_spec_domtrans_all_users',`
gen_require(`
attribute userdomain;
')
2009-06-26 14:40:13 +00:00
corecmd_shell_spec_domtrans($1, userdomain)
2008-11-05 16:10:46 +00:00
allow userdomain $1:fd use;
allow userdomain $1:fifo_file rw_inherited_fifo_file_perms;
2008-11-05 16:10:46 +00:00
allow userdomain $1:process sigchld;
2005-08-17 14:14:07 +00:00
')
########################################
## <summary>
## Execute an Xserver session in all user domains. This
2008-11-05 16:10:46 +00:00
## is an explicit transition, requiring the
## caller to use setexeccon().
2005-08-17 14:14:07 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2005-08-17 14:14:07 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_xsession_spec_domtrans_all_users',`
gen_require(`
attribute userdomain;
')
2009-06-26 14:40:13 +00:00
xserver_xsession_spec_domtrans($1, userdomain)
2008-11-05 16:10:46 +00:00
allow userdomain $1:fd use;
allow userdomain $1:fifo_file rw_inherited_fifo_file_perms;
2008-11-05 16:10:46 +00:00
allow userdomain $1:process sigchld;
2005-08-17 14:14:07 +00:00
')
2005-10-14 20:00:07 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Execute a shell in all unprivileged user domains. This
## is an explicit transition, requiring the
## caller to use setexeccon().
2005-10-14 20:00:07 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2005-10-14 20:00:07 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_spec_domtrans_unpriv_users',`
2005-10-14 20:00:07 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
attribute unpriv_userdomain;
2005-10-14 20:00:07 +00:00
')
2009-06-26 14:40:13 +00:00
corecmd_shell_spec_domtrans($1, unpriv_userdomain)
2008-11-05 16:10:46 +00:00
allow unpriv_userdomain $1:fd use;
allow unpriv_userdomain $1:fifo_file rw_inherited_fifo_file_perms;
2008-11-05 16:10:46 +00:00
allow unpriv_userdomain $1:process sigchld;
2005-10-14 20:00:07 +00:00
')
2005-10-07 21:45:04 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Execute an Xserver session in all unprivileged user domains. This
## is an explicit transition, requiring the
## caller to use setexeccon().
2005-10-07 21:45:04 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2005-10-07 21:45:04 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_xsession_spec_domtrans_unpriv_users',`
2005-10-07 21:45:04 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
attribute unpriv_userdomain;
2005-10-07 21:45:04 +00:00
')
2009-06-26 14:40:13 +00:00
xserver_xsession_spec_domtrans($1, unpriv_userdomain)
2008-11-05 16:10:46 +00:00
allow unpriv_userdomain $1:fd use;
allow unpriv_userdomain $1:fifo_file rw_inherited_fifo_file_perms;
2008-11-05 16:10:46 +00:00
allow unpriv_userdomain $1:process sigchld;
2005-10-07 21:45:04 +00:00
')
#######################################
## <summary>
## Read and write unpriviledged user SysV sempaphores.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_rw_unpriv_user_semaphores',`
gen_require(`
attribute unpriv_userdomain;
')
allow $1 unpriv_userdomain:sem rw_sem_perms;
')
2006-04-11 15:28:37 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Manage unpriviledged user SysV sempaphores.
2006-04-11 15:28:37 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_unpriv_user_semaphores',`
2006-04-11 15:28:37 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
attribute unpriv_userdomain;
2006-04-11 15:28:37 +00:00
')
2008-11-05 16:10:46 +00:00
allow $1 unpriv_userdomain:sem create_sem_perms;
2006-04-11 15:28:37 +00:00
')
#######################################
## <summary>
## Read and write unpriviledged user SysV shared
## memory segments.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_rw_unpriv_user_shared_mem',`
gen_require(`
attribute unpriv_userdomain;
')
allow $1 unpriv_userdomain:shm rw_shm_perms;
')
2006-04-11 15:28:37 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Manage unpriviledged user SysV shared
## memory segments.
2006-04-11 15:28:37 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_manage_unpriv_user_shared_mem',`
2006-04-11 15:28:37 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
attribute unpriv_userdomain;
2006-04-11 15:28:37 +00:00
')
2008-11-05 16:10:46 +00:00
allow $1 unpriv_userdomain:shm create_shm_perms;
2006-04-11 15:28:37 +00:00
')
2005-10-24 01:53:13 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Execute bin_t in the unprivileged user domains. This
## is an explicit transition, requiring the
## caller to use setexeccon().
2005-10-24 01:53:13 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
2005-10-24 01:53:13 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_bin_spec_domtrans_unpriv_users',`
2005-10-24 01:53:13 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
attribute unpriv_userdomain;
2005-10-24 01:53:13 +00:00
')
2009-06-26 14:40:13 +00:00
corecmd_bin_spec_domtrans($1, unpriv_userdomain)
2008-11-05 16:10:46 +00:00
allow unpriv_userdomain $1:fd use;
allow unpriv_userdomain $1:fifo_file rw_inherited_fifo_file_perms;
2008-11-05 16:10:46 +00:00
allow unpriv_userdomain $1:process sigchld;
2005-11-08 22:00:30 +00:00
')
2005-12-01 18:01:21 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Execute all entrypoint files in unprivileged user
## domains. This is an explicit transition, requiring the
## caller to use setexeccon().
2005-12-01 18:01:21 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-12-01 18:01:21 +00:00
## Domain allowed access.
## </summary>
2005-12-01 18:01:21 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_entry_spec_domtrans_unpriv_users',`
gen_require(`
2008-11-05 16:10:46 +00:00
attribute unpriv_userdomain;
2005-12-01 18:01:21 +00:00
')
2009-06-26 14:40:13 +00:00
domain_entry_file_spec_domtrans($1, unpriv_userdomain)
2008-11-05 16:10:46 +00:00
allow unpriv_userdomain $1:fd use;
allow unpriv_userdomain $1:fifo_file rw_inherited_fifo_file_perms;
2008-11-05 16:10:46 +00:00
allow unpriv_userdomain $1:process sigchld;
2005-12-01 18:01:21 +00:00
')
2005-11-28 22:19:08 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Search users home directories.
2005-11-28 22:19:08 +00:00
## </summary>
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain allowed access.
## </summary>
2005-11-28 22:19:08 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_search_user_home_content',`
gen_require(`
2008-11-05 16:10:46 +00:00
type user_home_dir_t, user_home_t;
2005-11-28 22:19:08 +00:00
')
2008-11-05 16:10:46 +00:00
files_list_home($1)
allow $1 { user_home_dir_t user_home_t }:dir search_dir_perms;
2005-11-28 22:19:08 +00:00
')
########################################
## <summary>
## Send signull to unprivileged user domains.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_signull_unpriv_users',`
gen_require(`
attribute unpriv_userdomain;
')
allow $1 unpriv_userdomain:process signull;
')
2006-01-20 22:41:54 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Send general signals to unprivileged user domains.
2006-01-20 22:41:54 +00:00
## </summary>
## <param name="domain">
## <summary>
2006-01-20 22:41:54 +00:00
## Domain allowed access.
## </summary>
2006-01-20 22:41:54 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_signal_unpriv_users',`
2006-01-20 22:41:54 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
attribute unpriv_userdomain;
2006-01-20 22:41:54 +00:00
')
2008-11-05 16:10:46 +00:00
allow $1 unpriv_userdomain:process signal;
2006-01-20 22:41:54 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Inherit the file descriptors from unprivileged user domains.
2006-01-20 22:41:54 +00:00
## </summary>
## <param name="domain">
## <summary>
2006-01-20 22:41:54 +00:00
## Domain allowed access.
## </summary>
2006-01-20 22:41:54 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_use_unpriv_users_fds',`
2006-01-20 22:41:54 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
attribute unpriv_userdomain;
2006-01-20 22:41:54 +00:00
')
2008-11-05 16:10:46 +00:00
allow $1 unpriv_userdomain:fd use;
2006-01-20 22:41:54 +00:00
')
2005-11-08 22:00:30 +00:00
########################################
## <summary>
## Do not audit attempts to inherit the file descriptors
## from unprivileged user domains.
2005-11-08 22:00:30 +00:00
## </summary>
## <desc>
## <p>
## Do not audit attempts to inherit the file descriptors
## from unprivileged user domains. This will suppress
## SELinux denial messages when the specified domain is denied
## the permission to inherit these file descriptors.
## </p>
## </desc>
2005-11-08 22:00:30 +00:00
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
2005-11-08 22:00:30 +00:00
## </param>
## <infoflow type="none"/>
2005-11-08 22:00:30 +00:00
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_use_unpriv_user_fds',`
gen_require(`
2008-11-05 16:10:46 +00:00
attribute unpriv_userdomain;
2005-11-08 22:00:30 +00:00
')
2008-11-05 16:10:46 +00:00
dontaudit $1 unpriv_userdomain:fd use;
2005-10-24 01:53:13 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to use user ptys.
2005-10-24 01:53:13 +00:00
## </summary>
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## Domain to not audit.
## </summary>
2005-10-24 01:53:13 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_use_user_ptys',`
gen_require(`
2008-11-05 16:10:46 +00:00
type user_devpts_t;
2005-11-08 22:00:30 +00:00
')
dontaudit $1 user_devpts_t:chr_file rw_chr_file_perms;
2005-10-24 01:53:13 +00:00
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Relabel files to unprivileged user pty types.
2005-10-24 01:53:13 +00:00
## </summary>
## <param name="domain">
## <summary>
2005-10-24 01:53:13 +00:00
## Domain allowed access.
## </summary>
2005-10-24 01:53:13 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_relabelto_user_ptys',`
gen_require(`
2008-11-05 16:10:46 +00:00
type user_devpts_t;
2005-11-08 22:00:30 +00:00
')
2008-11-05 16:10:46 +00:00
allow $1 user_devpts_t:chr_file relabelto;
2005-10-24 01:53:13 +00:00
')
2005-08-17 14:14:07 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to relabel files from
## user pty types.
2005-06-27 16:30:55 +00:00
## </summary>
2005-06-23 21:30:57 +00:00
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
2005-06-23 21:30:57 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_relabelfrom_user_ptys',`
2005-06-21 21:07:46 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type user_devpts_t;
2005-06-21 21:07:46 +00:00
')
2008-11-05 16:10:46 +00:00
dontaudit $1 user_devpts_t:chr_file relabelfrom;
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Write all users files in /tmp
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_write_user_tmp_files',`
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tmp_t;
')
2008-11-05 16:10:46 +00:00
allow $1 user_tmp_t:file write_file_perms;
')
2017-02-24 01:03:23 +00:00
########################################
## <summary>
## Do not audit attempts to write users
## temporary files.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
interface(`userdom_dontaudit_write_user_tmp_files',`
gen_require(`
type user_tmp_t;
')
dontaudit $1 user_tmp_t:file write;
')
2005-06-29 20:53:53 +00:00
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Do not audit attempts to use user ttys.
2005-06-29 20:53:53 +00:00
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
2005-06-29 20:53:53 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`userdom_dontaudit_use_user_ttys',`
gen_require(`
2008-11-05 16:10:46 +00:00
type user_tty_device_t;
2005-11-22 17:56:53 +00:00
')
dontaudit $1 user_tty_device_t:chr_file rw_chr_file_perms;
2005-06-29 20:53:53 +00:00
')
2005-07-06 20:28:29 +00:00
########################################
## <summary>
## Read the process state of all user domains.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
2006-02-02 21:08:12 +00:00
interface(`userdom_read_all_users_state',`
gen_require(`
attribute userdomain;
')
2009-06-26 14:40:13 +00:00
read_files_pattern($1, userdomain, userdomain)
read_lnk_files_pattern($1, userdomain, userdomain)
kernel_search_proc($1)
')
########################################
## <summary>
## Get the attributes of all user domains.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
2006-02-20 21:33:25 +00:00
interface(`userdom_getattr_all_users',`
gen_require(`
attribute userdomain;
')
allow $1 userdomain:process getattr;
')
2005-08-17 14:14:07 +00:00
########################################
## <summary>
## Inherit the file descriptors from all user domains
## </summary>
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-08-17 14:14:07 +00:00
## </param>
#
2006-02-20 21:33:25 +00:00
interface(`userdom_use_all_users_fds',`
2005-08-17 14:14:07 +00:00
gen_require(`
attribute userdomain;
')
allow $1 userdomain:fd use;
')
########################################
2005-09-08 17:12:38 +00:00
## <summary>
## Do not audit attempts to inherit the file
## descriptors from any user domains.
## </summary>
## <param name="domain">
## <summary>
2005-09-08 17:12:38 +00:00
## Domain to not audit.
## </summary>
2005-09-08 17:12:38 +00:00
## </param>
#
2006-02-20 21:33:25 +00:00
interface(`userdom_dontaudit_use_all_users_fds',`
2005-09-08 17:12:38 +00:00
gen_require(`
attribute userdomain;
')
dontaudit $1 userdomain:fd use;
')
########################################
2005-08-17 14:14:07 +00:00
## <summary>
## Send general signals to all user domains.
## </summary>
## <param name="domain">
## <summary>
2005-11-08 22:00:30 +00:00
## Domain allowed access.
## </summary>
2005-08-17 14:14:07 +00:00
## </param>
#
interface(`userdom_signal_all_users',`
gen_require(`
attribute userdomain;
')
allow $1 userdomain:process signal;
')
2005-08-30 20:47:41 +00:00
########################################
## <summary>
## Send a SIGCHLD signal to all user domains.
## </summary>
## <param name="domain">
## <summary>
2005-08-30 20:47:41 +00:00
## Domain allowed access.
## </summary>
2005-08-30 20:47:41 +00:00
## </param>
#
2005-11-29 21:27:15 +00:00
interface(`userdom_sigchld_all_users',`
2005-08-30 20:47:41 +00:00
gen_require(`
attribute userdomain;
')
2005-09-19 21:17:45 +00:00
allow $1 userdomain:process sigchld;
2005-08-30 20:47:41 +00:00
')
########################################
## <summary>
## Read keys for all user domains.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_read_all_users_keys',`
gen_require(`
attribute userdomain;
')
allow $1 userdomain:key read;
')
########################################
## <summary>
## Write keys for all user domains.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_write_all_users_keys',`
gen_require(`
attribute userdomain;
')
allow $1 userdomain:key write;
')
########################################
## <summary>
## Read and write keys for all user domains.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_rw_all_users_keys',`
gen_require(`
attribute userdomain;
')
allow $1 userdomain:key { read view write };
')
2006-06-21 21:02:49 +00:00
########################################
## <summary>
## Create keys for all user domains.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_create_all_users_keys',`
gen_require(`
attribute userdomain;
2006-06-21 21:02:49 +00:00
')
allow $1 userdomain:key create;
2006-06-21 21:02:49 +00:00
')
########################################
## <summary>
## Manage keys for all user domains.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`userdom_manage_all_users_keys',`
gen_require(`
attribute userdomain;
')
allow $1 userdomain:key manage_key_perms;
')
2005-11-29 21:27:15 +00:00
########################################
## <summary>
## Send a dbus message to all user domains.
## </summary>
## <param name="domain">
## <summary>
2005-11-29 21:27:15 +00:00
## Domain allowed access.
## </summary>
2005-11-29 21:27:15 +00:00
## </param>
#
interface(`userdom_dbus_send_all_users',`
gen_require(`
attribute userdomain;
class dbus send_msg;
')
allow $1 userdomain:dbus send_msg;
')
2017-02-24 01:03:23 +00:00
########################################
## <summary>
## Do not audit attempts to read and write
## unserdomain stream.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
interface(`userdom_dontaudit_rw_all_users_stream_sockets',`
gen_require(`
attribute userdomain;
')
dontaudit $1 userdomain:unix_stream_socket rw_socket_perms;
')