selinux-refpolicy/policy/modules/apps/irc.if

151 lines
3.9 KiB
Plaintext
Raw Normal View History

2006-01-06 19:46:44 +00:00
## <summary>IRC client policy</summary>
#######################################
## <summary>
2006-09-06 22:07:25 +00:00
## The per role template for the irc module.
2006-01-06 19:46:44 +00:00
## </summary>
## <desc>
## <p>
## This template creates a derived domains which are used
## for an irc client 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">
## <summary>
2006-01-06 19:46:44 +00:00
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
2006-01-06 19:46:44 +00:00
## </param>
## <param name="user_domain">
## <summary>
2006-01-06 19:46:44 +00:00
## The type of the user domain.
## </summary>
2006-01-06 19:46:44 +00:00
## </param>
## <param name="user_role">
## <summary>
2006-01-06 19:46:44 +00:00
## The role associated with the user domain.
## </summary>
2006-01-06 19:46:44 +00:00
## </param>
#
2006-09-06 22:07:25 +00:00
template(`irc_per_role_template',`
2006-01-06 19:46:44 +00:00
gen_require(`
type irc_exec_t;
')
########################################
#
# Declarations
#
type $1_irc_t;
domain_type($1_irc_t)
domain_entry_file($1_irc_t,irc_exec_t)
role $3 types $1_irc_t;
type $1_irc_exec_t;
2006-02-21 18:40:44 +00:00
userdom_user_home_content($1,$1_irc_exec_t)
2006-01-06 19:46:44 +00:00
domain_entry_file($1_irc_t,$1_irc_exec_t)
type $1_irc_home_t;
2006-02-21 18:40:44 +00:00
userdom_user_home_content($1,$1_irc_home_t)
type $1_irc_tmp_t;
2006-02-21 18:40:44 +00:00
userdom_user_home_content($1,$1_irc_tmp_t)
2006-01-06 19:46:44 +00:00
########################################
#
# Local policy
#
allow $1_irc_t self:unix_stream_socket create_stream_socket_perms;
allow $1_irc_t self:tcp_socket create_socket_perms;
allow $1_irc_t self:udp_socket create_socket_perms;
2006-12-12 20:08:08 +00:00
manage_dirs_pattern($1_irc_t,$1_irc_home_t,$1_irc_home_t)
manage_files_pattern($1_irc_t,$1_irc_home_t,$1_irc_home_t)
manage_lnk_files_pattern($1_irc_t,$1_irc_home_t,$1_irc_home_t)
2006-02-21 18:40:44 +00:00
userdom_user_home_dir_filetrans($1,$1_irc_t,$1_irc_home_t,{ dir file lnk_file })
2006-01-06 19:46:44 +00:00
# access files under /tmp
2006-12-12 20:08:08 +00:00
manage_dirs_pattern($1_irc_t,$1_irc_tmp_t,$1_irc_tmp_t)
manage_files_pattern($1_irc_t,$1_irc_tmp_t,$1_irc_tmp_t)
manage_lnk_files_pattern($1_irc_t,$1_irc_tmp_t,$1_irc_tmp_t)
manage_fifo_files_pattern($1_irc_t,$1_irc_tmp_t,$1_irc_tmp_t)
manage_sock_files_pattern($1_irc_t,$1_irc_tmp_t,$1_irc_tmp_t)
2006-02-21 18:40:44 +00:00
files_tmp_filetrans($1_irc_t,$1_irc_tmp_t,{ file dir lnk_file sock_file fifo_file })
2006-01-06 19:46:44 +00:00
# Transition from the user domain to the derived domain.
2006-12-12 20:08:08 +00:00
domtrans_pattern($2,irc_exec_t,$1_irc_t)
2006-01-06 19:46:44 +00:00
2006-12-12 20:08:08 +00:00
allow $2 $1_irc_exec_t:file { relabelfrom relabelto manage_file_perms };
2006-01-06 19:46:44 +00:00
# allow ps to show irc
2006-12-12 20:08:08 +00:00
ps_process_pattern($2,$1_irc_t)
allow $2 $1_irc_t:process signal;
2006-01-06 19:46:44 +00:00
kernel_read_proc_symlinks($1_irc_t)
corenet_non_ipsec_sendrecv($1_irc_t)
corenet_tcp_sendrecv_generic_if($1_irc_t)
corenet_udp_sendrecv_generic_if($1_irc_t)
corenet_tcp_sendrecv_all_nodes($1_irc_t)
corenet_udp_sendrecv_all_nodes($1_irc_t)
corenet_tcp_sendrecv_all_ports($1_irc_t)
corenet_udp_sendrecv_all_ports($1_irc_t)
2006-05-29 18:25:58 +00:00
corenet_sendrecv_ircd_client_packets($1_irc_t)
2006-01-06 19:46:44 +00:00
# cjp: this seems excessive:
corenet_tcp_connect_all_ports($1_irc_t)
2006-05-29 18:25:58 +00:00
corenet_sendrecv_all_client_packets($1_irc_t)
2006-01-06 19:46:44 +00:00
2006-02-20 21:33:25 +00:00
domain_use_interactive_fds($1_irc_t)
2006-01-06 19:46:44 +00:00
files_dontaudit_search_pids($1_irc_t)
files_search_var($1_irc_t)
files_read_etc_files($1_irc_t)
files_read_usr_files($1_irc_t)
fs_getattr_xattr_fs($1_irc_t)
fs_search_auto_mountpoints($1_irc_t)
term_use_controlling_term($1_irc_t)
term_list_ptys($1_irc_t)
# allow utmp access
init_read_utmp($1_irc_t)
init_dontaudit_lock_utmp($1_irc_t)
2006-01-06 19:46:44 +00:00
libs_use_ld_so($1_irc_t)
libs_use_shared_libs($1_irc_t)
miscfiles_read_localization($1_irc_t)
# Inherit and use descriptors from newrole.
2006-02-20 21:33:25 +00:00
seutil_use_newrole_fds($1_irc_t)
2006-01-06 19:46:44 +00:00
sysnet_read_config($1_irc_t)
# Write to the user domain tty.
userdom_use_user_terminals($1,$1_irc_t)
tunable_policy(`use_nfs_home_dirs',`
fs_manage_nfs_dirs($1_irc_t)
fs_manage_nfs_files($1_irc_t)
fs_manage_nfs_symlinks($1_irc_t)
')
tunable_policy(`use_samba_home_dirs',`
fs_manage_cifs_dirs($1_irc_t)
fs_manage_cifs_files($1_irc_t)
fs_manage_cifs_symlinks($1_irc_t)
')
optional_policy(`
2006-01-06 19:46:44 +00:00
nis_use_ypbind($1_irc_t)
')
')