2005-05-05 17:44:36 +00:00
|
|
|
|
|
|
|
policy_module(authlogin,1.0)
|
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-05-09 18:50:20 +00:00
|
|
|
type remote_login_t; #, nscd_client_domain;
|
2005-06-13 17:35:46 +00:00
|
|
|
kernel_obj_id_change_exempt(remote_login_t)
|
|
|
|
kernel_subj_id_change_exempt(remote_login_t)
|
|
|
|
kernel_role_change_exempt(remote_login_t)
|
|
|
|
domain_type(remote_login_t)
|
|
|
|
domain_wide_inherit_fd(remote_login_t)
|
|
|
|
auth_login_entry_type(remote_login_t)
|
2005-05-05 17:44:36 +00:00
|
|
|
role system_r types remote_login_t;
|
|
|
|
|
|
|
|
type remote_login_tmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_tmp_file(remote_login_tmp_t)
|
2005-05-05 17:44:36 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Remote login remote policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow remote_login_t self:capability { dac_override chown fowner fsetid kill setgid setuid net_bind_service sys_nice sys_resource sys_tty_config };
|
|
|
|
allow remote_login_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem dyntransition };
|
|
|
|
allow remote_login_t self:process { setrlimit setexec };
|
|
|
|
allow remote_login_t self:fd use;
|
2005-06-09 15:32:23 +00:00
|
|
|
allow remote_login_t self:fifo_file rw_file_perms;
|
|
|
|
allow remote_login_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow remote_login_t self:unix_stream_socket create_stream_socket_perms;
|
2005-05-05 17:44:36 +00:00
|
|
|
allow remote_login_t self:unix_dgram_socket sendto;
|
|
|
|
allow remote_login_t self:unix_stream_socket connectto;
|
2005-06-09 15:32:23 +00:00
|
|
|
allow remote_login_t self:shm create_shm_perms;
|
|
|
|
allow remote_login_t self:sem create_sem_perms;
|
|
|
|
allow remote_login_t self:msgq create_msgq_perms;
|
2005-05-05 17:44:36 +00:00
|
|
|
allow remote_login_t self:msg { send receive };
|
|
|
|
|
2005-06-09 15:32:23 +00:00
|
|
|
allow remote_login_t remote_login_tmp_t:dir create_dir_perms;
|
|
|
|
allow remote_login_t remote_login_tmp_t:file create_file_perms;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_create_tmp_files(remote_login_t, remote_login_tmp_t, { file dir })
|
2005-05-05 17:44:36 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(remote_login_t)
|
|
|
|
kernel_read_kernel_sysctl(remote_login_t)
|
|
|
|
kernel_get_selinuxfs_mount_point(remote_login_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
kernel_validate_context(remote_login_t)
|
|
|
|
kernel_compute_access_vector(remote_login_t)
|
|
|
|
kernel_compute_create_context(remote_login_t)
|
|
|
|
kernel_compute_relabel_context(remote_login_t)
|
|
|
|
kernel_compute_reachable_user_contexts(remote_login_t)
|
2005-05-05 17:44:36 +00:00
|
|
|
|
|
|
|
# for SSP/ProPolice
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_read_urand(remote_login_t)
|
2005-05-05 17:44:36 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(remote_login_t)
|
2005-05-05 17:44:36 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
init_rw_script_pid(remote_login_t)
|
2005-05-05 17:44:36 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_read_all_entry_files(remote_login_t)
|
2005-05-05 17:44:36 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_generic_etc_files(remote_login_t)
|
|
|
|
files_read_etc_runtime_files(remote_login_t)
|
|
|
|
files_list_home(remote_login_t)
|
|
|
|
files_read_usr_files(remote_login_t)
|
2005-05-05 17:44:36 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(remote_login_t)
|
|
|
|
libs_use_shared_libs(remote_login_t)
|
2005-05-05 17:44:36 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(remote_login_t)
|
2005-05-09 18:50:20 +00:00
|
|
|
|
2005-05-05 17:44:36 +00:00
|
|
|
selinux_read_config(remote_login_t)
|
|
|
|
selinux_read_default_contexts(remote_login_t)
|
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_domtrans_chk_passwd(remote_login_t)
|
|
|
|
auth_dontaudit_read_shadow(remote_login_t)
|
|
|
|
auth_rw_login_records(remote_login_t)
|
|
|
|
auth_rw_lastlog(remote_login_t)
|
|
|
|
auth_exec_pam(remote_login_t)
|
|
|
|
auth_manage_pam_console_data(remote_login_t)
|
2005-05-05 17:44:36 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(remote_login_t)
|
|
|
|
|
|
|
|
ifdef(`TODO',`
|
|
|
|
allow remote_login_t unpriv_userdomain:fd use;
|
|
|
|
can_ypbind(remote_login_t)
|
|
|
|
ifdef(`automount.te', `
|
|
|
|
allow remote_login_t autofs_t:dir { search getattr };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow remote_login_t bin_t:dir r_dir_perms;
|
|
|
|
allow remote_login_t bin_t:notdevfile_class_set r_file_perms;
|
|
|
|
allow remote_login_t sbin_t:dir r_dir_perms;
|
|
|
|
allow remote_login_t sbin_t:notdevfile_class_set r_file_perms;
|
|
|
|
if (read_default_t) {
|
|
|
|
allow remote_login_t default_t:dir r_dir_perms;
|
|
|
|
allow remote_login_t default_t:notdevfile_class_set r_file_perms;
|
|
|
|
}
|
|
|
|
|
|
|
|
# Read directories and files with the readable_t type.
|
|
|
|
# This type is a general type for "world"-readable files.
|
|
|
|
allow remote_login_t readable_t:dir r_dir_perms;
|
|
|
|
allow remote_login_t readable_t:notdevfile_class_set r_file_perms;
|
|
|
|
|
|
|
|
# Read /var, /var/spool
|
|
|
|
allow remote_login_t { var_t var_spool_t }:dir search;
|
|
|
|
|
|
|
|
# for when /var/mail is a sym-link
|
|
|
|
allow remote_login_t var_t:lnk_file read;
|
|
|
|
|
|
|
|
# Read /dev directories and any symbolic links.
|
|
|
|
allow remote_login_t device_t:lnk_file r_file_perms;
|
|
|
|
|
|
|
|
dontaudit remote_login_t sysfs_t:dir search;
|
|
|
|
|
2005-06-09 15:32:23 +00:00
|
|
|
allow remote_login_t autofs_t:dir r_dir_perms;
|
2005-05-05 17:44:36 +00:00
|
|
|
allow remote_login_t mnt_t:dir r_dir_perms;
|
|
|
|
|
|
|
|
if (use_nfs_home_dirs) {
|
|
|
|
r_dir_file(remote_login_t, nfs_t)
|
|
|
|
}
|
|
|
|
|
|
|
|
if (use_samba_home_dirs) {
|
|
|
|
r_dir_file(remote_login_t, cifs_t)
|
|
|
|
}
|
|
|
|
|
|
|
|
# FIXME: what is this for?
|
|
|
|
ifdef(`xdm.te', `
|
|
|
|
allow xdm_t remote_login_t:process signull;
|
|
|
|
')
|
|
|
|
|
|
|
|
ifdef(`crack.te', `
|
|
|
|
allow remote_login_t crack_db_t:file r_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
# Permit login to search the user home directories.
|
|
|
|
allow remote_login_t home_dir_type:dir search;
|
|
|
|
|
|
|
|
# Write to /var/log/btmp
|
|
|
|
allow remote_login_t faillog_t:file { append read write };
|
|
|
|
|
|
|
|
# Search for mail spool file.
|
|
|
|
allow remote_login_t mail_spool_t:dir r_dir_perms;
|
|
|
|
allow remote_login_t mail_spool_t:file getattr;
|
|
|
|
allow remote_login_t mail_spool_t:lnk_file read;
|
|
|
|
|
|
|
|
|
|
|
|
allow remote_login_t mouse_device_t:chr_file { getattr setattr };
|
|
|
|
|
|
|
|
ifdef(`targeted_policy',`
|
|
|
|
unconfined_domain(remote_login_t)
|
|
|
|
domain_auto_trans(remote_login_t, shell_exec_t, unconfined_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
# Only permit unprivileged user domains to be entered via rlogin,
|
|
|
|
# since very weak authentication is used.
|
|
|
|
login_spawn_domain(remote_login, unpriv_userdomain)
|
|
|
|
|
|
|
|
allow remote_login_t devpts_t:dir search;
|
|
|
|
allow remote_login_t userpty_type:chr_file { setattr write };
|
|
|
|
|
|
|
|
# Use the pty created by rlogind.
|
|
|
|
ifdef(`rlogind.te', `
|
|
|
|
allow remote_login_t rlogind_devpts_t:chr_file { setattr rw_file_perms };
|
|
|
|
|
|
|
|
# Relabel ptys created by rlogind.
|
|
|
|
allow remote_login_t rlogind_devpts_t:chr_file { relabelfrom relabelto };
|
|
|
|
')
|
|
|
|
|
|
|
|
# Use the pty created by telnetd.
|
|
|
|
ifdef(`telnetd.te', `
|
|
|
|
allow remote_login_t telnetd_devpts_t:chr_file { setattr rw_file_perms };
|
|
|
|
|
|
|
|
# Relabel ptys created by telnetd.
|
|
|
|
allow remote_login_t telnetd_devpts_t:chr_file { relabelfrom relabelto };
|
|
|
|
')
|
|
|
|
|
|
|
|
allow remote_login_t ptyfile:chr_file { getattr relabelfrom relabelto ioctl };
|
|
|
|
|
|
|
|
# Allow remote login to resolve host names (passed in via the -h switch)
|
|
|
|
can_resolve(remote_login_t)
|
|
|
|
|
|
|
|
') dnl endif TODO
|