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 a1f94a
type remote_login_t; #, nscd_client_domain;
Chris PeBenito c9428d
kernel_obj_id_change_exempt(remote_login_t)
Chris PeBenito c9428d
kernel_subj_id_change_exempt(remote_login_t)
Chris PeBenito c9428d
kernel_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 4fc915
allow remote_login_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem dyntransition };
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
kernel_get_selinuxfs_mount_point(remote_login_t)
Chris PeBenito 0fd9dc
kernel_validate_context(remote_login_t)
Chris PeBenito 0fd9dc
kernel_compute_access_vector(remote_login_t)
Chris PeBenito 0fd9dc
kernel_compute_create_context(remote_login_t)
Chris PeBenito 0fd9dc
kernel_compute_relabel_context(remote_login_t)
Chris PeBenito 0fd9dc
kernel_compute_reachable_user_contexts(remote_login_t)
Chris PeBenito 4fc915
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 4fc915
Chris PeBenito c9428d
init_rw_script_pid(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
domain_read_all_entry_files(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
files_read_generic_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 4fc915
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 4fc915
selinux_read_config(remote_login_t)
Chris PeBenito 4fc915
selinux_read_default_contexts(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito c9428d
auth_domtrans_chk_passwd(remote_login_t)
Chris PeBenito c9428d
auth_dontaudit_read_shadow(remote_login_t)
Chris PeBenito c9428d
auth_rw_login_records(remote_login_t)
Chris PeBenito c9428d
auth_rw_lastlog(remote_login_t)
Chris PeBenito c9428d
auth_exec_pam(remote_login_t)
Chris PeBenito c9428d
auth_manage_pam_console_data(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
miscfiles_read_localization(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
ifdef(`TODO',`
Chris PeBenito 4fc915
allow remote_login_t unpriv_userdomain:fd use;
Chris PeBenito 4fc915
can_ypbind(remote_login_t)
Chris PeBenito 4fc915
ifdef(`automount.te', `
Chris PeBenito 4fc915
allow remote_login_t autofs_t:dir { search getattr };
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
Chris PeBenito 4fc915
allow remote_login_t bin_t:dir r_dir_perms;
Chris PeBenito 4fc915
allow remote_login_t bin_t:notdevfile_class_set r_file_perms;
Chris PeBenito 4fc915
allow remote_login_t sbin_t:dir r_dir_perms;
Chris PeBenito 4fc915
allow remote_login_t sbin_t:notdevfile_class_set r_file_perms;
Chris PeBenito 4fc915
if (read_default_t) {
Chris PeBenito 4fc915
allow remote_login_t default_t:dir r_dir_perms;
Chris PeBenito 4fc915
allow remote_login_t default_t:notdevfile_class_set r_file_perms;
Chris PeBenito 4fc915
}
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Read directories and files with the readable_t type.
Chris PeBenito 4fc915
# This type is a general type for "world"-readable files.
Chris PeBenito 4fc915
allow remote_login_t readable_t:dir r_dir_perms;
Chris PeBenito 4fc915
allow remote_login_t readable_t:notdevfile_class_set r_file_perms;
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Read /var, /var/spool
Chris PeBenito 4fc915
allow remote_login_t { var_t var_spool_t }:dir search;
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# for when /var/mail is a sym-link
Chris PeBenito 4fc915
allow remote_login_t var_t:lnk_file read;
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Read /dev directories and any symbolic links.
Chris PeBenito 4fc915
allow remote_login_t device_t:lnk_file r_file_perms;
Chris PeBenito 4fc915
Chris PeBenito 4fc915
dontaudit remote_login_t sysfs_t:dir search;
Chris PeBenito 4fc915
Chris PeBenito 0a10b1
allow remote_login_t autofs_t:dir r_dir_perms;
Chris PeBenito 4fc915
allow remote_login_t mnt_t:dir r_dir_perms;
Chris PeBenito 4fc915
Chris PeBenito 4fc915
if (use_nfs_home_dirs) {
Chris PeBenito 4fc915
r_dir_file(remote_login_t, nfs_t)
Chris PeBenito 4fc915
}
Chris PeBenito 4fc915
Chris PeBenito 4fc915
if (use_samba_home_dirs) {
Chris PeBenito 4fc915
r_dir_file(remote_login_t, cifs_t)
Chris PeBenito 4fc915
}
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# FIXME: what is this for?
Chris PeBenito 4fc915
ifdef(`xdm.te', `
Chris PeBenito 4fc915
allow xdm_t remote_login_t:process signull;
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
Chris PeBenito 4fc915
ifdef(`crack.te', `
Chris PeBenito 4fc915
allow remote_login_t crack_db_t:file r_file_perms;
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Permit login to search the user home directories.
Chris PeBenito 4fc915
allow remote_login_t home_dir_type:dir search;
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Write to /var/log/btmp
Chris PeBenito 4fc915
allow remote_login_t faillog_t:file { append read write };
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Search for mail spool file.
Chris PeBenito 4fc915
allow remote_login_t mail_spool_t:dir r_dir_perms;
Chris PeBenito 4fc915
allow remote_login_t mail_spool_t:file getattr;
Chris PeBenito 4fc915
allow remote_login_t mail_spool_t:lnk_file read;
Chris PeBenito 4fc915
Chris PeBenito 4fc915
Chris PeBenito 4fc915
allow remote_login_t mouse_device_t:chr_file { getattr setattr };
Chris PeBenito 4fc915
Chris PeBenito 4fc915
ifdef(`targeted_policy',`
Chris PeBenito 4fc915
unconfined_domain(remote_login_t)
Chris PeBenito 4fc915
domain_auto_trans(remote_login_t, shell_exec_t, unconfined_t)
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Only permit unprivileged user domains to be entered via rlogin,
Chris PeBenito 4fc915
# since very weak authentication is used.
Chris PeBenito 4fc915
login_spawn_domain(remote_login, unpriv_userdomain)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
allow remote_login_t devpts_t:dir search;
Chris PeBenito 4fc915
allow remote_login_t userpty_type:chr_file { setattr write };
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Use the pty created by rlogind.
Chris PeBenito 4fc915
ifdef(`rlogind.te', `
Chris PeBenito 4fc915
allow remote_login_t rlogind_devpts_t:chr_file { setattr rw_file_perms };
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Relabel ptys created by rlogind.
Chris PeBenito 4fc915
allow remote_login_t rlogind_devpts_t:chr_file { relabelfrom relabelto };
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Use the pty created by telnetd.
Chris PeBenito 4fc915
ifdef(`telnetd.te', `
Chris PeBenito 4fc915
allow remote_login_t telnetd_devpts_t:chr_file { setattr rw_file_perms };
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Relabel ptys created by telnetd.
Chris PeBenito 4fc915
allow remote_login_t telnetd_devpts_t:chr_file { relabelfrom relabelto };
Chris PeBenito 4fc915
')
Chris PeBenito 4fc915
Chris PeBenito 4fc915
allow remote_login_t ptyfile:chr_file { getattr relabelfrom relabelto ioctl };
Chris PeBenito 4fc915
Chris PeBenito 4fc915
# Allow remote login to resolve host names (passed in via the -h switch)
Chris PeBenito 4fc915
can_resolve(remote_login_t)
Chris PeBenito 4fc915
Chris PeBenito 4fc915
') dnl endif TODO