2005-04-27 18:17:25 +00:00
|
|
|
#
|
|
|
|
# This is the guide for converting old macros to local policy
|
|
|
|
# and new interfaces.
|
|
|
|
#
|
|
|
|
# $1, $2, etc. are replaced with and the first and second, etc.
|
|
|
|
# parameters to the old macro.
|
|
|
|
#
|
|
|
|
|
2005-04-29 21:54:06 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Attributes
|
|
|
|
#
|
2005-05-09 21:18:29 +00:00
|
|
|
# $1 is the type this attribute is on
|
2005-04-29 21:54:06 +00:00
|
|
|
|
2005-05-02 21:03:31 +00:00
|
|
|
#
|
|
|
|
# admin_tty_type: complete
|
|
|
|
#
|
|
|
|
{ sysadm_tty_device_t sysadm_devpts_t }
|
|
|
|
|
2005-05-09 21:18:29 +00:00
|
|
|
#
|
|
|
|
# auth: complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
auth_read_shadow($1)
|
2005-05-09 21:18:29 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# auth_chkpwd: complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
auth_domtrans_chk_passwd($1)
|
2005-05-09 21:18:29 +00:00
|
|
|
|
2005-04-29 21:54:06 +00:00
|
|
|
#
|
|
|
|
# file_type: complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
files_file_type($1)
|
2005-04-29 21:54:06 +00:00
|
|
|
|
2005-05-11 19:44:35 +00:00
|
|
|
#
|
|
|
|
# fs_domain: complete
|
|
|
|
#
|
|
|
|
# one or both of these:
|
|
|
|
storage_raw_read_fixed_disk($1)
|
|
|
|
storage_raw_write_fixed_disk($1)
|
|
|
|
|
2005-07-13 20:50:20 +00:00
|
|
|
#
|
|
|
|
# nscd_client_domain: complete
|
|
|
|
#
|
|
|
|
nscd_use_socket($1)
|
|
|
|
|
2005-05-11 19:44:35 +00:00
|
|
|
#
|
|
|
|
# privfd: complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
domain_wide_inherit_fd($1)
|
2005-05-11 19:44:35 +00:00
|
|
|
|
2005-04-29 21:54:06 +00:00
|
|
|
#
|
|
|
|
# privlog: complete
|
2005-05-13 20:39:10 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
logging_send_syslog_msg($1)
|
2005-04-29 21:54:06 +00:00
|
|
|
|
2005-05-13 20:39:10 +00:00
|
|
|
#
|
|
|
|
# privmail:
|
|
|
|
#
|
2005-05-13 20:51:54 +00:00
|
|
|
mta_send_mail($1)
|
2005-05-13 20:39:10 +00:00
|
|
|
# this needs more work:
|
|
|
|
allow mta_user_agent $1:fd use;
|
|
|
|
allow mta_user_agent $1:process sigchld;
|
|
|
|
allow mta_user_agent $1:fifo_file { read write };
|
|
|
|
|
2005-04-29 21:54:06 +00:00
|
|
|
#
|
|
|
|
# privmodule: complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
modutils_domtrans_insmod($1)
|
2005-04-29 21:54:06 +00:00
|
|
|
|
2005-05-09 21:18:29 +00:00
|
|
|
#
|
|
|
|
# privowner: complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
domain_obj_id_change_exempt($1)
|
2005-05-09 21:18:29 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# privrole: complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
domain_role_change_exempt($1)
|
2005-05-09 21:18:29 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# privuser: complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
domain_subj_id_change_exempt($1)
|
2005-04-29 21:54:06 +00:00
|
|
|
|
2005-07-13 20:50:20 +00:00
|
|
|
#
|
|
|
|
# userspace_objmgr: complete
|
|
|
|
#
|
|
|
|
allow $1 self:process getattr;
|
|
|
|
# Receive notifications of policy reloads and enforcing status changes.
|
|
|
|
allow $1 self:netlink_selinux_socket { create bind read };
|
|
|
|
selinux_get_fs_mount($1)
|
|
|
|
selinux_validate_context($1)
|
|
|
|
selinux_compute_access_vector($1)
|
|
|
|
selinux_compute_create_context($1)
|
|
|
|
selinux_compute_relabel_context($1)
|
|
|
|
selinux_compute_user_contexts($1)
|
|
|
|
seutil_read_config($1)
|
|
|
|
seutil_read_default_contexts($1)
|
|
|
|
|
2005-04-27 18:17:25 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Access macros
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# access_terminal():
|
|
|
|
#
|
|
|
|
allow $1 $2_tty_device_t:chr_file { read write getattr ioctl };
|
|
|
|
allow $1 devtty_t:chr_file { read write getattr ioctl };
|
|
|
|
allow $1 devpts_t:dir { read search getattr };
|
|
|
|
allow $1 $2_devpts_t:chr_file { read write getattr ioctl };
|
|
|
|
|
|
|
|
#
|
|
|
|
# append_log_domain():
|
|
|
|
#
|
|
|
|
type $1_log_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
logging_log_file($1_log_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1_t var_log_t:dir ra_dir_perms;
|
|
|
|
allow $1_t $1_log_t:file { create ra_file_perms };
|
|
|
|
type_transition $1_t var_log_t:file $1_log_t;
|
|
|
|
|
|
|
|
#
|
|
|
|
# append_logdir_domain():
|
|
|
|
#
|
|
|
|
type $1_log_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
logging_log_file($1_log_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1_t var_log_t:dir ra_dir_perms;
|
|
|
|
allow $1_t $1_log_t:dir { setattr ra_dir_perms };
|
|
|
|
allow $1_t $1_log_t:file { create ra_file_perms };
|
|
|
|
type_transition $1_t var_log_t:file $1_log_t;
|
|
|
|
|
|
|
|
#
|
|
|
|
# application_domain():
|
|
|
|
#
|
|
|
|
type $1_t;
|
|
|
|
type $1_exec_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
domain_type($1_t)
|
|
|
|
domain_entry_file($1_t,$1_exec_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
role sysadm_r types $1_t;
|
|
|
|
domain_auto_trans(sysadm_t, $1_exec_t, $1_t)
|
2005-07-07 17:25:53 +00:00
|
|
|
libs_use_ld_so($1_t)
|
|
|
|
libs_use_shared_libs($1_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# base_can_network($1,$2):
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 self:$2_socket connected_socket_perms;
|
|
|
|
corenet_$2_sendrecv_all_if($1)
|
|
|
|
corenet_raw_sendrecv_all_if($1)
|
|
|
|
corenet_$2_sendrecv_all_nodes($1)
|
|
|
|
corenet_raw_sendrecv_all_nodes($1)
|
|
|
|
corenet_$2_sendrecv_all_ports($1)
|
|
|
|
corenet_$2_bind_all_nodes($1)
|
|
|
|
sysnet_read_config($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# base_can_network($1,$2,$3):
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 self:$2_socket connected_socket_perms;
|
|
|
|
corenet_$2_sendrecv_all_if($1)
|
|
|
|
corenet_raw_sendrecv_all_if($1)
|
|
|
|
corenet_$2_sendrecv_all_nodes($1)
|
|
|
|
corenet_raw_sendrecv_all_nodes($1)
|
|
|
|
corenet_$2_bind_all_nodes($1)
|
|
|
|
corenet_$2_sendrecv_$3_port($1)
|
|
|
|
sysnet_read_config($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# base_file_read_access():
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
files_list_home($1)
|
|
|
|
files_read_usr_files($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1 bin_t:dir r_dir_perms;
|
|
|
|
allow $1 bin_t:notdevfile_class_set r_file_perms;
|
|
|
|
allow $1 sbin_t:dir r_dir_perms;
|
|
|
|
allow $1 sbin_t:notdevfile_class_set r_file_perms;
|
|
|
|
kernel_read_kernel_sysctl($1)
|
2005-07-07 17:25:53 +00:00
|
|
|
seutil_read_config($1)
|
2005-07-13 20:50:20 +00:00
|
|
|
tunable_policy(`read_default_t',`
|
|
|
|
files_list_default($1)
|
|
|
|
files_read_default_files($1)
|
|
|
|
files_read_default_symlinks($1)
|
|
|
|
files_read_default_sockets($1)
|
|
|
|
files_read_default_pipes($1)
|
|
|
|
')
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# base_pty_perms():
|
|
|
|
#
|
|
|
|
allow $1_t ptmx_t:chr_file rw_file_perms;
|
|
|
|
allow $1_t devpts_t:filesystem getattr;
|
|
|
|
allow $1_t devpts_t:dir { getattr read search };
|
|
|
|
dontaudit $1_t bsdpty_device_t:chr_file { getattr read write };
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_create():
|
|
|
|
#
|
|
|
|
# for each i in $3
|
|
|
|
can_create_internal($1,$2,$i)
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_create_internal($1,$2,dir):
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $2:$3 { create read getattr lock setattr ioctl link unlink rename search add_name remove_name reparent write rmdir };
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_create_internal($1,$2,lnk_file):
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $2:$3 { create read getattr setattr link unlink rename };
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_create_internal($1,$2,[file,chr_file,blk_file,sock_file,fifo_file]):
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $2:$3 { create ioctl read getattr lock write setattr append link unlink rename };
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_create_other_pty(): complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
term_create_pty($1_t,$2_devpts_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1_t $2_devpts_t:chr_file { setattr ioctl read getattr lock write append };
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_create_pty(): complete
|
|
|
|
#
|
|
|
|
# $2 may require more conversion
|
|
|
|
type $1_devpts_t $2;
|
2005-07-07 17:25:53 +00:00
|
|
|
term_pty($1_devpts_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1_t $1_devpts_t:chr_file { setattr ioctl read getattr lock write append };
|
2005-07-07 17:25:53 +00:00
|
|
|
term_create_pty($1_t,$1_devpts_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
2005-05-12 20:52:19 +00:00
|
|
|
# can_exec_any(): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
domain_exec_all_entry_files($1)
|
|
|
|
files_exec_generic_etc_files($1)
|
|
|
|
corecmd_exec_bin($1)
|
|
|
|
corecmd_exec_sbin($1)
|
|
|
|
libs_use_ld_so($1)
|
|
|
|
libs_use_shared_libs($1)
|
|
|
|
libs_exec_ld_so($1)
|
|
|
|
libs_exec_lib_files($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
2005-07-13 20:50:20 +00:00
|
|
|
# can_getcon(): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
|
|
|
allow $1 self:process getattr;
|
2005-05-09 21:18:29 +00:00
|
|
|
kernel_read_system_state($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
# can_getsecurity(): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
selinux_get_fs_mount($1)
|
|
|
|
selinux_validate_context($1)
|
|
|
|
selinux_compute_access_vector($1)
|
|
|
|
selinux_compute_create_context($1)
|
|
|
|
selinux_compute_relabel_context($1)
|
|
|
|
selinux_compute_user_contexts($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
2005-05-02 21:03:31 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
# can_kerberos(): complete
|
2005-05-02 21:03:31 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
optional_policy(`kerberos.te',`
|
|
|
|
kerberos_use($1)
|
|
|
|
')
|
2005-05-02 21:03:31 +00:00
|
|
|
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
# can_ldap(): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
optional_policy(`ldap.te',`
|
|
|
|
allow $1 self:tcp_socket create_socket_perms;
|
|
|
|
corenet_tcp_sendrecv_all_if($1)
|
|
|
|
corenet_raw_sendrecv_all_if($1)
|
|
|
|
corenet_tcp_sendrecv_all_nodes($1)
|
|
|
|
corenet_raw_sendrecv_all_nodes($1)
|
|
|
|
corenet_tcp_sendrecv_ldap_port($1)
|
|
|
|
corenet_tcp_bind_all_nodes($1)
|
|
|
|
sysnet_read_config($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_loadpol(): complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
selinux_get_fs_mount($1)
|
|
|
|
selinux_load_policy($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_network():
|
|
|
|
#
|
|
|
|
can_network_tcp($1, `$2')
|
|
|
|
can_network_udp($1, `$2')
|
|
|
|
ifdef(`mount.te', `
|
|
|
|
allow $1 mount_t:udp_socket rw_socket_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_network_client():
|
|
|
|
#
|
|
|
|
can_network_client_tcp($1, `$2')
|
|
|
|
can_network_udp($1, `$2')
|
|
|
|
|
|
|
|
#
|
2005-05-12 20:52:19 +00:00
|
|
|
# can_network_client_tcp($1): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 self:tcp_socket create_socket_perms;
|
|
|
|
corenet_tcp_sendrecv_all_if($1)
|
|
|
|
corenet_raw_sendrecv_all_if($1)
|
|
|
|
corenet_tcp_sendrecv_all_nodes($1)
|
|
|
|
corenet_raw_sendrecv_all_nodes($1)
|
|
|
|
corenet_tcp_sendrecv_all_ports($1)
|
|
|
|
corenet_tcp_bind_all_nodes($1)
|
|
|
|
sysnet_read_config($1)
|
2005-05-12 20:52:19 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_network_client_tcp($1,$2):
|
|
|
|
#
|
|
|
|
# remove _port_t from $2
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 self:tcp_socket create_socket_perms;
|
|
|
|
corenet_tcp_sendrecv_all_if($1)
|
|
|
|
corenet_raw_sendrecv_all_if($1)
|
|
|
|
corenet_tcp_sendrecv_all_nodes($1)
|
|
|
|
corenet_raw_sendrecv_all_nodes($1)
|
|
|
|
corenet_tcp_sendrecv_$2_port($1)
|
|
|
|
corenet_tcp_bind_all_nodes($1)
|
|
|
|
sysnet_read_config($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_network_server():
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 self:tcp_socket create_stream_socket_perms;
|
2005-04-27 18:17:25 +00:00
|
|
|
base_can_network($1, tcp, `$2')
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_network_server_tcp():
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 self:tcp_socket create_stream_socket_perms;
|
2005-04-27 18:17:25 +00:00
|
|
|
base_can_network($1, tcp, `$2')
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_network_tcp(): complete
|
|
|
|
#
|
|
|
|
can_network_server_tcp($1, `$2')
|
|
|
|
can_network_client_tcp($1, `$2')
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_network_udp(): complete
|
|
|
|
#
|
|
|
|
base_can_network($1, udp, `$2')
|
|
|
|
allow $1 self:udp_socket { connect };
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_ps():
|
|
|
|
#
|
|
|
|
allow $1 $2:dir { search getattr read };
|
|
|
|
allow $1 $2:{ file lnk_file } { read getattr };
|
|
|
|
allow $1 $2:process getattr;
|
|
|
|
# We need to suppress this denial because procps tries to access
|
|
|
|
# /proc/pid/environ and this now triggers a ptrace check in recent kernels
|
|
|
|
# (2.4 and 2.6). Might want to change procps to not do this, or only if
|
|
|
|
# running in a privileged domain.
|
|
|
|
dontaudit $1 $2:process ptrace;
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_ptrace():
|
|
|
|
#
|
|
|
|
allow $1 $2:process ptrace;
|
|
|
|
allow $2 $1:process sigchld;
|
|
|
|
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
# can_resolve(): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-05-09 21:18:29 +00:00
|
|
|
tunable_policy(`use_dns',`
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 self:udp_socket create_socket_perms;
|
|
|
|
corenet_udp_sendrecv_all_if($1)
|
|
|
|
corenet_raw_sendrecv_all_if($1)
|
|
|
|
corenet_udp_sendrecv_all_nodes($1)
|
|
|
|
corenet_raw_sendrecv_all_nodes($1)
|
|
|
|
corenet_udp_sendrecv_dns_port($1)
|
|
|
|
corenet_udp_bind_all_nodes($1)
|
|
|
|
sysnet_read_config($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_setbool(): complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
selinux_get_fs_mount($1)
|
|
|
|
selinux_set_boolean($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
# can_setcon(): complete
|
|
|
|
#
|
|
|
|
# get mount point is due to libselinux init
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
|
|
|
allow $1 self:process setcurrent;
|
2005-07-07 17:25:53 +00:00
|
|
|
selinux_get_fs_mount($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_setenforce(): complete
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
# get mount point is due to libselinux init
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
selinux_get_fs_mount($1)
|
|
|
|
selinux_set_enforce_mode($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
# can_setexec(): complete
|
|
|
|
#
|
|
|
|
# get mount point is due to libselinux init
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
|
|
|
allow $1 self:process setexec;
|
2005-07-07 17:25:53 +00:00
|
|
|
selinux_get_fs_mount($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
# can_setfscreate(): complete
|
|
|
|
#
|
|
|
|
# get mount point is due to libselinux init
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
|
|
|
allow $1 self:process setfscreate;
|
2005-07-07 17:25:53 +00:00
|
|
|
selinux_get_fs_mount($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
# can_setsecparam(): complete
|
|
|
|
#
|
|
|
|
# get mount point is due to libselinux init
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
selinux_get_fs_mount($1)
|
2005-04-29 21:54:06 +00:00
|
|
|
kernel_setsecparam($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_sysctl(): complete
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
kernel_rw_all_sysctl($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_tcp_connect
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 $2:tcp_socket { connectto recvfrom };
|
|
|
|
allow $2 $1:tcp_socket { acceptfrom recvfrom };
|
|
|
|
allow $2 kernel_t:tcp_socket recvfrom;
|
|
|
|
allow $1 kernel_t:tcp_socket recvfrom;
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_udp_send():
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 $2:udp_socket sendto;
|
|
|
|
allow $2 $1:udp_socket recvfrom;
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# can_unix_connect():
|
|
|
|
#
|
|
|
|
allow $1 $2:unix_stream_socket connectto;
|
|
|
|
|
|
|
|
#
|
|
|
|
# can_unix_send():
|
|
|
|
#
|
|
|
|
allow $1 $2:unix_dgram_socket sendto;
|
|
|
|
|
2005-04-29 21:54:06 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
# can_ypbind(): complete
|
2005-04-29 21:54:06 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
optional_policy(`nis.te',`
|
|
|
|
nis_use_ypbind($1)
|
|
|
|
')
|
2005-04-29 21:54:06 +00:00
|
|
|
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
|
|
|
# create_append_log_file():
|
|
|
|
#
|
|
|
|
allow $1 $2:dir { read getattr search add_name write };
|
|
|
|
allow $1 $2:file { create ioctl getattr setattr append link };
|
|
|
|
|
|
|
|
#
|
|
|
|
# create_dir_file():
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $2:dir { create read getattr lock setattr ioctl link unlink rename search add_name remove_name reparent write rmdir };
|
|
|
|
allow $1 $2:file { create ioctl read getattr lock write setattr append link unlink rename };
|
|
|
|
allow $1 $2:lnk_file { create read getattr setattr link unlink rename };
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# create_dir_notdevfile():
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $2:dir { create read getattr lock setattr ioctl link unlink rename search add_name remove_name reparent write rmdir };
|
|
|
|
allow $1 $2:{ file sock_file fifo_file } { create ioctl read getattr lock write setattr append link unlink rename };
|
|
|
|
allow $1 $2:lnk_file { create read getattr setattr link unlink rename };
|
|
|
|
|
|
|
|
#
|
|
|
|
# daemon_base_domain():
|
|
|
|
#
|
|
|
|
type $1_t;
|
|
|
|
type $1_exec_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
init_daemon_domain($1_t,$1_exec_t)
|
2005-04-29 21:54:06 +00:00
|
|
|
role system_r types $1_t;
|
|
|
|
dontaudit $1_t self:capability sys_tty_config;
|
|
|
|
allow $1_t self:process { sigchld sigkill sigstop signull signal };
|
|
|
|
kernel_read_kernel_sysctl($1_t)
|
2005-07-07 17:25:53 +00:00
|
|
|
dev_read_sysfs($1_t)
|
|
|
|
fs_search_auto_mountpoints($1_t)
|
|
|
|
term_dontaudit_use_console($1_t)
|
|
|
|
domain_use_wide_inherit_fd($1_t)
|
|
|
|
init_use_fd($1_t)
|
|
|
|
init_use_script_pty($1_t)
|
|
|
|
libs_use_ld_so($1_t)
|
|
|
|
libs_use_shared_libs($1_t)
|
|
|
|
logging_send_syslog_msg($1_t)
|
|
|
|
userdom_dontaudit_use_unpriv_user_fd($1_t)
|
|
|
|
ifdef(`targeted_policy',`
|
|
|
|
term_dontaudit_use_unallocated_tty($1_t)
|
|
|
|
term_dontaudit_use_generic_pty($1_t)
|
|
|
|
files_dontaudit_read_root_file($1_t)
|
2005-05-11 19:44:35 +00:00
|
|
|
')
|
2005-07-07 17:25:53 +00:00
|
|
|
optional_policy(`rhgb.te',`
|
|
|
|
rhgb_domain($1_t)
|
2005-04-29 21:54:06 +00:00
|
|
|
')
|
2005-05-11 19:44:35 +00:00
|
|
|
optional_policy(`selinux.te',`
|
2005-07-07 17:25:53 +00:00
|
|
|
seutil_newrole_sigchld($1_t)
|
2005-05-11 19:44:35 +00:00
|
|
|
')
|
2005-04-29 21:54:06 +00:00
|
|
|
optional_policy(`udev.te', `
|
2005-07-07 17:25:53 +00:00
|
|
|
udev_read_db($1_t)
|
2005-04-29 21:54:06 +00:00
|
|
|
')
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1_t proc_t:dir r_dir_perms;
|
|
|
|
allow $1_t proc_t:lnk_file read;
|
2005-04-29 21:54:06 +00:00
|
|
|
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# daemon_domain():
|
|
|
|
#
|
|
|
|
type $1_t;
|
|
|
|
type $1_exec_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
init_daemon_domain($1_t,$1_exec_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
type $1_var_run_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
files_pid_file($1_var_run_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
dontaudit $1_t self:capability sys_tty_config;
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1_t $1_var_run_t:file { getattr create read write append setattr unlink };
|
|
|
|
files_create_pid($1_t,$1_var_run_t)
|
2005-04-29 21:54:06 +00:00
|
|
|
kernel_read_kernel_sysctl($1_t)
|
2005-07-13 20:50:20 +00:00
|
|
|
kernel_list_proc($1_t)
|
|
|
|
kernel_read_proc_symlink($1_t)
|
2005-07-07 17:25:53 +00:00
|
|
|
dev_read_sysfs($1_t)
|
|
|
|
fs_getattr_all_fs($1_t)
|
|
|
|
fs_search_auto_mountpoints($1_t)
|
|
|
|
term_dontaudit_use_console($1_t)
|
|
|
|
domain_use_wide_inherit_fd($1_t)
|
|
|
|
init_use_fd($1_t)
|
|
|
|
init_use_script_pty($1_t)
|
|
|
|
libs_use_ld_so($1_t)
|
|
|
|
libs_use_shared_libs($1_t)
|
|
|
|
logging_send_syslog_msg($1_t)
|
2005-04-29 21:54:06 +00:00
|
|
|
miscfiles_read_localization($1_t)
|
2005-07-07 17:25:53 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fd($1_t)
|
2005-07-13 20:50:20 +00:00
|
|
|
userdom_dontaudit_search_sysadm_home_dir($1_t)
|
2005-07-07 17:25:53 +00:00
|
|
|
ifdef(`targeted_policy', `
|
|
|
|
term_dontaudit_use_unallocated_tty($1_t)
|
|
|
|
term_dontaudit_use_generic_pty($1_t)
|
|
|
|
files_dontaudit_read_root_file($1_t)
|
2005-05-11 19:44:35 +00:00
|
|
|
')
|
2005-07-07 17:25:53 +00:00
|
|
|
optional_policy(`rhgb.te',`
|
|
|
|
rhgb_domain($1_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
')
|
2005-07-13 20:50:20 +00:00
|
|
|
optional_policy(`selinuxutils.te',`
|
|
|
|
seutil_sigchld_newrole($1_t)
|
2005-05-02 21:03:31 +00:00
|
|
|
')
|
2005-05-11 19:44:35 +00:00
|
|
|
optional_policy(`udev.te', `
|
2005-07-07 17:25:53 +00:00
|
|
|
udev_read_db($1_t)
|
2005-05-11 19:44:35 +00:00
|
|
|
')
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# daemon_sub_domain():
|
|
|
|
#
|
|
|
|
# $1 is the parent domain (or domains), $2_t is the child domain,
|
|
|
|
# and $3 is any attributes to apply to the child
|
|
|
|
type $2_t, domain, privlog, daemon $3;
|
|
|
|
type $2_exec_t, file_type, sysadmfile, exec_type;
|
|
|
|
role system_r types $2_t;
|
|
|
|
domain_auto_trans($1, $2_exec_t, $2_t)
|
|
|
|
allow $2_t $1:fd use;
|
|
|
|
allow $2_t $1:process sigchld;
|
|
|
|
allow $2_t self:process signal_perms;
|
2005-07-07 17:25:53 +00:00
|
|
|
libs_use_ld_so($2_t)
|
|
|
|
libs_use_shared_libs($2_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $2_t proc_t:dir r_dir_perms;
|
|
|
|
allow $2_t proc_t:lnk_file read;
|
|
|
|
allow $2_t device_t:dir getattr;
|
|
|
|
|
|
|
|
#
|
|
|
|
# etc_domain():
|
|
|
|
#
|
|
|
|
type $1_etc_t; #, usercanread;
|
2005-07-07 17:25:53 +00:00
|
|
|
files_file_type($1_etc_t)
|
2005-05-09 21:18:29 +00:00
|
|
|
allow $1_t $1_etc_t:file { getattr read };
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# etcdir_domain():
|
|
|
|
#
|
|
|
|
type $1_etc_t; #, usercanread;
|
2005-07-07 17:25:53 +00:00
|
|
|
files_file_type($1_etc_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1_t $1_etc_t:file r_file_perms;
|
|
|
|
allow $1_t $1_etc_t:dir r_dir_perms;
|
|
|
|
allow $1_t $1_etc_t:lnk_file { getattr read };
|
|
|
|
|
|
|
|
#
|
2005-05-09 21:18:29 +00:00
|
|
|
# file_type_auto_trans($1,$2,$3):
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $3:dir { read getattr lock search ioctl add_name remove_name write };
|
|
|
|
allow $1 $3:file { create ioctl read getattr lock write setattr append link unlink rename };
|
|
|
|
allow $1 $3:lnk_file { create read getattr setattr link unlink rename };
|
|
|
|
allow $1 $3:sock_file { create ioctl read getattr lock write setattr append link unlink rename };
|
|
|
|
allow $1 $3:fifo_file { create ioctl read getattr lock write setattr append link unlink rename };
|
2005-04-27 18:17:25 +00:00
|
|
|
type_transition $1 $2:{ dir file lnk_file sock_file fifo_file } $3;
|
|
|
|
|
|
|
|
#
|
2005-05-09 21:18:29 +00:00
|
|
|
# file_type_auto_trans($1,$2,$3,$4):
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $2:dir { read getattr lock search ioctl add_name remove_name write };
|
2005-05-12 14:49:46 +00:00
|
|
|
# for each i in $4:
|
|
|
|
can_create_internal($1,$3,$i)
|
2005-04-27 18:17:25 +00:00
|
|
|
type_transition $1 $2:$i $3;
|
|
|
|
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
# general_domain_access(): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
|
|
|
allow $1 self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem dyntransition };
|
|
|
|
allow $1 self:fd use;
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 self:fifo_file rw_file_perms;
|
|
|
|
allow $1 self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow $1 self:unix_stream_socket create_stream_socket_perms;
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1 self:unix_dgram_socket sendto;
|
|
|
|
allow $1 self:unix_stream_socket connectto;
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1 self:shm create_shm_perms;
|
|
|
|
allow $1 self:sem create_sem_perms;
|
|
|
|
allow $1 self:msgq create_msgq_perms;
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1 self:msg { send receive };
|
2005-07-07 17:25:53 +00:00
|
|
|
fs_search_auto_mountpoints($1)
|
|
|
|
userdom_use_unpriv_user_fd($1)
|
|
|
|
optional_policy(`nis.te',`
|
|
|
|
nis_use_ypbind($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
#
|
|
|
|
# general_proc_read_access(): complete
|
|
|
|
#
|
|
|
|
kernel_read_system_state($1)
|
2005-07-07 17:25:53 +00:00
|
|
|
kernel_read_sendrecv_state($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
kernel_read_software_raid_state($1)
|
2005-07-07 17:25:53 +00:00
|
|
|
kernel_getattr_core($1)
|
|
|
|
kernel_getattr_message_if($1)
|
2005-04-27 18:17:25 +00:00
|
|
|
kernel_read_kernel_sysctl($1)
|
|
|
|
|
|
|
|
#
|
|
|
|
# home_domain():
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# home_domain_access():
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# home_domain_ro():
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# home_domain_ro_access():
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# in_user_role():
|
|
|
|
#
|
|
|
|
role user_r types $1;
|
|
|
|
role staff_r types $1;
|
|
|
|
|
|
|
|
#
|
|
|
|
# init_service_domain():
|
|
|
|
#
|
|
|
|
type $1_t;
|
|
|
|
type $1_exec_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
init_daemon_domain($1_t,$1_exec_t)
|
2005-04-29 21:54:06 +00:00
|
|
|
dontaudit $1_t self:capability sys_tty_config;
|
2005-07-07 17:25:53 +00:00
|
|
|
dev_read_sysfs($1_t)
|
|
|
|
term_dontaudit_use_console($1_t)
|
|
|
|
init_use_fd($1_t)
|
|
|
|
libs_use_ld_so($1_t)
|
|
|
|
libs_use_shared_libs($1_t)
|
|
|
|
logging_send_syslog_msg($1_t)
|
2005-05-02 21:03:31 +00:00
|
|
|
tunable_policy(`targeted_policy', `
|
2005-07-07 17:25:53 +00:00
|
|
|
term_dontaudit_use_unallocated_tty($1_t)
|
|
|
|
term_dontaudit_use_generic_pty($1_t)
|
|
|
|
files_dontaudit_read_root_file($1_t)
|
2005-05-02 21:03:31 +00:00
|
|
|
')dnl end targeted_policy tunable
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1_t proc_t:dir r_dir_perms;
|
|
|
|
allow $1_t proc_t:lnk_file read;
|
2005-04-29 21:54:06 +00:00
|
|
|
optional_policy(`udev.te', `
|
2005-07-07 17:25:53 +00:00
|
|
|
udev_read_db($1_t)
|
2005-04-29 21:54:06 +00:00
|
|
|
')
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1_t autofs_t:dir { search getattr };
|
|
|
|
dontaudit $1_t unpriv_userdomain:fd use;
|
|
|
|
|
2005-07-07 17:25:53 +00:00
|
|
|
#
|
|
|
|
# inetd_child_domain():
|
|
|
|
#
|
|
|
|
type $1_t; #, nscd_client_domain;
|
|
|
|
type $1_exec_t;
|
|
|
|
inetd_(udp_|tcp_)?service_domain($1_t,$1_exec_t)
|
|
|
|
role system_r types $1_t;
|
|
|
|
type $1_tmp_t;
|
|
|
|
files_tmp_file($1_tmp_t)
|
|
|
|
type $1_var_run_t;
|
|
|
|
files_pid_file($1_var_run_t)
|
|
|
|
allow $1_t self:process signal_perms;
|
|
|
|
allow $1_t self:fifo_file rw_file_perms;
|
|
|
|
allow $1_t self:tcp_socket { listen accept connected_socket_perms }
|
|
|
|
# for identd
|
|
|
|
# cjp: this should probably only be inetd_child rules?
|
|
|
|
allow $1_t self:netlink_tcpdiag_socket r_netlink_socket_perms;
|
|
|
|
allow $1_t self:capability { setuid setgid };
|
|
|
|
allow $1_t self:dir search;
|
|
|
|
allow $1_t self:{ lnk_file file } { getattr read };
|
|
|
|
#allow $1_t home_root_t:dir search;
|
|
|
|
#can_kerberos($1_t)
|
|
|
|
#end for identd
|
|
|
|
allow $1_t $1_tmp_t:dir create_dir_perms;
|
|
|
|
allow $1_t $1_tmp_t:file create_file_perms;
|
|
|
|
files_create_tmp_files($1_t, $1_tmp_t, { file dir })
|
|
|
|
allow $1_t $1_var_run_t:file create_file_perms;
|
|
|
|
files_create_pid($1_t,$1_var_run_t)
|
|
|
|
kernel_read_kernel_sysctl($1_t)
|
|
|
|
kernel_read_system_state($1_t)
|
|
|
|
kernel_read_network_state($1_t)
|
|
|
|
corenet_sendrecv_tcp_on_all_interfaces($1_t)
|
|
|
|
corenet_sendrecv_raw_on_all_interfaces($1_t)
|
|
|
|
corenet_sendrecv_tcp_on_all_nodes($1_t)
|
|
|
|
corenet_sendrecv_raw_on_all_nodes($1_t)
|
|
|
|
corenet_bind_tcp_on_all_nodes($1_t)
|
|
|
|
corenet_sendrecv_tcp_on_all_ports($1_t)
|
|
|
|
dev_read_urand($1_t)
|
|
|
|
fs_getattr_xattr_fs($1_t)
|
|
|
|
files_read_generic_etc_files($1_t)
|
|
|
|
libs_use_ld_so($1_t)
|
|
|
|
libs_use_shared_libs($1_t)
|
|
|
|
logging_send_syslog_msg($1_t)
|
|
|
|
miscfiles_read_localization($1_t)
|
|
|
|
sysnet_read_config($1_t)
|
|
|
|
optional_policy(`nis.te',`
|
|
|
|
nis_use_ypbind($1_t)
|
|
|
|
')
|
|
|
|
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
|
|
|
# legacy_domain(): complete
|
|
|
|
#
|
|
|
|
allow $1_t self:process execmem;
|
2005-07-07 17:25:53 +00:00
|
|
|
libs_legacy_use_shared_libs($1_t)
|
|
|
|
libs_legacy_use_ld_so($1_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
2005-05-12 14:49:46 +00:00
|
|
|
# lock_domain(): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-05-12 14:49:46 +00:00
|
|
|
type $1_lock_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
files_lock_file($1_lock_t)
|
|
|
|
allow $1_t $1_lock_t:file create_file_perms;
|
|
|
|
files_create_lock_file($1_t,$1_lock_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
# log_domain(): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
type $1_log_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
logging_log_file($1_log_t)
|
|
|
|
allow $1_t $1_log_t:file create_file_perms;
|
|
|
|
logging_create_log($1_t,$1_log_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
# logdir_domain(): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
type $1_log_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
logging_log_file($1_log_t)
|
|
|
|
allow $1_t $1_log_t:file create_file_perms;
|
|
|
|
allow $1_t $1_log_t:dir rw_dir_perms;
|
|
|
|
logging_search_logs($1_t,$1_log_t,{ file dir })
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# mini_user_domain():
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# network_home_dir():
|
|
|
|
#
|
|
|
|
create_dir_file($1, $2)
|
|
|
|
can_exec($1, $2)
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $2:{ sock_file fifo_file } { create ioctl read getattr lock write setattr append link unlink rename };
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# pty_slave_label():
|
|
|
|
#
|
|
|
|
type $1_devpts_t, file_type, sysadmfile, ptyfile $2;
|
|
|
|
allow $1_devpts_t devpts_t:filesystem associate;
|
|
|
|
type_transition $1_t devpts_t:chr_file $1_devpts_t;
|
|
|
|
allow $1_t $1_devpts_t:chr_file { setattr rw_file_perms };
|
|
|
|
|
|
|
|
#
|
|
|
|
# r_dir_file():
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $2:dir { getattr read search };
|
|
|
|
allow $1 $2:file { read getattr };
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1 $2:lnk_file { getattr read };
|
|
|
|
|
|
|
|
#
|
|
|
|
# ra_dir_create_file():
|
|
|
|
#
|
|
|
|
allow $1 $2:dir ra_dir_perms;
|
|
|
|
allow $1 $2:file { create ra_file_perms };
|
|
|
|
allow $1 $2:lnk_file { create read getattr };
|
|
|
|
|
|
|
|
#
|
|
|
|
# ra_dir_file():
|
|
|
|
#
|
|
|
|
allow $1 $2:dir ra_dir_perms;
|
|
|
|
allow $1 $2:file ra_file_perms;
|
|
|
|
allow $1 $2:lnk_file { getattr read };
|
|
|
|
|
|
|
|
#
|
|
|
|
# read_locale(): complete
|
|
|
|
#
|
|
|
|
miscfiles_read_localization($1)
|
|
|
|
|
|
|
|
#
|
|
|
|
# read_sysctl($1): complete
|
|
|
|
#
|
|
|
|
kernel_read_kernel_sysctl($1)
|
|
|
|
|
|
|
|
#
|
|
|
|
# read_sysctl($1,full): complete
|
|
|
|
#
|
|
|
|
kernel_read_all_sysctl($1)
|
|
|
|
|
|
|
|
#
|
|
|
|
# rhgb_domain():
|
|
|
|
#
|
|
|
|
ifdef(`rhgb.te', `
|
|
|
|
allow $1 rhgb_t:process sigchld;
|
|
|
|
allow $1 rhgb_t:fd use;
|
|
|
|
allow $1 rhgb_t:fifo_file { read write };
|
|
|
|
')
|
|
|
|
|
|
|
|
#
|
|
|
|
# rw_dir_create_file():
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $2:dir { read getattr lock search ioctl add_name remove_name write };
|
|
|
|
allow $1 $2:file { create ioctl read getattr lock write setattr append link unlink rename };
|
|
|
|
allow $1 $2:lnk_file { create read getattr setattr link unlink rename };
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# rw_dir_file():
|
|
|
|
#
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1 $2:dir { read getattr lock search ioctl add_name remove_name write };
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1 $2:file rw_file_perms;
|
|
|
|
allow $1 $2:lnk_file { getattr read };
|
|
|
|
|
|
|
|
#
|
|
|
|
# system_domain():
|
|
|
|
#
|
2005-05-04 19:32:29 +00:00
|
|
|
type $1_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
domain_type($1_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
role system_r types $1_t;
|
2005-05-04 19:32:29 +00:00
|
|
|
type $1_exec_t;
|
2005-07-07 17:25:53 +00:00
|
|
|
domain_entry_file($1_t,$1_exec_t)
|
|
|
|
libs_use_ld_so($1_t)
|
|
|
|
libs_use_shared_libs($1_t)
|
|
|
|
logging_send_syslog_msg($1_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
allow $1_t etc_t:dir r_dir_perms;
|
|
|
|
|
|
|
|
#
|
|
|
|
# tmp_domain(): complete
|
|
|
|
#
|
|
|
|
# $2 may need more handling
|
|
|
|
#
|
|
|
|
type $1_tmp_t $2;
|
2005-07-07 17:25:53 +00:00
|
|
|
files_tmp_file($1_tmp_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
# no class specified:
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1_t $1_tmp_t:dir create_dir_perms;
|
|
|
|
allow $1_t $1_tmp_t:file create_file_perms;
|
|
|
|
files_create_tmp_files($1_t, $1_tmp_t, { file dir })
|
2005-04-27 18:17:25 +00:00
|
|
|
# class specified:
|
2005-07-07 17:25:53 +00:00
|
|
|
files_create_tmp_files($1_t, $1_tmp_t, $3)
|
2005-04-27 18:17:25 +00:00
|
|
|
# $3 manage object perms here
|
|
|
|
|
2005-04-29 21:54:06 +00:00
|
|
|
#
|
|
|
|
# tmp_domain($1,$2,$3): complete
|
|
|
|
#
|
|
|
|
# $2 may need more handling
|
|
|
|
#
|
|
|
|
type $1_tmp_t $2;
|
2005-07-07 17:25:53 +00:00
|
|
|
files_tmp_file($1_tmp_t)
|
|
|
|
files_create_tmp_files($1_t, $1_tmp_t, $3)
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1_t $1_tmp_t:$3 manage_obj_perms;
|
|
|
|
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
# tmpfs_domain(): complete
|
2005-04-27 18:17:25 +00:00
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
type $1_tmpfs_t;
|
|
|
|
files_tmpfs_file($1_tmpfs_t)
|
|
|
|
allow $1_t $1_tmpfs_t:dir { read getattr lock search ioctl add_name remove_name write };
|
|
|
|
allow $1_t $1_tmpfs_t:file { create ioctl read getattr lock write setattr append link unlink rename };
|
|
|
|
allow $1_t $1_tmpfs_t:lnk_file { create read getattr setattr link unlink rename };
|
|
|
|
allow $1_t $1_tmpfs_t:sock_file { create ioctl read getattr lock write setattr append link unlink rename };
|
|
|
|
allow $1_t $1_tmpfs_t:fifo_file { create ioctl read getattr lock write setattr append link unlink rename };
|
|
|
|
filesystem_create_private_tmpfs_data($1_t,$1_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# unconfined_domain():
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# user_application_domain():
|
|
|
|
#
|
|
|
|
type $1_t, domain, privlog $2;
|
|
|
|
type $1_exec_t, file_type, sysadmfile, exec_type;
|
|
|
|
role sysadm_r types $1_t;
|
|
|
|
domain_auto_trans(sysadm_t, $1_exec_t, $1_t)
|
2005-07-07 17:25:53 +00:00
|
|
|
libs_use_ld_so($1_t)
|
|
|
|
libs_use_shared_libs($1_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
in_user_role($1_t)
|
|
|
|
domain_auto_trans(userdomain, $1_exec_t, $1_t)
|
|
|
|
|
|
|
|
#
|
|
|
|
# uses_authbind():
|
|
|
|
#
|
|
|
|
domain_auto_trans($1, authbind_exec_t, authbind_t)
|
|
|
|
allow authbind_t $1:process sigchld;
|
|
|
|
allow authbind_t $1:fd use;
|
|
|
|
allow authbind_t $1:{ tcp_socket udp_socket } rw_socket_perms;
|
|
|
|
|
|
|
|
#
|
|
|
|
# var_lib_domain():
|
|
|
|
#
|
|
|
|
type $1_var_lib_t, file_type, sysadmfile;
|
|
|
|
typealias $1_var_lib_t alias var_lib_$1_t;
|
|
|
|
file_type_auto_trans($1_t, var_lib_t, $1_var_lib_t, file)
|
2005-07-07 17:25:53 +00:00
|
|
|
allow $1_t $1_var_lib_t:dir rw_dir_perms;
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# var_run_domain($1):
|
|
|
|
#
|
2005-07-07 17:25:53 +00:00
|
|
|
type $1_var_run_t;
|
|
|
|
files_pid_file($1_var_run_t)
|
|
|
|
allow $1_t $1_var_run_t:file create_file_perms;
|
|
|
|
files_create_pid($1_t,$1_var_run_t)
|
2005-04-27 18:17:25 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# var_run_domain($1,$2):
|
|
|
|
#
|
|
|
|
type $1_var_run_t, file_type, sysadmfile, pidfile;
|
|
|
|
file_type_auto_trans($1_t, var_run_t, $1_var_run_t, $2)
|
|
|
|
allow $1_t var_t:dir search;
|
2005-04-29 21:54:06 +00:00
|
|
|
allow $1_t $1_var_run_t:dir { read getattr lock search ioctl add_name remove_name write };
|