selinux-policy/policy/support/file_patterns.spt
2007-07-31 15:11:22 +00:00

535 lines
12 KiB
Cheetah

#
# Directory patterns (dir)
#
# Parameters:
# 1. domain type
# 2. container (directory) type
# 3. directory type
#
define(`getattr_dirs_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:dir getattr_dir_perms;
')
define(`setattr_dirs_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:dir setattr_dir_perms;
')
define(`search_dirs_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:dir search_dir_perms;
')
define(`list_dirs_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:dir list_dir_perms;
')
define(`add_entry_dirs_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:dir add_entry_dir_perms;
')
define(`del_entry_dirs_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:dir del_entry_dir_perms;
')
define(`create_dirs_pattern',`
allow $1 $2:dir add_entry_dir_perms;
allow $1 $3:dir create_dir_perms;
')
define(`delete_dirs_pattern',`
allow $1 $2:dir del_entry_dir_perms;
allow $1 $3:dir delete_dir_perms;
')
define(`rename_dirs_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:dir rename_dir_perms;
')
define(`manage_dirs_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:dir manage_dir_perms;
')
define(`relabelfrom_dirs_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:dir relabelfrom_dir_perms;
')
define(`relabelto_dirs_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:dir relabelto_dir_perms;
')
define(`relabel_dirs_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:dir relabel_dir_perms;
')
#
# Regular file patterns (file)
#
# Parameters:
# 1. domain type
# 2. container (directory) type
# 3. file type
#
define(`getattr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file getattr_file_perms;
')
define(`setattr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file setattr_file_perms;
')
define(`read_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file read_file_perms;
')
define(`mmap_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file mmap_file_perms;
')
define(`exec_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file exec_file_perms;
')
define(`append_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file append_file_perms;
')
define(`write_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file write_file_perms;
')
define(`rw_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file rw_file_perms;
')
define(`create_files_pattern',`
allow $1 $2:dir add_entry_dir_perms;
allow $1 $3:file create_file_perms;
')
define(`delete_files_pattern',`
allow $1 $2:dir del_entry_dir_perms;
allow $1 $3:file delete_file_perms;
')
define(`rename_files_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:file rename_file_perms;
')
define(`manage_files_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:file manage_file_perms;
')
define(`relabelfrom_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file relabelfrom_file_perms;
')
define(`relabelto_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file relabelto_file_perms;
')
define(`relabel_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:file relabel_file_perms;
')
#
# Symbolic link patterns (lnk_file)
#
# Parameters:
# 1. domain type
# 2. container (directory) type
# 3. file type
#
define(`getattr_lnk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:lnk_file getattr_lnk_file_perms;
')
define(`setattr_lnk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:lnk_file setattr_lnk_file_perms;
')
define(`read_lnk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:lnk_file read_lnk_file_perms;
')
define(`append_lnk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:lnk_file append_lnk_file_perms;
')
define(`write_lnk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:lnk_file write_lnk_file_perms;
')
define(`rw_lnk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:lnk_file rw_lnk_file_perms;
')
define(`create_lnk_files_pattern',`
allow $1 $2:dir add_entry_dir_perms;
allow $1 $3:lnk_file create_lnk_file_perms;
')
define(`delete_lnk_files_pattern',`
allow $1 $2:dir del_entry_dir_perms;
allow $1 $3:lnk_file delete_lnk_file_perms;
')
define(`rename_lnk_files_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:lnk_file rename_lnk_file_perms;
')
define(`manage_lnk_files_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:lnk_file manage_lnk_file_perms;
')
define(`relabelfrom_lnk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:lnk_file relabelfrom_lnk_file_perms;
')
define(`relabelto_lnk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:lnk_file relabelto_lnk_file_perms;
')
define(`relabel_lnk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:lnk_file relabel_lnk_file_perms;
')
#
# (Un)named Pipes/FIFO patterns (fifo_file)
#
# Parameters:
# 1. domain type
# 2. container (directory) type
# 3. file type
#
define(`getattr_fifo_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:fifo_file getattr_fifo_file_perms;
')
define(`setattr_fifo_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:fifo_file setattr_fifo_file_perms;
')
define(`read_fifo_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:fifo_file read_fifo_file_perms;
')
define(`append_fifo_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:fifo_file append_fifo_file_perms;
')
define(`write_fifo_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:fifo_file write_fifo_file_perms;
')
define(`rw_fifo_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:fifo_file rw_fifo_file_perms;
')
define(`create_fifo_files_pattern',`
allow $1 $2:dir add_entry_dir_perms;
allow $1 $3:fifo_file create_fifo_file_perms;
')
define(`delete_fifo_files_pattern',`
allow $1 $2:dir del_entry_dir_perms;
allow $1 $3:fifo_file delete_fifo_file_perms;
')
define(`rename_fifo_files_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:fifo_file rename_fifo_file_perms;
')
define(`manage_fifo_files_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:fifo_file manage_fifo_file_perms;
')
define(`relabelfrom_fifo_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:fifo_file relabelfrom_fifo_file_perms;
')
define(`relabelto_fifo_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:fifo_file relabelto_fifo_file_perms;
')
define(`relabel_fifo_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:fifo_file relabel_fifo_file_perms;
')
#
# (Un)named sockets patterns (sock_file)
#
# Parameters:
# 1. domain type
# 2. container (directory) type
# 3. file type
#
define(`getattr_sock_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:sock_file getattr_sock_file_perms;
')
define(`setattr_sock_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:sock_file setattr_sock_file_perms;
')
define(`read_sock_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:sock_file read_sock_file_perms;
')
define(`write_sock_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:sock_file write_sock_file_perms;
')
define(`rw_sock_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:sock_file rw_sock_file_perms;
')
define(`create_sock_files_pattern',`
allow $1 $2:dir add_entry_dir_perms;
allow $1 $3:sock_file create_sock_file_perms;
')
define(`delete_sock_files_pattern',`
allow $1 $2:dir del_entry_dir_perms;
allow $1 $3:sock_file delete_sock_file_perms;
')
define(`rename_sock_files_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:sock_file rename_sock_file_perms;
')
define(`manage_sock_files_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:sock_file manage_sock_file_perms;
')
define(`relabelfrom_sock_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:sock_file relabelfrom_sock_file_perms;
')
define(`relabelto_sock_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:sock_file relabelto_sock_file_perms;
')
define(`relabel_sock_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:sock_file relabel_sock_file_perms;
')
#
# Block device node patterns (blk_file)
#
# Parameters:
# 1. domain type
# 2. container (directory) type
# 3. file type
#
define(`getattr_blk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:blk_file getattr_blk_file_perms;
')
define(`setattr_blk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:blk_file setattr_blk_file_perms;
')
define(`read_blk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:blk_file read_blk_file_perms;
')
define(`append_blk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:blk_file append_blk_file_perms;
')
define(`write_blk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:blk_file write_blk_file_perms;
')
define(`rw_blk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:blk_file rw_blk_file_perms;
')
define(`create_blk_files_pattern',`
allow $1 self:capability mknod;
allow $1 $2:dir add_entry_dir_perms;
allow $1 $3:blk_file create_blk_file_perms;
')
define(`delete_blk_files_pattern',`
allow $1 $2:dir del_entry_dir_perms;
allow $1 $3:blk_file delete_blk_file_perms;
')
define(`rename_blk_files_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:blk_file rename_blk_file_perms;
')
define(`manage_blk_files_pattern',`
allow $1 self:capability mknod;
allow $1 $2:dir rw_dir_perms;
allow $1 $3:blk_file manage_blk_file_perms;
')
define(`relabelfrom_blk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:blk_file relabelfrom_blk_file_perms;
')
define(`relabelto_blk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:blk_file relabelto_blk_file_perms;
')
define(`relabel_blk_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:blk_file relabel_blk_file_perms;
')
#
# Character device node patterns (chr_file)
#
# Parameters:
# 1. domain type
# 2. container (directory) type
# 3. file type
#
define(`getattr_chr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:chr_file getattr_chr_file_perms;
')
define(`setattr_chr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:chr_file setattr_chr_file_perms;
')
define(`read_chr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:chr_file read_chr_file_perms;
')
define(`append_chr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:chr_file append_chr_file_perms;
')
define(`write_chr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:chr_file write_chr_file_perms;
')
define(`rw_chr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:chr_file rw_chr_file_perms;
')
define(`create_chr_files_pattern',`
allow $1 self:capability mknod;
allow $1 $2:dir add_entry_dir_perms;
allow $1 $3:chr_file create_chr_file_perms;
')
define(`delete_chr_files_pattern',`
allow $1 $2:dir del_entry_dir_perms;
allow $1 $3:chr_file delete_chr_file_perms;
')
define(`rename_chr_files_pattern',`
allow $1 $2:dir rw_dir_perms;
allow $1 $3:chr_file rename_chr_file_perms;
')
define(`manage_chr_files_pattern',`
allow $1 self:capability mknod;
allow $1 $2:dir rw_dir_perms;
allow $1 $3:chr_file manage_chr_file_perms;
')
define(`relabelfrom_chr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:chr_file relabelfrom_chr_file_perms;
')
define(`relabelto_chr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:chr_file relabelto_chr_file_perms;
')
define(`relabel_chr_files_pattern',`
allow $1 $2:dir search_dir_perms;
allow $1 $3:chr_file relabel_chr_file_perms;
')
#
# File type_transition patterns
#
# pattern(domain,dirtype,newtype,class(es))
#
define(`filetrans_add_pattern',`
allow $1 $2:dir ra_dir_perms;
type_transition $1 $2:$4 $3;
')
define(`filetrans_pattern',`
allow $1 $2:dir rw_dir_perms;
type_transition $1 $2:$4 $3;
')