Chris PeBenito 4fc915
Chris PeBenito 4fc915
policy_module(authlogin,1.0)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
########################################
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
# Declarations
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
Chris PeBenito 493d6c
type remote_login_t;
Chris PeBenito 8bd678
domain_obj_id_change_exempt(remote_login_t)
Chris PeBenito 8bd678
domain_subj_id_change_exempt(remote_login_t)
Chris PeBenito 8bd678
domain_role_change_exempt(remote_login_t)
Chris PeBenito c9428d
domain_type(remote_login_t)
Chris PeBenito c9428d
domain_wide_inherit_fd(remote_login_t)
Chris PeBenito c9428d
auth_login_entry_type(remote_login_t)
Chris PeBenito 4fc915
role system_r types remote_login_t;
Chris PeBenito 4fc915
Chris PeBenito 4fc915
type remote_login_tmp_t;
Chris PeBenito c9428d
files_tmp_file(remote_login_tmp_t)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
########################################
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
# Remote login remote policy
Chris PeBenito 4fc915
#
Chris PeBenito 4fc915
Chris PeBenito 4fc915
allow remote_login_t self:capability { dac_override chown fowner fsetid kill setgid setuid net_bind_service sys_nice sys_resource sys_tty_config };
Chris PeBenito 9d3bdc
allow remote_login_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 4fc915
allow remote_login_t self:process { setrlimit setexec };
Chris PeBenito 4fc915
allow remote_login_t self:fd use;
Chris PeBenito 0a10b1
allow remote_login_t self:fifo_file rw_file_perms;
Chris PeBenito 0a10b1
allow remote_login_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 0a10b1
allow remote_login_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 4fc915
allow remote_login_t self:unix_dgram_socket sendto;
Chris PeBenito 4fc915
allow remote_login_t self:unix_stream_socket connectto;
Chris PeBenito 0a10b1
allow remote_login_t self:shm create_shm_perms;
Chris PeBenito 0a10b1
allow remote_login_t self:sem create_sem_perms;
Chris PeBenito 0a10b1
allow remote_login_t self:msgq create_msgq_perms;
Chris PeBenito 4fc915
allow remote_login_t self:msg { send receive };
Chris PeBenito 4fc915
Chris PeBenito 0a10b1
allow remote_login_t remote_login_tmp_t:dir create_dir_perms;
Chris PeBenito 0a10b1
allow remote_login_t remote_login_tmp_t:file create_file_perms;
Chris PeBenito c9428d
files_create_tmp_files(remote_login_t, remote_login_tmp_t, { file dir })
Chris PeBenito 4fc915
Chris PeBenito 4fc915
kernel_read_system_state(remote_login_t)
Chris PeBenito 4fc915
kernel_read_kernel_sysctl(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito b24f35
dev_getattr_mouse(remote_login_t)
Chris PeBenito b24f35
dev_setattr_mouse(remote_login_t)
Chris PeBenito b24f35
dev_dontaudit_search_sysfs(remote_login_t)
Chris PeBenito 4fc915
# for SSP/ProPolice
Karl MacMillan f0c985
dev_read_urand(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito 0fd9dc
fs_getattr_xattr_fs(remote_login_t)
Chris PeBenito ab940a
fs_search_auto_mountpoints(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito df00b2
selinux_get_fs_mount(remote_login_t)
Chris PeBenito df00b2
selinux_validate_context(remote_login_t)
Chris PeBenito df00b2
selinux_compute_access_vector(remote_login_t)
Chris PeBenito df00b2
selinux_compute_create_context(remote_login_t)
Chris PeBenito df00b2
selinux_compute_relabel_context(remote_login_t)
Chris PeBenito df00b2
selinux_compute_user_contexts(remote_login_t)
Chris PeBenito df00b2
Chris PeBenito df00b2
term_relabel_all_user_ptys(remote_login_t)
Chris PeBenito df00b2
Chris PeBenito ab940a
auth_domtrans_chk_passwd(remote_login_t)
Chris PeBenito ab940a
auth_dontaudit_read_shadow(remote_login_t)
Chris PeBenito ab940a
auth_rw_login_records(remote_login_t)
Chris PeBenito ab940a
auth_rw_lastlog(remote_login_t)
Chris PeBenito b24f35
auth_rw_faillog(remote_login_t)
Chris PeBenito ab940a
auth_exec_pam(remote_login_t)
Chris PeBenito ab940a
auth_manage_pam_console_data(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito b24f35
corecmd_list_bin(remote_login_t)
Chris PeBenito b24f35
corecmd_list_sbin(remote_login_t)
Chris PeBenito b24f35
corecmd_read_bin_symlink(remote_login_t)
Chris PeBenito b24f35
corecmd_read_sbin_symlink(remote_login_t)
Chris PeBenito b24f35
# cjp: these are probably not needed:
Chris PeBenito b24f35
corecmd_read_bin_file(remote_login_t)
Chris PeBenito b24f35
corecmd_read_bin_pipe(remote_login_t)
Chris PeBenito b24f35
corecmd_read_bin_socket(remote_login_t)
Chris PeBenito b24f35
corecmd_read_sbin_file(remote_login_t)
Chris PeBenito b24f35
corecmd_read_sbin_pipe(remote_login_t)
Chris PeBenito b24f35
corecmd_read_sbin_socket(remote_login_t)
Chris PeBenito b24f35
Chris PeBenito c9428d
domain_read_all_entry_files(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito 8fd367
files_read_etc_files(remote_login_t)
Chris PeBenito c9428d
files_read_etc_runtime_files(remote_login_t)
Chris PeBenito c9428d
files_list_home(remote_login_t)
Chris PeBenito c9428d
files_read_usr_files(remote_login_t)
Chris PeBenito b24f35
files_list_world_readable(remote_login_t)
Chris PeBenito b24f35
files_read_world_readable_files(remote_login_t)
Chris PeBenito b24f35
files_read_world_readable_symlinks(remote_login_t)
Chris PeBenito b24f35
files_read_world_readable_pipes(remote_login_t)
Chris PeBenito b24f35
files_read_world_readable_sockets(remote_login_t)
Chris PeBenito b24f35
files_list_mnt(remote_login_t)
Chris PeBenito b24f35
# for when /var/mail is a sym-link
Chris PeBenito b24f35
files_read_var_symlink(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito ab940a
init_rw_script_pid(remote_login_t)
Chris PeBenito ab940a
Chris PeBenito c9428d
libs_use_ld_so(remote_login_t)
Chris PeBenito c9428d
libs_use_shared_libs(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
logging_send_syslog_msg(remote_login_t)
Chris PeBenito a1f94a
Chris PeBenito 5e0da6
seutil_read_config(remote_login_t)
Chris PeBenito 5e0da6
seutil_read_default_contexts(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
miscfiles_read_localization(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito ab940a
userdom_use_unpriv_users_fd(remote_login_t)
Chris PeBenito b24f35
userdom_search_all_users_home(remote_login_t)
Chris PeBenito b24f35
# Only permit unprivileged user domains to be entered via rlogin,
Chris PeBenito b24f35
# since very weak authentication is used.
Chris PeBenito b24f35
userdom_signal_unpriv_users(remote_login_t)
Chris PeBenito b24f35
userdom_spec_domtrans_unpriv_users(remote_login_t)
Chris PeBenito b24f35
Chris PeBenito b24f35
# Search for mail spool file.
Chris PeBenito b24f35
mta_getattr_spool(remote_login_t)
Chris PeBenito b24f35
Chris PeBenito b24f35
ifdef(`targeted_policy',`
Chris PeBenito b24f35
	unconfined_domain_template(remote_login_t)
Chris PeBenito b24f35
	unconfined_shell_domtrans(remote_login_t)
Chris PeBenito b24f35
')
Chris PeBenito b24f35
Chris PeBenito b24f35
tunable_policy(`read_default_t',`
Chris PeBenito b24f35
	files_list_default(remote_login_t)
Chris PeBenito b24f35
	files_read_default_files(remote_login_t)
Chris PeBenito b24f35
	files_read_default_symlinks(remote_login_t)
Chris PeBenito b24f35
	files_read_default_sockets(remote_login_t)
Chris PeBenito b24f35
	files_read_default_pipes(remote_login_t)
Chris PeBenito b24f35
')
Chris PeBenito b24f35
Chris PeBenito b24f35
# Allow remote login to resolve host names (passed in via the -h switch)
Chris PeBenito b24f35
tunable_policy(`use_dns',`
Chris PeBenito b24f35
	allow remote_login_t self:udp_socket create_socket_perms;
Chris PeBenito b24f35
	corenet_udp_sendrecv_all_if(remote_login_t)
Chris PeBenito b24f35
	corenet_raw_sendrecv_all_if(remote_login_t)
Chris PeBenito b24f35
	corenet_udp_sendrecv_all_nodes(remote_login_t)
Chris PeBenito b24f35
	corenet_raw_sendrecv_all_nodes(remote_login_t)
Chris PeBenito b24f35
	corenet_udp_sendrecv_dns_port(remote_login_t)
Chris PeBenito b24f35
	corenet_udp_bind_all_nodes(remote_login_t)
Chris PeBenito b24f35
	sysnet_read_config(remote_login_t)
Chris PeBenito b24f35
')
Chris PeBenito ab940a
Chris PeBenito d35c62
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito d35c62
	fs_read_nfs_files(remote_login_t)
Chris PeBenito d35c62
	fs_read_nfs_symlinks(remote_login_t)
Chris PeBenito d35c62
')
Chris PeBenito d35c62
Chris PeBenito d35c62
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito d35c62
	fs_read_cifs_files(remote_login_t)
Chris PeBenito d35c62
	fs_read_cifs_symlinks(remote_login_t)
Chris PeBenito d35c62
')
Chris PeBenito d35c62
Chris PeBenito ab940a
optional_policy(`nis.te',`
Chris PeBenito ab940a
	nis_use_ypbind(remote_login_t)
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
Chris PeBenito 493d6c
optional_policy(`nscd.te',`
Chris PeBenito 493d6c
	nscd_use_socket(remote_login_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito b24f35
optional_policy(`usermanage.te',`
Chris PeBenito b24f35
	usermanage_read_crack_db(remote_login_t)
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
Chris PeBenito b24f35
ifdef(`TODO',`
Chris PeBenito b24f35
# this goes to xdm:
Chris PeBenito b24f35
optional_policy(`remotelogin.te',`
Chris PeBenito b24f35
	# FIXME: what is this for?
Chris PeBenito b24f35
	remotelogin_signull(xdm_t)
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
Chris PeBenito 4fc915
allow remote_login_t userpty_type:chr_file { setattr write };
Chris PeBenito df00b2
allow remote_login_t ptyfile:chr_file { getattr ioctl };
Chris PeBenito 4fc915
Chris PeBenito b24f35
optional_policy(`rlogind.te', `
Chris PeBenito b24f35
	allow remote_login_t rlogind_devpts_t:chr_file { setattr rw_file_perms };
Chris PeBenito b24f35
	allow remote_login_t rlogind_devpts_t:chr_file { relabelfrom relabelto };
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
Chris PeBenito b24f35
optional_policy(`telnetd.te', `
Chris PeBenito b24f35
	allow remote_login_t telnetd_devpts_t:chr_file { setattr rw_file_perms };
Chris PeBenito b24f35
	allow remote_login_t telnetd_devpts_t:chr_file { relabelfrom relabelto };
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
') dnl endif TODO