Chris PeBenito 17de1b
Chris PeBenito 827060
policy_module(authlogin, 2.1.3)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
attribute can_read_shadow_passwords;
Chris PeBenito 17de1b
attribute can_write_shadow_passwords;
Chris PeBenito 17de1b
attribute can_relabelto_shadow_passwords;
Chris PeBenito 17de1b
Chris PeBenito 30425a
type auth_cache_t;
Chris PeBenito 30425a
logging_log_file(auth_cache_t)
Chris PeBenito 30425a
Chris PeBenito 296273
type chkpwd_t, can_read_shadow_passwords;
Chris PeBenito 17de1b
type chkpwd_exec_t;
Chris PeBenito 296273
typealias chkpwd_t alias { user_chkpwd_t staff_chkpwd_t sysadm_chkpwd_t };
Chris PeBenito 296273
typealias chkpwd_t alias { auditadm_chkpwd_t secadm_chkpwd_t };
Chris PeBenito 296273
application_domain(chkpwd_t, chkpwd_exec_t)
Chris PeBenito 296273
role system_r types chkpwd_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type faillog_t;
Chris PeBenito 17de1b
logging_log_file(faillog_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type lastlog_t;
Chris PeBenito 17de1b
logging_log_file(lastlog_t)
Chris PeBenito 17de1b
Chris PeBenito e070dd
type login_exec_t;
Chris PeBenito d46cfe
application_executable_file(login_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pam_console_t;
Chris PeBenito 17de1b
type pam_console_exec_t;
Chris PeBenito 3f67f7
init_system_domain(pam_console_t, pam_console_exec_t)
Chris PeBenito 17de1b
role system_r types pam_console_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pam_t;
Chris PeBenito 17de1b
domain_type(pam_t)
Chris PeBenito 17de1b
role system_r types pam_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pam_exec_t;
Chris PeBenito 3f67f7
domain_entry_file(pam_t, pam_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pam_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(pam_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pam_var_console_t;
Chris PeBenito 17de1b
files_type(pam_var_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type pam_var_run_t;
Chris PeBenito 17de1b
files_pid_file(pam_var_run_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type shadow_t;
Chris PeBenito 17de1b
files_security_file(shadow_t)
Chris PeBenito 17de1b
neverallow ~can_read_shadow_passwords shadow_t:file read;
Chris PeBenito 17de1b
neverallow ~can_write_shadow_passwords shadow_t:file { create write };
Chris PeBenito 17de1b
neverallow ~can_relabelto_shadow_passwords shadow_t:file relabelto;
Chris PeBenito 17de1b
Chris PeBenito 7d4161
type updpwd_t;
Chris PeBenito 7d4161
type updpwd_exec_t;
Chris PeBenito 7d4161
domain_type(updpwd_t)
Chris PeBenito 3f67f7
domain_entry_file(updpwd_t, updpwd_exec_t)
Chris PeBenito df28a0
domain_obj_id_change_exemption(updpwd_t)
Chris PeBenito 7d4161
role system_r types updpwd_t;
Chris PeBenito 7d4161
Chris PeBenito 17de1b
type utempter_t;
Chris PeBenito 17de1b
type utempter_exec_t;
Chris PeBenito 3f67f7
application_domain(utempter_t, utempter_exec_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# var_auth_t is the type of /var/lib/auth, usually
Chris PeBenito 17de1b
# used for auth data in pam_able
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
type var_auth_t;
Chris PeBenito 17de1b
files_type(var_auth_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type wtmp_t;
Chris PeBenito 17de1b
logging_log_file(wtmp_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
########################################
Chris PeBenito 296273
#
Chris PeBenito 296273
# Check password local policy
Chris PeBenito 296273
#
Chris PeBenito 296273
Chris PeBenito 296273
allow chkpwd_t self:capability { dac_override setuid };
Chris PeBenito 296273
dontaudit chkpwd_t self:capability sys_tty_config;
Chris PeBenito 296273
allow chkpwd_t self:process getattr;
Chris PeBenito 296273
Chris PeBenito 296273
allow chkpwd_t shadow_t:file read_file_perms;
Chris PeBenito 296273
files_list_etc(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
# is_selinux_enabled
Chris PeBenito 296273
kernel_read_system_state(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
domain_dontaudit_use_interactive_fds(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
dev_read_rand(chkpwd_t)
Chris PeBenito 296273
dev_read_urand(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
files_read_etc_files(chkpwd_t)
Chris PeBenito 296273
# for nscd
Chris PeBenito 296273
files_dontaudit_search_var(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
fs_dontaudit_getattr_xattr_fs(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
term_dontaudit_use_unallocated_ttys(chkpwd_t)
Chris PeBenito 296273
term_dontaudit_use_generic_ptys(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
auth_use_nsswitch(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
logging_send_audit_msgs(chkpwd_t)
Chris PeBenito 296273
logging_send_syslog_msg(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
miscfiles_read_localization(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
seutil_read_config(chkpwd_t)
Chris PeBenito 296273
seutil_dontaudit_use_newrole_fds(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
userdom_use_user_terminals(chkpwd_t)
Chris PeBenito 296273
Chris PeBenito 296273
ifdef(`distro_ubuntu',`
Chris PeBenito 296273
	optional_policy(`
Chris PeBenito 296273
		unconfined_domain(chkpwd_t)
Chris PeBenito 296273
	')
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	kerberos_use(chkpwd_t)
Chris PeBenito 296273
')
Chris PeBenito 5b4ff3
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# PAM local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow pam_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 17de1b
dontaudit pam_t self:capability sys_tty_config;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow pam_t self:fd use;
Chris PeBenito 17de1b
allow pam_t self:fifo_file rw_file_perms;
Chris PeBenito 17de1b
allow pam_t self:unix_dgram_socket create_socket_perms; 
Chris PeBenito 17de1b
allow pam_t self:unix_stream_socket rw_stream_socket_perms;
Chris PeBenito 17de1b
allow pam_t self:unix_dgram_socket sendto;
Chris PeBenito 17de1b
allow pam_t self:unix_stream_socket connectto;
Chris PeBenito 17de1b
allow pam_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow pam_t self:sem create_sem_perms;
Chris PeBenito 17de1b
allow pam_t self:msgq create_msgq_perms;
Chris PeBenito 17de1b
allow pam_t self:msg { send receive };
Chris PeBenito 17de1b
Chris PeBenito 3f67f7
delete_files_pattern(pam_t, pam_var_run_t, pam_var_run_t)
Chris PeBenito 3f67f7
read_files_pattern(pam_t, pam_var_run_t, pam_var_run_t)
Chris PeBenito ba1a54
files_list_pids(pam_t)
Chris PeBenito 17de1b
Chris PeBenito ba1a54
allow pam_t pam_tmp_t:dir manage_dir_perms;
Chris PeBenito ba1a54
allow pam_t pam_tmp_t:file manage_file_perms;
Chris PeBenito 17de1b
files_tmp_filetrans(pam_t, pam_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 7d4161
auth_use_nsswitch(pam_t)
Chris PeBenito 7d4161
Chris PeBenito 17de1b
kernel_read_system_state(pam_t)
Chris PeBenito 17de1b
Chris PeBenito 2acba7
files_read_etc_files(pam_t)
Chris PeBenito 2acba7
Chris PeBenito 17de1b
fs_search_auto_mountpoints(pam_t)
Chris PeBenito 17de1b
Chris PeBenito 7d4161
miscfiles_read_localization(pam_t)
Chris PeBenito 7d4161
Chris PeBenito c3c753
term_use_all_ttys(pam_t)
Chris PeBenito c3c753
term_use_all_ptys(pam_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_dontaudit_rw_utmp(pam_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(pam_t)
Chris PeBenito 17de1b
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(pam_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	locallogin_use_fds(pam_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# PAM console local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow pam_console_t self:capability { chown fowner fsetid };
Chris PeBenito 17de1b
dontaudit pam_console_t self:capability sys_tty_config;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow pam_console_t self:process { sigchld sigkill sigstop signull signal };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# for /var/run/console.lock checking
Chris PeBenito 3f67f7
read_files_pattern(pam_console_t, pam_var_console_t, pam_var_console_t)
Chris PeBenito 3f67f7
read_lnk_files_pattern(pam_console_t, pam_var_console_t, pam_var_console_t)
Chris PeBenito 17de1b
dontaudit pam_console_t pam_var_console_t:file write;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(pam_console_t)
Chris PeBenito 17de1b
kernel_use_fds(pam_console_t)
Chris PeBenito 17de1b
# Read /proc/meminfo
Chris PeBenito 17de1b
kernel_read_system_state(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_sysfs(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_apm_bios_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_apm_bios_dev(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_dri_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_dri_dev(pam_console_t)
Chris PeBenito 7d4161
dev_getattr_input_dev(pam_console_t)
Chris PeBenito 7d4161
dev_setattr_input_dev(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_framebuffer_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_framebuffer_dev(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_generic_usb_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_generic_usb_dev(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_misc_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_misc_dev(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_mouse_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_mouse_dev(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_power_mgmt_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_power_mgmt_dev(pam_console_t)
Chris PeBenito 7d4161
dev_getattr_printer_dev(pam_console_t)
Chris PeBenito 7d4161
dev_setattr_printer_dev(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_scanner_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_scanner_dev(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_sound_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_sound_dev(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_video_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_video_dev(pam_console_t)
Chris PeBenito 17de1b
dev_getattr_xserver_misc_dev(pam_console_t)
Chris PeBenito 17de1b
dev_setattr_xserver_misc_dev(pam_console_t)
Chris PeBenito 17de1b
dev_read_urand(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 2acba7
files_read_etc_files(pam_console_t)
Chris PeBenito 2acba7
files_search_pids(pam_console_t)
Chris PeBenito 2acba7
files_list_mnt(pam_console_t)
Chris PeBenito 2acba7
files_dontaudit_search_isid_type_dirs(pam_console_t)
Chris PeBenito 2acba7
# read /etc/mtab
Chris PeBenito 2acba7
files_read_etc_runtime_files(pam_console_t)
Chris PeBenito 2acba7
Chris PeBenito 2acba7
fs_list_auto_mountpoints(pam_console_t)
Chris PeBenito 2acba7
fs_list_noxattr_fs(pam_console_t)
Chris PeBenito 2acba7
fs_getattr_all_fs(pam_console_t)
Chris PeBenito 2acba7
Chris PeBenito f8233a
mls_file_read_all_levels(pam_console_t)
Chris PeBenito f8233a
mls_file_write_all_levels(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
storage_getattr_fixed_disk_dev(pam_console_t)
Chris PeBenito 17de1b
storage_setattr_fixed_disk_dev(pam_console_t)
Chris PeBenito 17de1b
storage_getattr_removable_dev(pam_console_t)
Chris PeBenito 17de1b
storage_setattr_removable_dev(pam_console_t)
Chris PeBenito 17de1b
storage_getattr_scsi_generic_dev(pam_console_t)
Chris PeBenito 17de1b
storage_setattr_scsi_generic_dev(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
term_use_console(pam_console_t)
Chris PeBenito c3c753
term_use_all_ttys(pam_console_t)
Chris PeBenito c3c753
term_use_all_ptys(pam_console_t)
Chris PeBenito 17de1b
term_setattr_console(pam_console_t)
Chris PeBenito 17de1b
term_getattr_unallocated_ttys(pam_console_t)
Chris PeBenito 17de1b
term_setattr_unallocated_ttys(pam_console_t)
Chris PeBenito 465510
term_use_unallocated_ttys(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
auth_use_nsswitch(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_use_fds(pam_console_t)
Chris PeBenito 17de1b
init_use_script_ptys(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(pam_console_t)
Chris PeBenito a5e213
miscfiles_read_certs(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
seutil_read_file_contexts(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_dontaudit_use_unpriv_user_fds(pam_console_t)
Chris PeBenito 17de1b
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(pam_console_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	gpm_getattr_gpmctl(pam_console_t)
Chris PeBenito 17de1b
	gpm_setattr_gpmctl(pam_console_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	hotplug_use_fds(pam_console_t)
Chris PeBenito 17de1b
	hotplug_dontaudit_search_config(pam_console_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	seutil_sigchld_newrole(pam_console_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	udev_read_db(pam_console_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	xserver_read_xdm_pid(pam_console_t)
Chris PeBenito 7d4161
	xserver_dontaudit_write_log(pam_console_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 7d4161
# updpwd local policy
Chris PeBenito 7d4161
#
Chris PeBenito 7d4161
Chris PeBenito df28a0
allow updpwd_t self:capability { chown dac_override };
Chris PeBenito 7d4161
allow updpwd_t self:process setfscreate;
Chris PeBenito 0b36a2
allow updpwd_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 7d4161
allow updpwd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 7d4161
allow updpwd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 7d4161
Chris PeBenito 7d4161
kernel_read_system_state(updpwd_t)
Chris PeBenito 7d4161
Chris PeBenito df28a0
dev_read_urand(updpwd_t)
Chris PeBenito df28a0
Chris PeBenito 7d4161
files_manage_etc_files(updpwd_t)
Chris PeBenito 7d4161
Chris PeBenito 7d4161
term_dontaudit_use_console(updpwd_t)
Chris PeBenito 7d4161
term_dontaudit_use_unallocated_ttys(updpwd_t)
Chris PeBenito 7d4161
Chris PeBenito 7d4161
auth_manage_shadow(updpwd_t)
Chris PeBenito 7d4161
auth_use_nsswitch(updpwd_t)
Chris PeBenito 7d4161
Chris PeBenito 7d4161
logging_send_syslog_msg(updpwd_t)
Chris PeBenito 7d4161
Chris PeBenito 7d4161
miscfiles_read_localization(updpwd_t)
Chris PeBenito 7d4161
Chris PeBenito 296273
userdom_use_user_terminals(updpwd_t)
Chris PeBenito 296273
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(updpwd_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
Chris PeBenito 7d4161
########################################
Chris PeBenito 7d4161
#
Chris PeBenito 17de1b
# Utempter local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow utempter_t self:capability setgid;
Chris PeBenito 17de1b
allow utempter_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow utempter_t wtmp_t:file rw_file_perms;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
dev_read_urand(utempter_t)
Chris PeBenito 17de1b
Chris PeBenito 2acba7
files_read_etc_files(utempter_t)
Chris PeBenito 2acba7
Chris PeBenito c3c753
term_getattr_all_ttys(utempter_t)
Chris PeBenito c3c753
term_getattr_all_ptys(utempter_t)
Chris PeBenito c3c753
term_dontaudit_use_all_ttys(utempter_t)
Chris PeBenito c3c753
term_dontaudit_use_all_ptys(utempter_t)
Chris PeBenito 17de1b
term_dontaudit_use_ptmx(utempter_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_rw_utmp(utempter_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
domain_use_interactive_fds(utempter_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_search_logs(utempter_t)
Chris PeBenito 17de1b
Chris PeBenito 296273
userdom_use_user_terminals(utempter_t)
Chris PeBenito 17de1b
# Allow utemper to write to /tmp/.xses-*
Chris PeBenito 296273
userdom_write_user_tmp_files(utempter_t)
Chris PeBenito 17de1b
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(utempter_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nscd_socket_use(utempter_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	xserver_use_xdm_fds(utempter_t)
Chris PeBenito 17de1b
	xserver_rw_xdm_pipes(utempter_t)
Chris PeBenito 17de1b
')