selinux-policy/refpolicy/policy/modules/system/authlogin.te

319 lines
7.8 KiB
Plaintext
Raw Normal View History

2005-04-20 19:07:16 +00:00
policy_module(authlogin,1.0)
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;
2005-06-13 17:35:46 +00:00
files_file_type(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
2005-04-19 20:45:24 +00:00
type login_exec_t;
2005-06-13 17:35:46 +00:00
files_file_type(login_exec_t)
2005-04-19 20:45:24 +00:00
type pam_console_t;
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-06-13 17:35:46 +00:00
domain_entry_file(pam_console_t,pam_console_exec_t)
type pam_t; #, nscd_client_domain;
2005-06-13 17:35:46 +00:00
domain_type(pam_t)
role system_r types pam_t;
2005-04-19 20:45:24 +00:00
type pam_exec_t;
2005-06-13 17:35:46 +00:00
domain_entry_file(pam_t,pam_exec_t)
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-05-03 21:04:20 +00:00
type pam_var_console_t; #, nscd_client_domain
2005-06-13 17:35:46 +00:00
files_file_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;
2005-06-13 17:35:46 +00:00
files_file_type(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
type system_chkpwd_t, can_read_shadow_passwords; # , nscd_client_domain;
2005-06-13 17:35:46 +00:00
domain_type(system_chkpwd_t)
domain_entry_file(system_chkpwd_t,chkpwd_exec_t)
role system_r types system_chkpwd_t;
type utempter_t; #, nscd_client_domain;
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-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
########################################
#
# PAM local policy
2005-04-19 20:45:24 +00:00
#
allow pam_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem dyntransition };
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;
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;
allow pam_t self:msg { send receive };
allow pam_t pam_var_run_t:dir { search getattr read write remove_name };
allow pam_t pam_var_run_t:file { getattr read unlink };
2005-06-09 14:50:48 +00:00
allow pam_t pam_tmp_t:dir create_dir_perms;
allow pam_t pam_tmp_t:file create_file_perms;
2005-06-13 17:35:46 +00:00
files_create_tmp_files(pam_t, pam_tmp_t, { file dir })
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-06-13 17:35:46 +00:00
init_dontaudit_rw_script_pid(pam_t)
2005-06-13 17:35:46 +00:00
files_read_generic_etc_files(pam_t)
files_list_pids(pam_t)
2005-06-13 17:35:46 +00:00
libs_use_ld_so(pam_t)
libs_use_shared_libs(pam_t)
2005-06-13 17:35:46 +00:00
logging_send_syslog_msg(pam_t)
2005-06-13 17:35:46 +00:00
userdom_use_unpriv_users_fd(pam_t)
2005-05-24 15:55:57 +00:00
optional_policy(`locallogin.te',`
2005-06-13 17:35:46 +00:00
locallogin_use_fd(pam_t)
')
2005-06-27 16:30:55 +00:00
optional_policy(`nis.te',`
nis_use_ypbind(pam_t)
')
2005-06-27 16:30:55 +00:00
ifdef(`TODO',`
ifdef(`gnome-pty-helper.te', `allow pam_t gphdomain:fd use;')
') dnl endif TODO
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
2005-06-09 14:50:48 +00:00
allow pam_console_t pam_var_console_t:dir r_dir_perms;;
allow pam_console_t pam_var_console_t:file r_file_perms;
allow pam_console_t pam_var_console_t:lnk_file r_file_perms;
2005-05-03 21:04:20 +00:00
kernel_read_kernel_sysctl(pam_console_t)
kernel_read_system_state(pam_console_t)
2005-06-10 01:01:13 +00:00
kernel_use_fd(pam_console_t)
2005-05-03 21:04:20 +00:00
dev_read_sysfs(pam_console_t)
dev_getattr_framebuffer(pam_console_t)
dev_setattr_framebuffer(pam_console_t)
dev_getattr_misc(pam_console_t)
dev_setattr_misc(pam_console_t)
dev_getattr_mouse(pam_console_t)
dev_setattr_mouse(pam_console_t)
dev_getattr_power_management(pam_console_t)
dev_setattr_power_management(pam_console_t)
dev_getattr_scanner(pam_console_t)
dev_setattr_scanner(pam_console_t)
dev_getattr_snd_dev(pam_console_t)
dev_setattr_snd_dev(pam_console_t)
dev_getattr_video_dev(pam_console_t)
dev_setattr_video_dev(pam_console_t)
2005-06-27 16:30:55 +00:00
fs_search_auto_mountpoints(pam_console_t)
2005-06-10 01:01:13 +00:00
storage_getattr_fixed_disk(pam_console_t)
storage_setattr_fixed_disk(pam_console_t)
storage_getattr_removable_device(pam_console_t)
2005-06-13 20:00:36 +00:00
storage_setattr_removable_device(pam_console_t)
storage_getattr_scsi_generic(pam_console_t)
storage_setattr_scsi_generic(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)
term_getattr_unallocated_ttys(pam_console_t)
term_setattr_unallocated_ttys(pam_console_t)
2005-05-03 21:04:20 +00:00
2005-06-13 17:35:46 +00:00
domain_use_wide_inherit_fd(pam_console_t)
2005-05-03 21:04:20 +00:00
2005-06-13 17:35:46 +00:00
files_read_generic_etc_files(pam_console_t)
files_search_pids(pam_console_t)
files_list_mnt(pam_console_t)
2005-05-03 21:04:20 +00:00
init_use_fd(pam_console_t)
init_use_script_pty(pam_console_t)
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
seutil_read_file_contexts(pam_console_t)
2005-05-03 21:04:20 +00:00
2005-06-13 17:35:46 +00:00
userdom_dontaudit_use_unpriv_user_fd(pam_console_t)
2005-05-24 15:55:57 +00:00
2005-06-08 13:12:00 +00:00
ifdef(`direct_sysadm_daemon', `
2005-06-13 17:35:46 +00:00
userdom_dontaudit_use_sysadm_terms(pam_console_t)
2005-05-03 21:04:20 +00:00
')
ifdef(`targeted_policy', `
2005-06-10 01:01:13 +00:00
term_dontaudit_use_unallocated_tty(pam_console_t)
term_dontaudit_use_generic_pty(pam_console_t)
2005-06-13 17:35:46 +00:00
files_dontaudit_read_root_file(pam_console_t)
2005-05-03 21:04:20 +00:00
')
2005-05-04 17:01:46 +00:00
optional_policy(`hotplug.te', `
2005-06-13 17:35:46 +00:00
hotplug_use_fd(pam_console_t)
hotplug_dontaudit_search_config(pam_console_t)
2005-05-04 17:01:46 +00:00
')
2005-05-03 21:04:20 +00:00
optional_policy(`selinux.te',`
seutil_newrole_sigchld(pam_console_t)
2005-05-03 21:04:20 +00:00
')
optional_policy(`udev.te', `
2005-06-13 17:35:46 +00:00
udev_read_db(pam_console_t)
2005-05-03 21:04:20 +00:00
')
ifdef(`TODO',`
optional_policy(`rhgb.te', `
2005-06-27 16:30:55 +00:00
rhgb_domain(pam_console_t)
2005-05-03 21:04:20 +00:00
')
allow pam_console_t apm_bios_t:chr_file { getattr setattr };
2005-05-03 21:04:20 +00:00
ifdef(`gpm.te', `
allow pam_console_t gpmctl_t:sock_file { getattr setattr };
2005-05-03 21:04:20 +00:00
')
ifdef(`xdm.te', `
allow pam_console_t xdm_var_run_t:file { getattr read };
2005-05-03 21:04:20 +00:00
')
') dnl endif TODO
########################################
#
# System check password local policy
#
allow system_chkpwd_t self:capability setuid;
allow system_chkpwd_t self:process getattr;
allow system_chkpwd_t shadow_t:file { getattr read };
# is_selinux_enabled
kernel_read_system_state(system_chkpwd_t)
2005-06-10 01:01:13 +00:00
fs_dontaudit_getattr_xattr_fs(system_chkpwd_t)
2005-06-10 01:01:13 +00:00
term_use_unallocated_tty(system_chkpwd_t)
2005-06-13 17:35:46 +00:00
files_read_generic_etc_files(system_chkpwd_t)
# for nscd
2005-06-13 17:35:46 +00:00
files_dontaudit_search_var(system_chkpwd_t)
2005-06-13 17:35:46 +00:00
libs_use_ld_so(system_chkpwd_t)
libs_use_shared_libs(system_chkpwd_t)
2005-06-13 17:35:46 +00:00
logging_send_syslog_msg(system_chkpwd_t)
miscfiles_read_localization(system_chkpwd_t)
seutil_read_config(system_chkpwd_t)
tunable_policy(`use_dns',`
2005-06-09 14:50:48 +00:00
allow system_chkpwd_t self:udp_socket create_socket_perms;
2005-06-10 01:01:13 +00:00
corenet_udp_sendrecv_all_if(system_chkpwd_t)
corenet_raw_sendrecv_all_if(system_chkpwd_t)
corenet_udp_sendrecv_all_nodes(system_chkpwd_t)
corenet_raw_sendrecv_all_nodes(system_chkpwd_t)
corenet_udp_bind_all_nodes(system_chkpwd_t)
corenet_udp_sendrecv_dns_port(system_chkpwd_t)
2005-06-13 17:35:46 +00:00
sysnet_read_config(system_chkpwd_t)
')
2005-06-27 16:30:55 +00:00
optional_policy(`nis.te',`
nis_use_ypbind(system_chkpwd_t)
')
ifdef(`TODO',`
can_kerberos(system_chkpwd_t)
can_ldap(system_chkpwd_t)
dontaudit system_chkpwd_t user_tty_type:chr_file rw_file_perms;
') dnl end TODO
########################################
#
# 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-06-09 14:50:48 +00:00
allow utempter_t wtmp_t:file rw_file_perms;
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-06-13 17:35:46 +00:00
init_rw_script_pid(utempter_t)
2005-06-13 17:35:46 +00:00
files_read_generic_etc_files(utempter_t)
2005-06-13 17:35:46 +00:00
domain_use_wide_inherit_fd(utempter_t)
2005-06-13 17:35:46 +00:00
libs_use_ld_so(utempter_t)
libs_use_shared_libs(utempter_t)
2005-06-13 17:35:46 +00:00
logging_search_logs(utempter_t)
# Allow utemper to write to /tmp/.xses-*
2005-06-27 16:30:55 +00:00
userdom_write_unpriv_user_tmp(utempter_t)
2005-06-27 16:30:55 +00:00
ifdef(`TODO',`
ifdef(`xdm.te', `
allow utempter_t xdm_t:fd use;
allow utempter_t xdm_t:fifo_file { write getattr };
')
') dnl endif TODO