2005-05-05 14:01:59 +00:00
|
|
|
|
2006-03-07 14:12:39 +00:00
|
|
|
policy_module(locallogin,1.2.0)
|
2005-05-05 14:01:59 +00:00
|
|
|
|
2005-04-28 19:50:58 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-09-26 20:26:32 +00:00
|
|
|
type local_login_t;
|
2005-06-16 20:33:51 +00:00
|
|
|
auth_login_entry_type(local_login_t)
|
|
|
|
domain_type(local_login_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_obj_id_change_exemption(local_login_t)
|
|
|
|
domain_subj_id_change_exemption(local_login_t)
|
|
|
|
domain_role_change_exemption(local_login_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_interactive_fd(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
role system_r types local_login_t;
|
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
type local_login_lock_t;
|
|
|
|
files_lock_file(local_login_lock_t)
|
|
|
|
|
2005-04-28 19:50:58 +00:00
|
|
|
type local_login_tmp_t;
|
2005-10-25 20:06:27 +00:00
|
|
|
files_tmp_file(local_login_tmp_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2005-05-09 15:38:06 +00:00
|
|
|
type sulogin_t;
|
|
|
|
type sulogin_exec_t;
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_obj_id_change_exemption(sulogin_t)
|
|
|
|
domain_subj_id_change_exemption(sulogin_t)
|
|
|
|
domain_role_change_exemption(sulogin_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_interactive_fd(sulogin_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
init_domain(sulogin_t,sulogin_exec_t)
|
|
|
|
init_system_domain(sulogin_t,sulogin_exec_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
role system_r types sulogin_t;
|
|
|
|
|
2005-04-28 19:50:58 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-05-09 15:38:06 +00:00
|
|
|
# Local login local policy
|
2005-04-28 19:50:58 +00:00
|
|
|
#
|
|
|
|
|
2005-09-01 20:13:42 +00:00
|
|
|
allow local_login_t self:capability { dac_override chown fowner fsetid kill setgid setuid sys_nice sys_resource sys_tty_config };
|
|
|
|
allow local_login_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
2005-04-28 19:50:58 +00:00
|
|
|
allow local_login_t self:process { setrlimit setexec };
|
2005-05-04 21:44:51 +00:00
|
|
|
allow local_login_t self:fd use;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow local_login_t self:fifo_file rw_file_perms;
|
2005-11-08 22:00:30 +00:00
|
|
|
allow local_login_t self:sock_file r_file_perms;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow local_login_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow local_login_t self:unix_stream_socket create_stream_socket_perms;
|
2005-05-04 21:44:51 +00:00
|
|
|
allow local_login_t self:unix_dgram_socket sendto;
|
|
|
|
allow local_login_t self:unix_stream_socket connectto;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow local_login_t self:shm create_shm_perms;
|
|
|
|
allow local_login_t self:sem create_sem_perms;
|
|
|
|
allow local_login_t self:msgq create_msgq_perms;
|
2005-05-04 21:44:51 +00:00
|
|
|
allow local_login_t self:msg { send receive };
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
allow local_login_t local_login_lock_t:file create_file_perms;
|
2006-03-02 23:41:11 +00:00
|
|
|
files_lock_filetrans(local_login_t,local_login_lock_t,file)
|
2005-09-15 21:03:29 +00:00
|
|
|
|
2005-06-09 14:26:05 +00:00
|
|
|
allow local_login_t local_login_tmp_t:dir create_dir_perms;
|
|
|
|
allow local_login_t local_login_tmp_t:file create_file_perms;
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(local_login_t, local_login_tmp_t, { file dir })
|
2005-04-28 19:50:58 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(local_login_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(local_login_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_setattr_mouse_dev(local_login_t)
|
|
|
|
dev_getattr_mouse_dev(local_login_t)
|
|
|
|
dev_getattr_power_mgmt_dev(local_login_t)
|
|
|
|
dev_setattr_power_mgmt_dev(local_login_t)
|
|
|
|
dev_getattr_sound_dev(local_login_t)
|
|
|
|
dev_setattr_sound_dev(local_login_t)
|
|
|
|
dev_dontaudit_getattr_apm_bios_dev(local_login_t)
|
|
|
|
dev_dontaudit_setattr_apm_bios_dev(local_login_t)
|
2005-06-30 18:54:08 +00:00
|
|
|
dev_dontaudit_read_framebuffer(local_login_t)
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_dontaudit_setattr_framebuffer_dev(local_login_t)
|
|
|
|
dev_dontaudit_getattr_generic_blk_files(local_login_t)
|
|
|
|
dev_dontaudit_setattr_generic_blk_files(local_login_t)
|
|
|
|
dev_dontaudit_getattr_generic_chr_files(local_login_t)
|
|
|
|
dev_dontaudit_setattr_generic_chr_files(local_login_t)
|
|
|
|
dev_dontaudit_setattr_generic_symlinks(local_login_t)
|
|
|
|
dev_dontaudit_getattr_misc_dev(local_login_t)
|
|
|
|
dev_dontaudit_setattr_misc_dev(local_login_t)
|
|
|
|
dev_dontaudit_getattr_scanner_dev(local_login_t)
|
|
|
|
dev_dontaudit_setattr_scanner_dev(local_login_t)
|
2005-06-29 20:53:53 +00:00
|
|
|
dev_dontaudit_search_sysfs(local_login_t)
|
2005-06-30 18:54:08 +00:00
|
|
|
dev_dontaudit_getattr_video_dev(local_login_t)
|
|
|
|
dev_dontaudit_setattr_video_dev(local_login_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
# for SSP/ProPolice
|
|
|
|
dev_read_urand(local_login_t)
|
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(local_login_t)
|
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
selinux_get_fs_mount(local_login_t)
|
|
|
|
selinux_validate_context(local_login_t)
|
|
|
|
selinux_compute_access_vector(local_login_t)
|
|
|
|
selinux_compute_create_context(local_login_t)
|
|
|
|
selinux_compute_relabel_context(local_login_t)
|
|
|
|
selinux_compute_user_contexts(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
storage_dontaudit_getattr_fixed_disk_dev(local_login_t)
|
|
|
|
storage_dontaudit_setattr_fixed_disk_dev(local_login_t)
|
|
|
|
storage_dontaudit_getattr_removable_dev(local_login_t)
|
|
|
|
storage_dontaudit_setattr_removable_dev(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
term_use_all_user_ttys(local_login_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
term_use_unallocated_ttys(local_login_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
term_relabel_unallocated_ttys(local_login_t)
|
|
|
|
term_relabel_all_user_ttys(local_login_t)
|
|
|
|
term_setattr_all_user_ttys(local_login_t)
|
|
|
|
term_setattr_unallocated_ttys(local_login_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_domtrans_chk_passwd(local_login_t)
|
|
|
|
auth_dontaudit_read_shadow(local_login_t)
|
|
|
|
auth_rw_login_records(local_login_t)
|
|
|
|
auth_rw_lastlog(local_login_t)
|
|
|
|
auth_rw_faillog(local_login_t)
|
|
|
|
auth_exec_pam(local_login_t)
|
|
|
|
auth_manage_pam_console_data(local_login_t)
|
2005-10-14 17:55:40 +00:00
|
|
|
auth_domtrans_pam_console(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2005-07-11 19:02:50 +00:00
|
|
|
corecmd_list_bin(local_login_t)
|
|
|
|
corecmd_list_sbin(local_login_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
corecmd_read_bin_symlinks(local_login_t)
|
|
|
|
corecmd_read_sbin_symlinks(local_login_t)
|
2005-07-11 19:02:50 +00:00
|
|
|
# cjp: these are probably not needed:
|
2006-02-02 21:08:12 +00:00
|
|
|
corecmd_read_bin_files(local_login_t)
|
|
|
|
corecmd_read_bin_pipes(local_login_t)
|
|
|
|
corecmd_read_bin_sockets(local_login_t)
|
|
|
|
corecmd_read_sbin_files(local_login_t)
|
|
|
|
corecmd_read_sbin_pipes(local_login_t)
|
|
|
|
corecmd_read_sbin_sockets(local_login_t)
|
2005-07-11 19:02:50 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_read_all_entry_files(local_login_t)
|
2005-05-04 21:44:51 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(local_login_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_etc_runtime_files(local_login_t)
|
|
|
|
files_read_usr_files(local_login_t)
|
2005-06-29 20:53:53 +00:00
|
|
|
files_list_mnt(local_login_t)
|
2005-07-11 19:02:50 +00:00
|
|
|
files_list_world_readable(local_login_t)
|
|
|
|
files_read_world_readable_files(local_login_t)
|
|
|
|
files_read_world_readable_symlinks(local_login_t)
|
|
|
|
files_read_world_readable_pipes(local_login_t)
|
|
|
|
files_read_world_readable_sockets(local_login_t)
|
|
|
|
# for when /var/mail is a symlink
|
2006-01-31 19:21:01 +00:00
|
|
|
files_read_var_symlinks(local_login_t)
|
2006-02-13 22:05:08 +00:00
|
|
|
# Login can polyinstantiate
|
|
|
|
files_polyinstantiate_all(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2006-01-18 18:08:39 +00:00
|
|
|
init_rw_utmp(local_login_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
init_dontaudit_use_fds(local_login_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(local_login_t)
|
|
|
|
libs_use_shared_libs(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2005-05-19 21:06:06 +00:00
|
|
|
miscfiles_read_localization(local_login_t)
|
|
|
|
|
2006-01-06 22:51:40 +00:00
|
|
|
mls_file_read_up(local_login_t)
|
2005-09-26 20:26:32 +00:00
|
|
|
mls_file_write_down(local_login_t)
|
|
|
|
mls_file_upgrade(local_login_t)
|
|
|
|
mls_file_downgrade(local_login_t)
|
|
|
|
mls_process_set_level(local_login_t)
|
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_read_config(local_login_t)
|
|
|
|
seutil_read_default_contexts(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
userdom_spec_domtrans_all_users(local_login_t)
|
|
|
|
userdom_signal_all_users(local_login_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_search_all_users_home_content(local_login_t)
|
|
|
|
userdom_use_unpriv_users_fds(local_login_t)
|
2006-01-11 15:28:14 +00:00
|
|
|
userdom_sigchld_all_users(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2005-05-31 19:52:57 +00:00
|
|
|
# Search for mail spool file.
|
2005-06-13 17:35:46 +00:00
|
|
|
mta_getattr_spool(local_login_t)
|
2005-05-31 19:52:57 +00:00
|
|
|
|
2005-07-08 20:44:57 +00:00
|
|
|
ifdef(`targeted_policy',`
|
2006-02-06 22:47:46 +00:00
|
|
|
unconfined_domain(local_login_t)
|
2005-07-08 20:44:57 +00:00
|
|
|
unconfined_shell_domtrans(local_login_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
tunable_policy(`read_default_t',`
|
|
|
|
files_list_default(local_login_t)
|
|
|
|
files_read_default_files(local_login_t)
|
|
|
|
files_read_default_symlinks(local_login_t)
|
|
|
|
files_read_default_sockets(local_login_t)
|
|
|
|
files_read_default_pipes(local_login_t)
|
|
|
|
')
|
|
|
|
|
2005-06-16 20:33:51 +00:00
|
|
|
tunable_policy(`use_nfs_home_dirs',`
|
|
|
|
fs_read_nfs_files(local_login_t)
|
|
|
|
fs_read_nfs_symlinks(local_login_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
tunable_policy(`use_samba_home_dirs',`
|
|
|
|
fs_read_cifs_files(local_login_t)
|
|
|
|
fs_read_cifs_symlinks(local_login_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`gpm',`
|
2005-08-17 21:28:31 +00:00
|
|
|
gpm_getattr_gpmctl(local_login_t)
|
|
|
|
gpm_setattr_gpmctl(local_login_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nis',`
|
2005-06-27 16:30:55 +00:00
|
|
|
nis_use_ypbind(local_login_t)
|
2005-05-31 23:02:11 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nscd',`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use(local_login_t)
|
2005-07-13 20:48:51 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`usermanage',`
|
2005-06-29 20:53:53 +00:00
|
|
|
usermanage_read_crack_db(local_login_t)
|
|
|
|
')
|
|
|
|
|
2006-01-25 15:53:35 +00:00
|
|
|
optional_policy(`alsa',`
|
|
|
|
alsa_domtrans(local_login_t)
|
|
|
|
')
|
|
|
|
|
2005-05-09 15:38:06 +00:00
|
|
|
#################################
|
|
|
|
#
|
|
|
|
# Sulogin local policy
|
|
|
|
#
|
|
|
|
|
2005-09-01 20:13:42 +00:00
|
|
|
allow sulogin_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
2005-05-09 15:38:06 +00:00
|
|
|
allow sulogin_t self:fd use;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow sulogin_t self:fifo_file rw_file_perms;
|
|
|
|
allow sulogin_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow sulogin_t self:unix_stream_socket create_stream_socket_perms;
|
2005-05-09 15:38:06 +00:00
|
|
|
allow sulogin_t self:unix_dgram_socket sendto;
|
|
|
|
allow sulogin_t self:unix_stream_socket connectto;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow sulogin_t self:shm create_shm_perms;
|
|
|
|
allow sulogin_t self:sem create_sem_perms;
|
2005-06-10 01:01:13 +00:00
|
|
|
allow sulogin_t self:msgq create_msgq_perms;
|
2005-05-09 15:38:06 +00:00
|
|
|
allow sulogin_t self:msg { send receive };
|
|
|
|
|
|
|
|
kernel_read_system_state(sulogin_t)
|
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(sulogin_t)
|
2006-01-31 20:29:27 +00:00
|
|
|
fs_rw_tmpfs_chr_files(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(sulogin_t)
|
2005-05-31 21:25:45 +00:00
|
|
|
# because file systems are not mounted:
|
2006-01-31 19:21:01 +00:00
|
|
|
files_dontaudit_search_isid_type_dirs(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
init_getpgid_script(sulogin_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(sulogin_t)
|
|
|
|
libs_use_shared_libs(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_read_config(sulogin_t)
|
|
|
|
seutil_read_default_contexts(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_read_shadow(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
userdom_shell_domtrans_sysadm(sulogin_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(sulogin_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
userdom_use_sysadm_ptys(sulogin_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_search_staff_home_dirs(sulogin_t)
|
|
|
|
userdom_search_sysadm_home_dirs(sulogin_t)
|
2005-05-24 15:55:57 +00:00
|
|
|
|
2005-05-09 15:38:06 +00:00
|
|
|
# suse and debian do not use pam with sulogin...
|
2005-09-21 13:26:30 +00:00
|
|
|
ifdef(`distro_suse', `define(`sulogin_no_pam')')
|
|
|
|
ifdef(`distro_debian', `define(`sulogin_no_pam')')
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2005-06-07 18:45:47 +00:00
|
|
|
ifdef(`sulogin_no_pam', `
|
2005-06-03 12:25:14 +00:00
|
|
|
allow sulogin_t self:capability sys_tty_config;
|
2006-02-02 21:08:12 +00:00
|
|
|
init_getpgid(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
', `
|
2005-06-03 12:25:14 +00:00
|
|
|
allow sulogin_t self:process setexec;
|
2005-06-14 20:48:34 +00:00
|
|
|
selinux_get_fs_mount(sulogin_t)
|
|
|
|
selinux_validate_context(sulogin_t)
|
|
|
|
selinux_compute_access_vector(sulogin_t)
|
|
|
|
selinux_compute_create_context(sulogin_t)
|
|
|
|
selinux_compute_relabel_context(sulogin_t)
|
|
|
|
selinux_compute_user_contexts(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nis',`
|
2005-06-27 16:30:55 +00:00
|
|
|
nis_use_ypbind(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
')
|
2006-01-25 15:53:35 +00:00
|
|
|
|
|
|
|
optional_policy(`nscd',`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use(sulogin_t)
|
2006-01-25 15:53:35 +00:00
|
|
|
')
|