add screen
This commit is contained in:
parent
a77e65240b
commit
c8ba683007
@ -12,6 +12,7 @@
|
|||||||
logwatch (Dan Walsh)
|
logwatch (Dan Walsh)
|
||||||
openct
|
openct
|
||||||
readahead
|
readahead
|
||||||
|
screen
|
||||||
slrnpull
|
slrnpull
|
||||||
smartmon
|
smartmon
|
||||||
sysstat
|
sysstat
|
||||||
|
15
refpolicy/policy/modules/apps/screen.fc
Normal file
15
refpolicy/policy/modules/apps/screen.fc
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#
|
||||||
|
# /home
|
||||||
|
#
|
||||||
|
HOME_DIR/\.screenrc -- gen_context(system_u:object_r:ROLE_screen_ro_home_t,s0)
|
||||||
|
|
||||||
|
#
|
||||||
|
# /usr
|
||||||
|
#
|
||||||
|
/usr/bin/screen -- gen_context(system_u:object_r:screen_exec_t,s0)
|
||||||
|
|
||||||
|
#
|
||||||
|
# /var
|
||||||
|
#
|
||||||
|
/var/run/screens?/S-[^/]+ -d gen_context(system_u:object_r:screen_dir_t,s0)
|
||||||
|
/var/run/screens?/S-[^/]+/.* <<none>>
|
195
refpolicy/policy/modules/apps/screen.if
Normal file
195
refpolicy/policy/modules/apps/screen.if
Normal file
@ -0,0 +1,195 @@
|
|||||||
|
## <summary>GNU terminal multiplexer</summary>
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
## <summary>
|
||||||
|
## The per user domain template for the screen module.
|
||||||
|
## </summary>
|
||||||
|
## <desc>
|
||||||
|
## <p>
|
||||||
|
## This template creates a derived domains which are used
|
||||||
|
## for screen sessions.
|
||||||
|
## </p>
|
||||||
|
## <p>
|
||||||
|
## This template is invoked automatically for each user, and
|
||||||
|
## generally does not need to be invoked directly
|
||||||
|
## by policy writers.
|
||||||
|
## </p>
|
||||||
|
## </desc>
|
||||||
|
## <param name="userdomain_prefix">
|
||||||
|
## The prefix of the user domain (e.g., user
|
||||||
|
## is the prefix for user_t).
|
||||||
|
## </param>
|
||||||
|
## <param name="user_domain">
|
||||||
|
## The type of the user domain.
|
||||||
|
## </param>
|
||||||
|
## <param name="user_role">
|
||||||
|
## The role associated with the user domain.
|
||||||
|
## </param>
|
||||||
|
#
|
||||||
|
template(`screen_per_userdomain_template',`
|
||||||
|
gen_require(`
|
||||||
|
type screen_dir_t, screen_exec_t;
|
||||||
|
')
|
||||||
|
|
||||||
|
########################################
|
||||||
|
#
|
||||||
|
# Declarations
|
||||||
|
#
|
||||||
|
|
||||||
|
type $1_screen_t;
|
||||||
|
domain_type($1_screen_t)
|
||||||
|
domain_entry_file($1_screen_t,screen_exec_t)
|
||||||
|
domain_wide_inherit_fd($1_screen_t)
|
||||||
|
role $2 types $1_screen_t;
|
||||||
|
|
||||||
|
type $1_screen_tmp_t;
|
||||||
|
files_tmp_file($1_screen_tmp_t)
|
||||||
|
|
||||||
|
type $1_screen_ro_home_t;
|
||||||
|
files_type($1_screen_ro_home_t)
|
||||||
|
|
||||||
|
type $1_screen_var_run_t;;
|
||||||
|
files_pid_file($1_screen_var_run_t)
|
||||||
|
|
||||||
|
########################################
|
||||||
|
#
|
||||||
|
# Local policy
|
||||||
|
#
|
||||||
|
|
||||||
|
allow $1_screen_t self:capability { setuid setgid fsetid };
|
||||||
|
allow $1_screen_t self:process signal_perms;
|
||||||
|
allow $1_screen_t self:tcp_socket create_stream_socket_perms;
|
||||||
|
allow $1_screen_t self:udp_socket create_socket_perms;
|
||||||
|
# Internal screen networking
|
||||||
|
allow $1_screen_t self:fd use;
|
||||||
|
allow $1_screen_t self:unix_stream_socket create_socket_perms;
|
||||||
|
allow $1_screen_t self:unix_dgram_socket create_socket_perms;
|
||||||
|
|
||||||
|
allow $1_screen_t $1_screen_tmp_t:dir create_dir_perms;
|
||||||
|
allow $1_screen_t $1_screen_tmp_t:file create_file_perms;
|
||||||
|
allow $1_screen_t $1_screen_tmp_t:fifo_file create_file_perms;
|
||||||
|
files_create_tmp_files($1_screen_t, $1_screen_tmp_t, { file dir })
|
||||||
|
|
||||||
|
# Create fifo
|
||||||
|
allow $1_screen_t screen_dir_t:dir rw_dir_perms;
|
||||||
|
allow $1_screen_t screen_dir_t:dir create_dir_perms;
|
||||||
|
allow $1_screen_t $1_screen_var_run_t:fifo_file create_file_perms;
|
||||||
|
type_transition $1_screen_t screen_dir_t:fifo_file $1_screen_var_run_t;
|
||||||
|
files_create_pid($1_screen_t,screen_dir_t,dir)
|
||||||
|
|
||||||
|
allow $1_screen_t $1_screen_ro_home_t:dir r_dir_perms;
|
||||||
|
allow $1_screen_t $1_screen_ro_home_t:file r_file_perms;
|
||||||
|
allow $1_screen_t $1_screen_ro_home_t:lnk_file { read getattr };
|
||||||
|
|
||||||
|
domain_auto_trans($2, screen_exec_t, $1_screen_t)
|
||||||
|
allow $2 $1_screen_t:process signal;
|
||||||
|
allow $1_screen_t $2:process signal;
|
||||||
|
allow $1_screen_t $2:fifo_file rw_file_perms;
|
||||||
|
allow $1_screen_t $1_home_dir_t:dir { search getattr };
|
||||||
|
|
||||||
|
allow $2 $1_screen_ro_home_t:dir create_dir_perms;
|
||||||
|
allow $2 $1_screen_ro_home_t:file create_file_perms;
|
||||||
|
allow $2 $1_screen_ro_home_t:lnk_file create_lnk_perms;
|
||||||
|
allow $2 $1_screen_ro_home_t:{ dir file lnk_file } { relabelfrom relabelto };
|
||||||
|
|
||||||
|
kernel_read_system_state($1_screen_t)
|
||||||
|
kernel_read_kernel_sysctl($1_screen_t)
|
||||||
|
|
||||||
|
corecmd_list_bin($1_screen_t)
|
||||||
|
corecmd_read_bin_file($1_screen_t)
|
||||||
|
corecmd_read_bin_symlink($1_screen_t)
|
||||||
|
corecmd_read_bin_pipe($1_screen_t)
|
||||||
|
corecmd_read_bin_socket($1_screen_t)
|
||||||
|
corecmd_list_sbin($1_screen_t)
|
||||||
|
corecmd_read_sbin_symlink($1_screen_t)
|
||||||
|
corecmd_read_sbin_file($1_screen_t)
|
||||||
|
corecmd_read_sbin_pipe($1_screen_t)
|
||||||
|
corecmd_read_sbin_socket($1_screen_t)
|
||||||
|
# Revert to the user domain when a shell is executed.
|
||||||
|
corecmd_shell_domtrans($1_screen_t,$2)
|
||||||
|
corecmd_bin_domtrans($1_screen_t,$2)
|
||||||
|
|
||||||
|
corenet_tcp_sendrecv_generic_if($1_screen_t)
|
||||||
|
corenet_udp_sendrecv_generic_if($1_screen_t)
|
||||||
|
corenet_raw_sendrecv_generic_if($1_screen_t)
|
||||||
|
corenet_tcp_sendrecv_all_nodes($1_screen_t)
|
||||||
|
corenet_udp_sendrecv_all_nodes($1_screen_t)
|
||||||
|
corenet_raw_sendrecv_all_nodes($1_screen_t)
|
||||||
|
corenet_tcp_sendrecv_all_ports($1_screen_t)
|
||||||
|
corenet_udp_sendrecv_all_ports($1_screen_t)
|
||||||
|
corenet_tcp_bind_all_nodes($1_screen_t)
|
||||||
|
corenet_udp_bind_all_nodes($1_screen_t)
|
||||||
|
corenet_tcp_connect_all_ports($1_screen_t)
|
||||||
|
|
||||||
|
dev_dontaudit_getattr_all_chr_files($1_screen_t)
|
||||||
|
dev_dontaudit_getattr_all_blk_files($1_screen_t)
|
||||||
|
# for SSP
|
||||||
|
dev_read_urand($1_screen_t)
|
||||||
|
|
||||||
|
domain_use_wide_inherit_fd($1_screen_t)
|
||||||
|
|
||||||
|
files_search_tmp($1_screen_t)
|
||||||
|
files_search_home($1_screen_t)
|
||||||
|
files_list_home($1_screen_t)
|
||||||
|
files_read_usr_files($1_screen_t)
|
||||||
|
files_read_etc_files($1_screen_t)
|
||||||
|
|
||||||
|
fs_search_auto_mountpoints($1_screen_t)
|
||||||
|
fs_getattr_xattr_fs($1_screen_t)
|
||||||
|
|
||||||
|
auth_dontaudit_getattr_shadow($1_screen_t)
|
||||||
|
auth_dontaudit_exec_utempter($1_screen_t)
|
||||||
|
|
||||||
|
# Write to utmp.
|
||||||
|
init_rw_script_pid($1_screen_t)
|
||||||
|
|
||||||
|
libs_use_ld_so($1_screen_t)
|
||||||
|
libs_use_shared_libs($1_screen_t)
|
||||||
|
|
||||||
|
logging_send_syslog_msg($1_screen_t)
|
||||||
|
|
||||||
|
miscfiles_read_localization($1_screen_t)
|
||||||
|
|
||||||
|
seutil_read_config($1_screen_t)
|
||||||
|
|
||||||
|
sysnet_read_config($1_screen_t)
|
||||||
|
|
||||||
|
userdom_use_user_terminals($1,$1_screen_t)
|
||||||
|
userdom_create_user_pty($1,$1_screen_t)
|
||||||
|
userdom_user_home_domtrans($1,$1_screen_t,$2)
|
||||||
|
|
||||||
|
tunable_policy(`read_default_t',`
|
||||||
|
files_list_default($1_screen_t)
|
||||||
|
files_read_default_files($1_screen_t)
|
||||||
|
files_read_default_symlinks($1_screen_t)
|
||||||
|
files_read_default_sockets($1_screen_t)
|
||||||
|
files_read_default_pipes($1_screen_t)
|
||||||
|
')
|
||||||
|
|
||||||
|
tunable_policy(`use_samba_home_dirs',`
|
||||||
|
fs_cifs_domtrans($1_screen_t,$2)
|
||||||
|
fs_read_cifs_symlinks($1_screen_t)
|
||||||
|
fs_list_cifs($1_screen_t)
|
||||||
|
')
|
||||||
|
|
||||||
|
tunable_policy(`use_nfs_home_dirs',`
|
||||||
|
fs_nfs_domtrans($1_screen_t,$2)
|
||||||
|
fs_list_nfs($1_screen_t)
|
||||||
|
fs_read_nfs_symlinks($1_screen_t)
|
||||||
|
')
|
||||||
|
|
||||||
|
optional_policy(`nis',`
|
||||||
|
nis_use_ypbind($1_screen_t)
|
||||||
|
')
|
||||||
|
|
||||||
|
optional_policy(`nscd',`
|
||||||
|
nscd_use_socket($1_screen_t)
|
||||||
|
')
|
||||||
|
|
||||||
|
ifdef(`TODO',`
|
||||||
|
# Inherit and use descriptors from gnome-pty-helper.
|
||||||
|
optional_policy(`gnome-pty-helper.te',`
|
||||||
|
allow $1_screen_t $1_gph_t:fd use;
|
||||||
|
')
|
||||||
|
') dnl TODO
|
||||||
|
')
|
13
refpolicy/policy/modules/apps/screen.te
Normal file
13
refpolicy/policy/modules/apps/screen.te
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
policy_module(screen,1.0.0)
|
||||||
|
|
||||||
|
########################################
|
||||||
|
#
|
||||||
|
# Declarations
|
||||||
|
#
|
||||||
|
|
||||||
|
type screen_dir_t;
|
||||||
|
files_pid_file(screen_dir_t)
|
||||||
|
|
||||||
|
type screen_exec_t;
|
||||||
|
files_type(screen_exec_t)
|
@ -1096,6 +1096,22 @@ interface(`fs_search_nfs',`
|
|||||||
allow $1 nfs_t:dir search;
|
allow $1 nfs_t:dir search;
|
||||||
')
|
')
|
||||||
|
|
||||||
|
########################################
|
||||||
|
## <summary>
|
||||||
|
## List NFS filesystem.
|
||||||
|
## </summary>
|
||||||
|
## <param name="domain">
|
||||||
|
## Domain allowed access.
|
||||||
|
## </param>
|
||||||
|
#
|
||||||
|
interface(`fs_list_nfs',`
|
||||||
|
gen_require(`
|
||||||
|
type nfs_t;
|
||||||
|
')
|
||||||
|
|
||||||
|
allow $1 nfs_t:dir r_dir_perms;
|
||||||
|
')
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
## <summary>
|
## <summary>
|
||||||
## Do not audit attempts to list the contents
|
## Do not audit attempts to list the contents
|
||||||
|
@ -902,6 +902,22 @@ interface(`auth_run_utempter',`
|
|||||||
allow utempter_t $3:chr_file rw_file_perms;
|
allow utempter_t $3:chr_file rw_file_perms;
|
||||||
')
|
')
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
## <summary>
|
||||||
|
## Do not audit attemps to execute utempter executable.
|
||||||
|
## </summary>
|
||||||
|
## <param name="domain">
|
||||||
|
## Domain to not audit.
|
||||||
|
## </param>
|
||||||
|
#
|
||||||
|
interface(`auth_dontaudit_exec_utempter',`
|
||||||
|
gen_require(`
|
||||||
|
type utempter_exec_t;
|
||||||
|
')
|
||||||
|
|
||||||
|
dontaudit $1 utempter_exec_t:file { execute execute_no_trans };
|
||||||
|
')
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
#
|
#
|
||||||
# auth_read_login_records(domain)
|
# auth_read_login_records(domain)
|
||||||
|
@ -1020,6 +1020,37 @@ template(`userdom_home_file',`
|
|||||||
files_type($2)
|
files_type($2)
|
||||||
')
|
')
|
||||||
|
|
||||||
|
########################################
|
||||||
|
## <summary>
|
||||||
|
## Create a user pty.
|
||||||
|
## </summary>
|
||||||
|
## <desc>
|
||||||
|
## <p>
|
||||||
|
## Create a user pty.
|
||||||
|
## </p>
|
||||||
|
## <p>
|
||||||
|
## This is a templated interface, and should only
|
||||||
|
## be called from a per-userdomain template.
|
||||||
|
## </p>
|
||||||
|
## </desc>
|
||||||
|
## <param name="userdomain_prefix">
|
||||||
|
## The prefix of the user domain (e.g., user
|
||||||
|
## is the prefix for user_t).
|
||||||
|
## </param>
|
||||||
|
## <param name="domain">
|
||||||
|
## Domain allowed access.
|
||||||
|
## </param>
|
||||||
|
#
|
||||||
|
template(`userdom_create_user_pty',`
|
||||||
|
ifdef(`strict_policy',`
|
||||||
|
gen_require(`
|
||||||
|
type $1_devpts_t;
|
||||||
|
')
|
||||||
|
|
||||||
|
term_create_pty($2,$1_devpts_t)
|
||||||
|
')
|
||||||
|
')
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
## <summary>
|
## <summary>
|
||||||
## Search user home directories.
|
## Search user home directories.
|
||||||
@ -1050,6 +1081,49 @@ template(`userdom_search_user_home',`
|
|||||||
allow $2 $1_home_dir_t:dir { getattr search };
|
allow $2 $1_home_dir_t:dir { getattr search };
|
||||||
')
|
')
|
||||||
|
|
||||||
|
########################################
|
||||||
|
## <summary>
|
||||||
|
## Do a domain transition to the specified
|
||||||
|
## domain when executing a program in the
|
||||||
|
## user home directory.
|
||||||
|
## </summary>
|
||||||
|
## <desc>
|
||||||
|
## <p>
|
||||||
|
## Do a domain transition to the specified
|
||||||
|
## domain when executing a program in the
|
||||||
|
## user home directory.
|
||||||
|
## </p>
|
||||||
|
## <p>
|
||||||
|
## No interprocess communication (signals, pipes,
|
||||||
|
## etc.) is provided by this interface since
|
||||||
|
## the domains are not owned by this module.
|
||||||
|
## </p>
|
||||||
|
## <p>
|
||||||
|
## This is a templated interface, and should only
|
||||||
|
## be called from a per-userdomain template.
|
||||||
|
## </p>
|
||||||
|
## </desc>
|
||||||
|
## <param name="userdomain_prefix">
|
||||||
|
## The prefix of the user domain (e.g., user
|
||||||
|
## is the prefix for user_t).
|
||||||
|
## </param>
|
||||||
|
## <param name="source_domain">
|
||||||
|
## Domain allowed access.
|
||||||
|
## </param>
|
||||||
|
## <param name="target_domain">
|
||||||
|
## Domain to transition to.
|
||||||
|
## </param>
|
||||||
|
#
|
||||||
|
template(`userdom_user_home_domtrans',`
|
||||||
|
gen_require(`
|
||||||
|
type $1_home_dir_t, $1_home_t;
|
||||||
|
')
|
||||||
|
|
||||||
|
files_search_home($2)
|
||||||
|
allow $2 $1_home_dir_t:dir search_dir_perms;
|
||||||
|
domain_auto_trans($2,$1_home_t,$3)
|
||||||
|
')
|
||||||
|
|
||||||
########################################
|
########################################
|
||||||
## <summary>
|
## <summary>
|
||||||
## Create, read, write, and delete symbolic links
|
## Create, read, write, and delete symbolic links
|
||||||
|
Loading…
Reference in New Issue
Block a user