2005-04-20 19:07:16 +00:00
|
|
|
|
2007-06-12 18:46:14 +00:00
|
|
|
policy_module(authlogin,1.6.2)
|
2005-04-26 17:00:25 +00:00
|
|
|
|
2005-04-19 20:45:24 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
2005-05-13 14:37:13 +00:00
|
|
|
|
|
|
|
attribute can_read_shadow_passwords;
|
|
|
|
attribute can_write_shadow_passwords;
|
|
|
|
attribute can_relabelto_shadow_passwords;
|
|
|
|
|
2005-04-19 20:45:24 +00:00
|
|
|
type chkpwd_exec_t;
|
2006-10-04 17:25:34 +00:00
|
|
|
corecmd_executable_file(chkpwd_exec_t)
|
2005-04-19 20:45:24 +00:00
|
|
|
|
|
|
|
type faillog_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_log_file(faillog_t)
|
2005-04-19 20:45:24 +00:00
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
type lastlog_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_log_file(lastlog_t)
|
2005-04-14 20:18:17 +00:00
|
|
|
|
2006-10-04 17:25:34 +00:00
|
|
|
type login_exec_t;
|
|
|
|
corecmd_executable_file(login_exec_t)
|
2005-04-19 20:45:24 +00:00
|
|
|
|
2005-09-26 20:26:32 +00:00
|
|
|
type pam_console_t;
|
2005-05-02 21:02:14 +00:00
|
|
|
type pam_console_exec_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
init_system_domain(pam_console_t,pam_console_exec_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
role system_r types pam_console_t;
|
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
type pam_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_type(pam_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
role system_r types pam_t;
|
2005-04-19 20:45:24 +00:00
|
|
|
|
2005-05-02 21:02:14 +00:00
|
|
|
type pam_exec_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_entry_file(pam_t,pam_exec_t)
|
2005-05-02 21:02:14 +00:00
|
|
|
|
2005-04-19 20:45:24 +00:00
|
|
|
type pam_tmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_tmp_file(pam_tmp_t)
|
2005-04-19 20:45:24 +00:00
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
type pam_var_console_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(pam_var_console_t)
|
2005-04-19 20:45:24 +00:00
|
|
|
|
|
|
|
type pam_var_run_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_pid_file(pam_var_run_t)
|
2005-04-19 20:45:24 +00:00
|
|
|
|
|
|
|
type shadow_t;
|
2006-01-04 19:31:53 +00:00
|
|
|
files_security_file(shadow_t)
|
2005-04-19 20:45:24 +00:00
|
|
|
neverallow ~can_read_shadow_passwords shadow_t:file read;
|
2005-05-09 18:50:20 +00:00
|
|
|
neverallow ~can_write_shadow_passwords shadow_t:file { create write };
|
|
|
|
neverallow ~can_relabelto_shadow_passwords shadow_t:file relabelto;
|
2005-04-19 20:45:24 +00:00
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
type utempter_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_type(utempter_t)
|
2005-04-19 20:45:24 +00:00
|
|
|
|
|
|
|
type utempter_exec_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_entry_file(utempter_t,utempter_exec_t)
|
2005-04-19 20:45:24 +00:00
|
|
|
|
2005-11-15 16:34:10 +00:00
|
|
|
#
|
|
|
|
# var_auth_t is the type of /var/lib/auth, usually
|
|
|
|
# used for auth data in pam_able
|
|
|
|
#
|
|
|
|
type var_auth_t;
|
|
|
|
files_type(var_auth_t)
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
type wtmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_log_file(wtmp_t)
|
2005-04-19 20:45:24 +00:00
|
|
|
|
2006-08-22 19:56:59 +00:00
|
|
|
# reorder to work around require-then-decare bug
|
|
|
|
authlogin_common_auth_domain_template(system)
|
|
|
|
role system_r types system_chkpwd_t;
|
|
|
|
|
2005-04-19 20:45:24 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-05-03 20:23:33 +00:00
|
|
|
# PAM local policy
|
2005-04-19 20:45:24 +00:00
|
|
|
#
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2005-09-01 20:13:42 +00:00
|
|
|
allow pam_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
2005-05-03 20:23:33 +00:00
|
|
|
dontaudit pam_t self:capability sys_tty_config;
|
|
|
|
|
|
|
|
allow pam_t self:fd use;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow pam_t self:fifo_file rw_file_perms;
|
|
|
|
allow pam_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow pam_t self:unix_stream_socket rw_stream_socket_perms;
|
2005-05-03 20:23:33 +00:00
|
|
|
allow pam_t self:unix_dgram_socket sendto;
|
|
|
|
allow pam_t self:unix_stream_socket connectto;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow pam_t self:shm create_shm_perms;
|
|
|
|
allow pam_t self:sem create_sem_perms;
|
|
|
|
allow pam_t self:msgq create_msgq_perms;
|
2005-05-03 20:23:33 +00:00
|
|
|
allow pam_t self:msg { send receive };
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
delete_files_pattern(pam_t,pam_var_run_t,pam_var_run_t)
|
|
|
|
read_files_pattern(pam_t,pam_var_run_t,pam_var_run_t)
|
2006-08-17 15:35:14 +00:00
|
|
|
files_list_pids(pam_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2006-08-17 15:35:14 +00:00
|
|
|
allow pam_t pam_tmp_t:dir manage_dir_perms;
|
|
|
|
allow pam_t pam_tmp_t:file manage_file_perms;
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(pam_t, pam_tmp_t, { file dir })
|
2005-05-03 20:23:33 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(pam_t)
|
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(pam_t)
|
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
term_use_all_user_ttys(pam_t)
|
|
|
|
term_use_all_user_ptys(pam_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2006-01-18 18:08:39 +00:00
|
|
|
init_dontaudit_rw_utmp(pam_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(pam_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(pam_t)
|
|
|
|
libs_use_shared_libs(pam_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(pam_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(pam_t)
|
2005-05-24 15:55:57 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-03-02 23:41:11 +00:00
|
|
|
locallogin_use_fds(pam_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-27 16:30:55 +00:00
|
|
|
nis_use_ypbind(pam_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use(pam_t)
|
2005-07-13 20:48:51 +00:00
|
|
|
')
|
|
|
|
|
2005-05-03 21:04:20 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# PAM console local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow pam_console_t self:capability { chown fowner fsetid };
|
|
|
|
dontaudit pam_console_t self:capability sys_tty_config;
|
|
|
|
|
|
|
|
allow pam_console_t self:process { sigchld sigkill sigstop signull signal };
|
|
|
|
|
|
|
|
# for /var/run/console.lock checking
|
2006-12-12 20:08:08 +00:00
|
|
|
read_files_pattern(pam_console_t,pam_var_console_t,pam_var_console_t)
|
|
|
|
read_lnk_files_pattern(pam_console_t,pam_var_console_t,pam_var_console_t)
|
2005-10-13 20:59:36 +00:00
|
|
|
dontaudit pam_console_t pam_var_console_t:file write;
|
2005-05-03 21:04:20 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(pam_console_t)
|
2006-03-02 23:41:11 +00:00
|
|
|
kernel_use_fds(pam_console_t)
|
2005-09-13 13:06:07 +00:00
|
|
|
# Read /proc/meminfo
|
|
|
|
kernel_read_system_state(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
|
2005-06-16 20:33:51 +00:00
|
|
|
dev_read_sysfs(pam_console_t)
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_getattr_apm_bios_dev(pam_console_t)
|
|
|
|
dev_setattr_apm_bios_dev(pam_console_t)
|
2006-02-22 21:21:26 +00:00
|
|
|
dev_getattr_dri_dev(pam_console_t)
|
|
|
|
dev_setattr_dri_dev(pam_console_t)
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_getattr_framebuffer_dev(pam_console_t)
|
|
|
|
dev_setattr_framebuffer_dev(pam_console_t)
|
2006-03-30 15:59:39 +00:00
|
|
|
dev_getattr_generic_usb_dev(pam_console_t)
|
|
|
|
dev_setattr_generic_usb_dev(pam_console_t)
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_getattr_misc_dev(pam_console_t)
|
|
|
|
dev_setattr_misc_dev(pam_console_t)
|
|
|
|
dev_getattr_mouse_dev(pam_console_t)
|
|
|
|
dev_setattr_mouse_dev(pam_console_t)
|
|
|
|
dev_getattr_power_mgmt_dev(pam_console_t)
|
|
|
|
dev_setattr_power_mgmt_dev(pam_console_t)
|
|
|
|
dev_getattr_scanner_dev(pam_console_t)
|
|
|
|
dev_setattr_scanner_dev(pam_console_t)
|
|
|
|
dev_getattr_sound_dev(pam_console_t)
|
|
|
|
dev_setattr_sound_dev(pam_console_t)
|
2005-06-20 17:41:29 +00:00
|
|
|
dev_getattr_video_dev(pam_console_t)
|
|
|
|
dev_setattr_video_dev(pam_console_t)
|
2005-09-16 21:20:37 +00:00
|
|
|
dev_getattr_xserver_misc_dev(pam_console_t)
|
|
|
|
dev_setattr_xserver_misc_dev(pam_console_t)
|
2006-04-19 15:25:22 +00:00
|
|
|
dev_read_urand(pam_console_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
|
2006-04-19 15:25:22 +00:00
|
|
|
mls_file_read_up(pam_console_t)
|
|
|
|
mls_file_write_down(pam_console_t)
|
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
storage_getattr_fixed_disk_dev(pam_console_t)
|
|
|
|
storage_setattr_fixed_disk_dev(pam_console_t)
|
|
|
|
storage_getattr_removable_dev(pam_console_t)
|
|
|
|
storage_setattr_removable_dev(pam_console_t)
|
|
|
|
storage_getattr_scsi_generic_dev(pam_console_t)
|
|
|
|
storage_setattr_scsi_generic_dev(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
term_use_console(pam_console_t)
|
2006-05-03 19:58:01 +00:00
|
|
|
term_use_all_user_ttys(pam_console_t)
|
|
|
|
term_use_all_user_ptys(pam_console_t)
|
2005-09-13 13:06:07 +00:00
|
|
|
term_setattr_console(pam_console_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
term_getattr_unallocated_ttys(pam_console_t)
|
|
|
|
term_setattr_unallocated_ttys(pam_console_t)
|
2006-07-28 15:13:58 +00:00
|
|
|
term_use_unallocated_ttys(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
|
2005-10-13 20:59:36 +00:00
|
|
|
auth_use_nsswitch(pam_console_t)
|
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(pam_console_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_pids(pam_console_t)
|
|
|
|
files_list_mnt(pam_console_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
files_dontaudit_search_isid_type_dirs(pam_console_t)
|
2005-07-20 14:25:24 +00:00
|
|
|
# read /etc/mtab
|
|
|
|
files_read_etc_runtime_files(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
|
2006-09-22 17:14:35 +00:00
|
|
|
fs_list_auto_mountpoints(pam_console_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
fs_list_noxattr_fs(pam_console_t)
|
2006-09-22 17:14:35 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(pam_console_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_use_script_ptys(pam_console_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(pam_console_t)
|
|
|
|
libs_use_shared_libs(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
|
2006-04-19 15:25:22 +00:00
|
|
|
miscfiles_read_localization(pam_console_t)
|
2006-08-29 02:41:00 +00:00
|
|
|
miscfiles_read_certs(pam_console_t)
|
2005-09-26 20:26:32 +00:00
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_read_file_contexts(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_dontaudit_use_unpriv_user_fds(pam_console_t)
|
2005-05-24 15:55:57 +00:00
|
|
|
|
2006-08-17 15:35:14 +00:00
|
|
|
ifdef(`targeted_policy',`
|
2006-02-02 21:08:12 +00:00
|
|
|
term_dontaudit_use_unallocated_ttys(pam_console_t)
|
|
|
|
term_dontaudit_use_generic_ptys(pam_console_t)
|
2006-01-31 19:21:01 +00:00
|
|
|
files_dontaudit_read_root_files(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-08-17 21:28:31 +00:00
|
|
|
gpm_getattr_gpmctl(pam_console_t)
|
|
|
|
gpm_setattr_gpmctl(pam_console_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-03-02 23:41:11 +00:00
|
|
|
hotplug_use_fds(pam_console_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
hotplug_dontaudit_search_config(pam_console_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-29 14:26:41 +00:00
|
|
|
seutil_sigchld_newrole(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-13 17:35:46 +00:00
|
|
|
udev_read_db(pam_console_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
')
|
|
|
|
|
2006-04-03 19:49:47 +00:00
|
|
|
optional_policy(`
|
|
|
|
xserver_read_xdm_pid(pam_console_t)
|
2007-04-27 15:08:15 +00:00
|
|
|
xserver_use_xdm_fds(pam_t)
|
2005-05-03 21:04:20 +00:00
|
|
|
')
|
|
|
|
|
2005-05-05 14:08:26 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# System check password local policy
|
|
|
|
#
|
|
|
|
|
2005-05-09 21:06:51 +00:00
|
|
|
allow system_chkpwd_t shadow_t:file { getattr read };
|
|
|
|
|
2007-03-23 23:24:59 +00:00
|
|
|
corecmd_search_bin(system_chkpwd_t)
|
2005-11-08 22:00:30 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_dontaudit_use_interactive_fds(system_chkpwd_t)
|
2005-10-25 15:56:28 +00:00
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
term_dontaudit_use_unallocated_ttys(system_chkpwd_t)
|
|
|
|
term_dontaudit_use_generic_ptys(system_chkpwd_t)
|
2005-06-29 20:53:53 +00:00
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
userdom_dontaudit_use_unpriv_users_ttys(system_chkpwd_t)
|
2006-08-28 02:46:20 +00:00
|
|
|
userdom_dontaudit_use_unpriv_users_ptys(system_chkpwd_t)
|
2006-12-04 20:10:56 +00:00
|
|
|
userdom_dontaudit_use_sysadm_terms(system_chkpwd_t)
|
2005-05-09 21:06:51 +00:00
|
|
|
|
2005-05-03 20:23:33 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Utempter local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow utempter_t self:capability setgid;
|
2005-06-10 01:01:13 +00:00
|
|
|
allow utempter_t self:unix_stream_socket create_stream_socket_perms;
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
allow utempter_t wtmp_t:file rw_file_perms;
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2005-10-13 20:59:36 +00:00
|
|
|
dev_read_urand(utempter_t)
|
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
term_getattr_all_user_ttys(utempter_t)
|
|
|
|
term_getattr_all_user_ptys(utempter_t)
|
|
|
|
term_dontaudit_use_all_user_ttys(utempter_t)
|
|
|
|
term_dontaudit_use_all_user_ptys(utempter_t)
|
|
|
|
term_dontaudit_use_ptmx(utempter_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2006-01-18 18:08:39 +00:00
|
|
|
init_rw_utmp(utempter_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(utempter_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(utempter_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so(utempter_t)
|
|
|
|
libs_use_shared_libs(utempter_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_search_logs(utempter_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
|
|
|
# Allow utemper to write to /tmp/.xses-*
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_write_unpriv_users_tmp_files(utempter_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-02-02 21:08:12 +00:00
|
|
|
nscd_socket_use(utempter_t)
|
2005-07-13 20:48:51 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-07-06 17:00:29 +00:00
|
|
|
xserver_use_xdm_fds(utempter_t)
|
|
|
|
xserver_rw_xdm_pipes(utempter_t)
|
2005-05-03 20:23:33 +00:00
|
|
|
')
|