Chris PeBenito df431c
Chris PeBenito 2cc407
policy_module(locallogin,1.2.3)
Chris PeBenito df431c
Chris PeBenito 07efe9
########################################
Chris PeBenito 07efe9
#
Chris PeBenito 07efe9
# Declarations
Chris PeBenito 07efe9
#
Chris PeBenito 07efe9
Chris PeBenito f0574f
type local_login_t;
Chris PeBenito d35c62
auth_login_entry_type(local_login_t)
Chris PeBenito d35c62
domain_type(local_login_t)
Chris PeBenito 1815ba
domain_obj_id_change_exemption(local_login_t)
Chris PeBenito 1815ba
domain_subj_id_change_exemption(local_login_t)
Chris PeBenito 1815ba
domain_role_change_exemption(local_login_t)
Chris PeBenito 15722e
domain_interactive_fd(local_login_t)
Chris PeBenito 07efe9
role system_r types local_login_t;
Chris PeBenito 07efe9
Chris PeBenito 98a8ea
type local_login_lock_t;
Chris PeBenito 98a8ea
files_lock_file(local_login_lock_t)
Chris PeBenito 98a8ea
Chris PeBenito 07efe9
type local_login_tmp_t;
Chris PeBenito c3cf66
files_tmp_file(local_login_tmp_t)
Chris PeBenito a3cf80
files_poly_parent(local_login_tmp_t)
Chris PeBenito 07efe9
Chris PeBenito 5d7e8b
type sulogin_t;
Chris PeBenito 5d7e8b
type sulogin_exec_t;
Chris PeBenito 1815ba
domain_obj_id_change_exemption(sulogin_t)
Chris PeBenito 1815ba
domain_subj_id_change_exemption(sulogin_t)
Chris PeBenito 1815ba
domain_role_change_exemption(sulogin_t)
Chris PeBenito 15722e
domain_interactive_fd(sulogin_t)
Chris PeBenito c9428d
init_domain(sulogin_t,sulogin_exec_t)
Chris PeBenito c9428d
init_system_domain(sulogin_t,sulogin_exec_t)
Chris PeBenito 5d7e8b
role system_r types sulogin_t;
Chris PeBenito 5d7e8b
Chris PeBenito 07efe9
########################################
Chris PeBenito 07efe9
#
Chris PeBenito 5d7e8b
# Local login local policy
Chris PeBenito 07efe9
#
Chris PeBenito 07efe9
Chris PeBenito 9d3bdc
allow local_login_t self:capability { dac_override chown fowner fsetid kill setgid setuid sys_nice sys_resource sys_tty_config };
Chris PeBenito 9d3bdc
allow local_login_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 07efe9
allow local_login_t self:process { setrlimit setexec };
Chris PeBenito f1470e
allow local_login_t self:fd use;
Chris PeBenito 80048c
allow local_login_t self:fifo_file rw_file_perms;
Chris PeBenito 725926
allow local_login_t self:sock_file r_file_perms;
Chris PeBenito 80048c
allow local_login_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 80048c
allow local_login_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito f1470e
allow local_login_t self:unix_dgram_socket sendto;
Chris PeBenito f1470e
allow local_login_t self:unix_stream_socket connectto;
Chris PeBenito 80048c
allow local_login_t self:shm create_shm_perms;
Chris PeBenito 80048c
allow local_login_t self:sem create_sem_perms;
Chris PeBenito 80048c
allow local_login_t self:msgq create_msgq_perms;
Chris PeBenito f1470e
allow local_login_t self:msg { send receive };
Chris PeBenito 07efe9
Chris PeBenito 98a8ea
allow local_login_t local_login_lock_t:file create_file_perms;
Chris PeBenito 1c1ac6
files_lock_filetrans(local_login_t,local_login_lock_t,file)
Chris PeBenito 98a8ea
Chris PeBenito 80048c
allow local_login_t local_login_tmp_t:dir create_dir_perms;
Chris PeBenito 80048c
allow local_login_t local_login_tmp_t:file create_file_perms;
Chris PeBenito 103fe2
files_tmp_filetrans(local_login_t, local_login_tmp_t, { file dir })
Chris PeBenito 07efe9
Chris PeBenito 07efe9
kernel_read_system_state(local_login_t)
Chris PeBenito 445522
kernel_read_kernel_sysctls(local_login_t)
Chris PeBenito d35c62
Chris PeBenito 207c47
dev_setattr_mouse_dev(local_login_t)
Chris PeBenito 207c47
dev_getattr_mouse_dev(local_login_t)
Chris PeBenito 207c47
dev_getattr_power_mgmt_dev(local_login_t)
Chris PeBenito 207c47
dev_setattr_power_mgmt_dev(local_login_t)
Chris PeBenito 207c47
dev_getattr_sound_dev(local_login_t)
Chris PeBenito 207c47
dev_setattr_sound_dev(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_getattr_apm_bios_dev(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_setattr_apm_bios_dev(local_login_t)
Chris PeBenito fd89e1
dev_dontaudit_read_framebuffer(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_setattr_framebuffer_dev(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_getattr_generic_blk_files(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_setattr_generic_blk_files(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_getattr_generic_chr_files(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_setattr_generic_chr_files(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_setattr_generic_symlinks(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_getattr_misc_dev(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_setattr_misc_dev(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_getattr_scanner_dev(local_login_t)
Chris PeBenito 207c47
dev_dontaudit_setattr_scanner_dev(local_login_t)
Chris PeBenito ebdc3b
dev_dontaudit_search_sysfs(local_login_t)
Chris PeBenito fd89e1
dev_dontaudit_getattr_video_dev(local_login_t)
Chris PeBenito fd89e1
dev_dontaudit_setattr_video_dev(local_login_t)
Chris PeBenito d35c62
# for SSP/ProPolice
Chris PeBenito d35c62
dev_read_urand(local_login_t)
Chris PeBenito d35c62
Chris PeBenito ab940a
fs_search_auto_mountpoints(local_login_t)
Chris PeBenito ab940a
Chris PeBenito 5e0da6
selinux_get_fs_mount(local_login_t)
Chris PeBenito 5e0da6
selinux_validate_context(local_login_t)
Chris PeBenito 5e0da6
selinux_compute_access_vector(local_login_t)
Chris PeBenito 5e0da6
selinux_compute_create_context(local_login_t)
Chris PeBenito 5e0da6
selinux_compute_relabel_context(local_login_t)
Chris PeBenito 5e0da6
selinux_compute_user_contexts(local_login_t)
Chris PeBenito 07efe9
Chris PeBenito 1815ba
storage_dontaudit_getattr_fixed_disk_dev(local_login_t)
Chris PeBenito 1815ba
storage_dontaudit_setattr_fixed_disk_dev(local_login_t)
Chris PeBenito 1815ba
storage_dontaudit_getattr_removable_dev(local_login_t)
Chris PeBenito 1815ba
storage_dontaudit_setattr_removable_dev(local_login_t)
Chris PeBenito 07efe9
Chris PeBenito 0fd9dc
term_use_all_user_ttys(local_login_t)
Chris PeBenito 1815ba
term_use_unallocated_ttys(local_login_t)
Chris PeBenito 0fd9dc
term_relabel_unallocated_ttys(local_login_t)
Chris PeBenito 0fd9dc
term_relabel_all_user_ttys(local_login_t)
Chris PeBenito 0fd9dc
term_setattr_all_user_ttys(local_login_t)
Chris PeBenito 0fd9dc
term_setattr_unallocated_ttys(local_login_t)
Chris PeBenito 1e5c2a
Chris PeBenito c9428d
auth_domtrans_chk_passwd(local_login_t)
Chris PeBenito c9428d
auth_dontaudit_read_shadow(local_login_t)
Chris PeBenito c9428d
auth_rw_login_records(local_login_t)
Chris PeBenito c9428d
auth_rw_lastlog(local_login_t)
Chris PeBenito c9428d
auth_rw_faillog(local_login_t)
Chris PeBenito c9428d
auth_exec_pam(local_login_t)
Chris PeBenito c9428d
auth_manage_pam_console_data(local_login_t)
Chris PeBenito d8636f
auth_domtrans_pam_console(local_login_t)
Chris PeBenito 07efe9
Chris PeBenito ae9e27
corecmd_list_bin(local_login_t)
Chris PeBenito ae9e27
corecmd_list_sbin(local_login_t)
Chris PeBenito 1815ba
corecmd_read_bin_symlinks(local_login_t)
Chris PeBenito 1815ba
corecmd_read_sbin_symlinks(local_login_t)
Chris PeBenito ae9e27
# cjp: these are probably not needed:
Chris PeBenito 1815ba
corecmd_read_bin_files(local_login_t)
Chris PeBenito 1815ba
corecmd_read_bin_pipes(local_login_t)
Chris PeBenito 1815ba
corecmd_read_bin_sockets(local_login_t)
Chris PeBenito 1815ba
corecmd_read_sbin_files(local_login_t)
Chris PeBenito 1815ba
corecmd_read_sbin_pipes(local_login_t)
Chris PeBenito 1815ba
corecmd_read_sbin_sockets(local_login_t)
Chris PeBenito ae9e27
Chris PeBenito c9428d
domain_read_all_entry_files(local_login_t)
Chris PeBenito f1470e
Chris PeBenito 8fd367
files_read_etc_files(local_login_t)
Chris PeBenito c9428d
files_read_etc_runtime_files(local_login_t)
Chris PeBenito c9428d
files_read_usr_files(local_login_t)
Chris PeBenito ebdc3b
files_list_mnt(local_login_t)
Chris PeBenito ae9e27
files_list_world_readable(local_login_t)
Chris PeBenito ae9e27
files_read_world_readable_files(local_login_t)
Chris PeBenito ae9e27
files_read_world_readable_symlinks(local_login_t)
Chris PeBenito ae9e27
files_read_world_readable_pipes(local_login_t)
Chris PeBenito ae9e27
files_read_world_readable_sockets(local_login_t)
Chris PeBenito ae9e27
# for when /var/mail is a symlink
Chris PeBenito 9e04f5
files_read_var_symlinks(local_login_t)
Chris PeBenito b0d224
# Login can polyinstantiate
Chris PeBenito b0d224
files_polyinstantiate_all(local_login_t)
Chris PeBenito 07efe9
Chris PeBenito 68228b
init_rw_utmp(local_login_t)
Chris PeBenito 1c1ac6
init_dontaudit_use_fds(local_login_t)
Chris PeBenito daa0e0
Chris PeBenito c9428d
libs_use_ld_so(local_login_t)
Chris PeBenito c9428d
libs_use_shared_libs(local_login_t)
Chris PeBenito 07efe9
Chris PeBenito c9428d
logging_send_syslog_msg(local_login_t)
Chris PeBenito 07efe9
Chris PeBenito daa0e0
miscfiles_read_localization(local_login_t)
Chris PeBenito daa0e0
Chris PeBenito bf080a
mls_file_read_up(local_login_t)
Chris PeBenito f0574f
mls_file_write_down(local_login_t)
Chris PeBenito f0574f
mls_file_upgrade(local_login_t)
Chris PeBenito f0574f
mls_file_downgrade(local_login_t)
Chris PeBenito f0574f
mls_process_set_level(local_login_t)
Chris PeBenito f0574f
Chris PeBenito 5e0da6
seutil_read_config(local_login_t)
Chris PeBenito 5e0da6
seutil_read_default_contexts(local_login_t)
Chris PeBenito 07efe9
Chris PeBenito c9428d
userdom_spec_domtrans_all_users(local_login_t)
Chris PeBenito c9428d
userdom_signal_all_users(local_login_t)
Chris PeBenito 103fe2
userdom_search_all_users_home_content(local_login_t)
Chris PeBenito 103fe2
userdom_use_unpriv_users_fds(local_login_t)
Chris PeBenito a77e65
userdom_sigchld_all_users(local_login_t)
Chris PeBenito fe3a1e
userdom_create_all_users_keys(local_login_t)
Chris PeBenito 07efe9
Chris PeBenito a42ca7
ifdef(`targeted_policy',`
Chris PeBenito 955019
	unconfined_domain(local_login_t)
Chris PeBenito a42ca7
	unconfined_shell_domtrans(local_login_t)
Chris PeBenito a42ca7
')
Chris PeBenito a42ca7
Chris PeBenito a42ca7
tunable_policy(`read_default_t',`
Chris PeBenito a42ca7
	files_list_default(local_login_t)
Chris PeBenito a42ca7
	files_read_default_files(local_login_t)
Chris PeBenito a42ca7
	files_read_default_symlinks(local_login_t)
Chris PeBenito a42ca7
	files_read_default_sockets(local_login_t)
Chris PeBenito a42ca7
	files_read_default_pipes(local_login_t)
Chris PeBenito a42ca7
')
Chris PeBenito a42ca7
Chris PeBenito d35c62
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito d35c62
	fs_read_nfs_files(local_login_t)
Chris PeBenito d35c62
	fs_read_nfs_symlinks(local_login_t)
Chris PeBenito d35c62
')
Chris PeBenito d35c62
Chris PeBenito d35c62
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito d35c62
	fs_read_cifs_files(local_login_t)
Chris PeBenito d35c62
	fs_read_cifs_symlinks(local_login_t)
Chris PeBenito d35c62
')
Chris PeBenito d35c62
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito f862c3
	gpm_getattr_gpmctl(local_login_t)
Chris PeBenito f862c3
	gpm_setattr_gpmctl(local_login_t)
Chris PeBenito f862c3
')
Chris PeBenito f862c3
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito 2cc407
	# Search for mail spool file.
Chris PeBenito 2cc407
	mta_getattr_spool(local_login_t)
Chris PeBenito 2cc407
')
Chris PeBenito 2cc407
Chris PeBenito 2cc407
optional_policy(`
Chris PeBenito ab940a
	nis_use_ypbind(local_login_t)
Chris PeBenito d115b2
')
Chris PeBenito d115b2
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito 1815ba
	nscd_socket_use(local_login_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito ebdc3b
	usermanage_read_crack_db(local_login_t)
Chris PeBenito ebdc3b
')
Chris PeBenito ebdc3b
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito a52492
	alsa_domtrans(local_login_t)
Chris PeBenito a52492
')
Chris PeBenito a52492
Chris PeBenito 5d7e8b
#################################
Chris PeBenito 5d7e8b
# 
Chris PeBenito 5d7e8b
# Sulogin local policy
Chris PeBenito 5d7e8b
#
Chris PeBenito 5d7e8b
Chris PeBenito 9d3bdc
allow sulogin_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 5d7e8b
allow sulogin_t self:fd use;
Chris PeBenito 80048c
allow sulogin_t self:fifo_file rw_file_perms;
Chris PeBenito 80048c
allow sulogin_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 80048c
allow sulogin_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 5d7e8b
allow sulogin_t self:unix_dgram_socket sendto;
Chris PeBenito 5d7e8b
allow sulogin_t self:unix_stream_socket connectto;
Chris PeBenito 80048c
allow sulogin_t self:shm create_shm_perms;
Chris PeBenito 80048c
allow sulogin_t self:sem create_sem_perms;
Chris PeBenito 0fd9dc
allow sulogin_t self:msgq create_msgq_perms;
Chris PeBenito 5d7e8b
allow sulogin_t self:msg { send receive };
Chris PeBenito 5d7e8b
Chris PeBenito 5d7e8b
kernel_read_system_state(sulogin_t)
Chris PeBenito 5d7e8b
Chris PeBenito ab940a
fs_search_auto_mountpoints(sulogin_t)
Chris PeBenito 4d851f
fs_rw_tmpfs_chr_files(sulogin_t)
Chris PeBenito 5d7e8b
Chris PeBenito 8fd367
files_read_etc_files(sulogin_t)
Chris PeBenito 3b857e
# because file systems are not mounted:
Chris PeBenito 9e04f5
files_dontaudit_search_isid_type_dirs(sulogin_t)
Chris PeBenito 5d7e8b
Chris PeBenito 1815ba
init_getpgid_script(sulogin_t)
Chris PeBenito ab940a
Chris PeBenito c9428d
libs_use_ld_so(sulogin_t)
Chris PeBenito c9428d
libs_use_shared_libs(sulogin_t)
Chris PeBenito 5d7e8b
Chris PeBenito c9428d
logging_send_syslog_msg(sulogin_t)
Chris PeBenito 5d7e8b
Chris PeBenito 5e0da6
seutil_read_config(sulogin_t)
Chris PeBenito 5e0da6
seutil_read_default_contexts(sulogin_t)
Chris PeBenito 5d7e8b
Chris PeBenito c9428d
auth_read_shadow(sulogin_t)
Chris PeBenito 5d7e8b
Chris PeBenito c9428d
userdom_shell_domtrans_sysadm(sulogin_t)
Chris PeBenito 103fe2
userdom_use_unpriv_users_fds(sulogin_t)
Chris PeBenito 1815ba
userdom_use_sysadm_ptys(sulogin_t)
Chris PeBenito 103fe2
userdom_search_staff_home_dirs(sulogin_t)
Chris PeBenito 103fe2
userdom_search_sysadm_home_dirs(sulogin_t)
Chris PeBenito dc771f
Chris PeBenito 5d7e8b
# suse and debian do not use pam with sulogin...
Chris PeBenito 0e15cd
ifdef(`distro_suse', `define(`sulogin_no_pam')')
Chris PeBenito 0e15cd
ifdef(`distro_debian', `define(`sulogin_no_pam')')
Chris PeBenito 5d7e8b
Chris PeBenito 254bbc
ifdef(`sulogin_no_pam', `
Chris PeBenito 0c73cd
	allow sulogin_t self:capability sys_tty_config;
Chris PeBenito 1815ba
	init_getpgid(sulogin_t)
Chris PeBenito 5d7e8b
', `
Chris PeBenito 0c73cd
	allow sulogin_t self:process setexec;
Chris PeBenito 5e0da6
	selinux_get_fs_mount(sulogin_t)
Chris PeBenito 5e0da6
	selinux_validate_context(sulogin_t)
Chris PeBenito 5e0da6
	selinux_compute_access_vector(sulogin_t)
Chris PeBenito 5e0da6
	selinux_compute_create_context(sulogin_t)
Chris PeBenito 5e0da6
	selinux_compute_relabel_context(sulogin_t)
Chris PeBenito 5e0da6
	selinux_compute_user_contexts(sulogin_t)
Chris PeBenito 5d7e8b
')
Chris PeBenito 5d7e8b
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito ab940a
	nis_use_ypbind(sulogin_t)
Chris PeBenito 5d7e8b
')
Chris PeBenito a52492
Chris PeBenito bb7170
optional_policy(`
Chris PeBenito 1815ba
	nscd_socket_use(sulogin_t)
Chris PeBenito a52492
')