Chris PeBenito 17de1b
Chris PeBenito 9570b2
policy_module(locallogin, 1.10.0)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Declarations
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type local_login_t;
Chris PeBenito 17de1b
domain_interactive_fd(local_login_t)
Chris PeBenito 4b3b46
auth_login_pgm_domain(local_login_t)
Chris PeBenito 4b3b46
auth_login_entry_type(local_login_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type local_login_lock_t;
Chris PeBenito 17de1b
files_lock_file(local_login_lock_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type local_login_tmp_t;
Chris PeBenito 17de1b
files_tmp_file(local_login_tmp_t)
Chris PeBenito 17de1b
files_poly_parent(local_login_tmp_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
type sulogin_t;
Chris PeBenito 17de1b
type sulogin_exec_t;
Chris PeBenito 17de1b
domain_obj_id_change_exemption(sulogin_t)
Chris PeBenito 17de1b
domain_subj_id_change_exemption(sulogin_t)
Chris PeBenito 17de1b
domain_role_change_exemption(sulogin_t)
Chris PeBenito 17de1b
domain_interactive_fd(sulogin_t)
Chris PeBenito 3f67f7
init_domain(sulogin_t, sulogin_exec_t)
Chris PeBenito 3f67f7
init_system_domain(sulogin_t, sulogin_exec_t)
Chris PeBenito 17de1b
role system_r types sulogin_t;
Chris PeBenito 17de1b
Chris PeBenito 17de1b
########################################
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
# Local login local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow local_login_t self:capability { dac_override chown fowner fsetid kill setgid setuid sys_nice sys_resource sys_tty_config };
Chris PeBenito 17de1b
allow local_login_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 17de1b
allow local_login_t self:process { setrlimit setexec };
Chris PeBenito 17de1b
allow local_login_t self:fd use;
Chris PeBenito ef659a
allow local_login_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito ef659a
allow local_login_t self:sock_file read_sock_file_perms;
Chris PeBenito 17de1b
allow local_login_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow local_login_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow local_login_t self:unix_dgram_socket sendto;
Chris PeBenito 17de1b
allow local_login_t self:unix_stream_socket connectto;
Chris PeBenito 17de1b
allow local_login_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow local_login_t self:sem create_sem_perms;
Chris PeBenito 17de1b
allow local_login_t self:msgq create_msgq_perms;
Chris PeBenito 17de1b
allow local_login_t self:msg { send receive };
Chris PeBenito d9845a
allow local_login_t self:key { search write link };
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow local_login_t local_login_lock_t:file manage_file_perms;
Chris PeBenito 3f67f7
files_lock_filetrans(local_login_t, local_login_lock_t, file)
Chris PeBenito 17de1b
Chris PeBenito c0868a
allow local_login_t local_login_tmp_t:dir manage_dir_perms;
Chris PeBenito c0868a
allow local_login_t local_login_tmp_t:file manage_file_perms;
Chris PeBenito 17de1b
files_tmp_filetrans(local_login_t, local_login_tmp_t, { file dir })
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(local_login_t)
Chris PeBenito 17de1b
kernel_read_kernel_sysctls(local_login_t)
Chris PeBenito a5e213
kernel_search_key(local_login_t)
Chris PeBenito a5e213
kernel_link_key(local_login_t)
Chris PeBenito 17de1b
Chris PeBenito 8cd130
corecmd_list_bin(local_login_t)
Chris PeBenito 8cd130
corecmd_read_bin_symlinks(local_login_t)
Chris PeBenito 8cd130
# cjp: these are probably not needed:
Chris PeBenito 8cd130
corecmd_read_bin_files(local_login_t)
Chris PeBenito 8cd130
corecmd_read_bin_pipes(local_login_t)
Chris PeBenito 8cd130
corecmd_read_bin_sockets(local_login_t)
Chris PeBenito 8cd130
Chris PeBenito 17de1b
dev_setattr_mouse_dev(local_login_t)
Chris PeBenito 17de1b
dev_getattr_mouse_dev(local_login_t)
Chris PeBenito 17de1b
dev_getattr_power_mgmt_dev(local_login_t)
Chris PeBenito 17de1b
dev_setattr_power_mgmt_dev(local_login_t)
Chris PeBenito 17de1b
dev_getattr_sound_dev(local_login_t)
Chris PeBenito 17de1b
dev_setattr_sound_dev(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_getattr_apm_bios_dev(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_setattr_apm_bios_dev(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_read_framebuffer(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_setattr_framebuffer_dev(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_getattr_generic_blk_files(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_setattr_generic_blk_files(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_getattr_generic_chr_files(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_setattr_generic_chr_files(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_setattr_generic_symlinks(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_getattr_misc_dev(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_setattr_misc_dev(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_getattr_scanner_dev(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_setattr_scanner_dev(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_search_sysfs(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_getattr_video_dev(local_login_t)
Chris PeBenito 17de1b
dev_dontaudit_setattr_video_dev(local_login_t)
Chris PeBenito 17de1b
Chris PeBenito 8cd130
domain_read_all_entry_files(local_login_t)
Chris PeBenito 8cd130
Chris PeBenito 8cd130
files_read_etc_files(local_login_t)
Chris PeBenito 8cd130
files_read_etc_runtime_files(local_login_t)
Chris PeBenito 8cd130
files_read_usr_files(local_login_t)
Chris PeBenito 8cd130
files_list_mnt(local_login_t)
Chris PeBenito 8cd130
files_list_world_readable(local_login_t)
Chris PeBenito 8cd130
files_read_world_readable_files(local_login_t)
Chris PeBenito 8cd130
files_read_world_readable_symlinks(local_login_t)
Chris PeBenito 8cd130
files_read_world_readable_pipes(local_login_t)
Chris PeBenito 8cd130
files_read_world_readable_sockets(local_login_t)
Chris PeBenito 8cd130
# for when /var/mail is a symlink
Chris PeBenito 8cd130
files_read_var_symlinks(local_login_t)
Chris PeBenito 8cd130
Chris PeBenito 17de1b
fs_search_auto_mountpoints(local_login_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
storage_dontaudit_getattr_fixed_disk_dev(local_login_t)
Chris PeBenito 17de1b
storage_dontaudit_setattr_fixed_disk_dev(local_login_t)
Chris PeBenito 17de1b
storage_dontaudit_getattr_removable_dev(local_login_t)
Chris PeBenito 17de1b
storage_dontaudit_setattr_removable_dev(local_login_t)
Chris PeBenito 17de1b
Chris PeBenito c3c753
term_use_all_ttys(local_login_t)
Chris PeBenito 17de1b
term_use_unallocated_ttys(local_login_t)
Chris PeBenito 17de1b
term_relabel_unallocated_ttys(local_login_t)
Chris PeBenito c3c753
term_relabel_all_ttys(local_login_t)
Chris PeBenito c3c753
term_setattr_all_ttys(local_login_t)
Chris PeBenito 17de1b
term_setattr_unallocated_ttys(local_login_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
auth_rw_login_records(local_login_t)
Chris PeBenito 17de1b
auth_rw_faillog(local_login_t)
Chris PeBenito 2b592a
auth_manage_pam_pid(local_login_t)
Chris PeBenito 17de1b
auth_manage_pam_console_data(local_login_t)
Chris PeBenito 17de1b
auth_domtrans_pam_console(local_login_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
init_dontaudit_use_fds(local_login_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
miscfiles_read_localization(local_login_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_spec_domtrans_all_users(local_login_t)
Chris PeBenito 17de1b
userdom_signal_all_users(local_login_t)
Chris PeBenito 296273
userdom_search_user_home_content(local_login_t)
Chris PeBenito 17de1b
userdom_use_unpriv_users_fds(local_login_t)
Chris PeBenito 17de1b
userdom_sigchld_all_users(local_login_t)
Chris PeBenito 17de1b
userdom_create_all_users_keys(local_login_t)
Chris PeBenito 17de1b
Chris PeBenito 12cf80
ifdef(`distro_ubuntu',`
Chris PeBenito 12cf80
	optional_policy(`
Chris PeBenito 12cf80
		unconfined_domain(local_login_t)
Chris PeBenito 12cf80
	')
Chris PeBenito 12cf80
')
Chris PeBenito 12cf80
Chris PeBenito 17de1b
tunable_policy(`use_nfs_home_dirs',`
Chris PeBenito 17de1b
	fs_read_nfs_files(local_login_t)
Chris PeBenito 17de1b
	fs_read_nfs_symlinks(local_login_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
tunable_policy(`use_samba_home_dirs',`
Chris PeBenito 17de1b
	fs_read_cifs_files(local_login_t)
Chris PeBenito 17de1b
	fs_read_cifs_symlinks(local_login_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 350b6a
	alsa_domtrans(local_login_t)
Chris PeBenito 350b6a
')
Chris PeBenito 350b6a
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 296273
	dbus_system_bus_client(local_login_t)
Chris PeBenito 134a79
Chris PeBenito 134a79
	consolekit_dbus_chat(local_login_t)
Chris PeBenito 134a79
')
Chris PeBenito 134a79
Chris PeBenito 134a79
optional_policy(`
Chris PeBenito 17de1b
	gpm_getattr_gpmctl(local_login_t)
Chris PeBenito 17de1b
	gpm_setattr_gpmctl(local_login_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	# Search for mail spool file.
Chris PeBenito 17de1b
	mta_getattr_spool(local_login_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nis_use_ypbind(local_login_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nscd_socket_use(local_login_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 350b6a
	unconfined_domain(local_login_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 350b6a
	usermanage_read_crack_db(local_login_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 134a79
optional_policy(`
Chris PeBenito 134a79
	xserver_read_xdm_tmp_files(local_login_t)
Chris PeBenito 134a79
	xserver_rw_xdm_tmp_files(local_login_t)
Chris PeBenito 134a79
')
Chris PeBenito 134a79
Chris PeBenito 17de1b
#################################
Chris PeBenito 17de1b
# 
Chris PeBenito 17de1b
# Sulogin local policy
Chris PeBenito 17de1b
#
Chris PeBenito 17de1b
Chris PeBenito 17de1b
allow sulogin_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 17de1b
allow sulogin_t self:fd use;
Chris PeBenito 17de1b
allow sulogin_t self:fifo_file rw_file_perms;
Chris PeBenito 17de1b
allow sulogin_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 17de1b
allow sulogin_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 17de1b
allow sulogin_t self:unix_dgram_socket sendto;
Chris PeBenito 17de1b
allow sulogin_t self:unix_stream_socket connectto;
Chris PeBenito 17de1b
allow sulogin_t self:shm create_shm_perms;
Chris PeBenito 17de1b
allow sulogin_t self:sem create_sem_perms;
Chris PeBenito 17de1b
allow sulogin_t self:msgq create_msgq_perms;
Chris PeBenito 17de1b
allow sulogin_t self:msg { send receive };
Chris PeBenito 17de1b
Chris PeBenito 17de1b
kernel_read_system_state(sulogin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
fs_search_auto_mountpoints(sulogin_t)
Chris PeBenito 17de1b
fs_rw_tmpfs_chr_files(sulogin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
files_read_etc_files(sulogin_t)
Chris PeBenito 17de1b
# because file systems are not mounted:
Chris PeBenito 17de1b
files_dontaudit_search_isid_type_dirs(sulogin_t)
Chris PeBenito 17de1b
Chris PeBenito 8cd130
auth_read_shadow(sulogin_t)
Chris PeBenito 8cd130
Chris PeBenito 17de1b
init_getpgid_script(sulogin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
logging_send_syslog_msg(sulogin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
seutil_read_config(sulogin_t)
Chris PeBenito 17de1b
seutil_read_default_contexts(sulogin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
userdom_use_unpriv_users_fds(sulogin_t)
Chris PeBenito e9c6cd
Chris PeBenito 296273
userdom_search_user_home_dirs(sulogin_t)
Chris PeBenito 296273
userdom_use_user_ptys(sulogin_t)
Chris PeBenito e9c6cd
Chris PeBenito e9c6cd
sysadm_shell_domtrans(sulogin_t)
Chris PeBenito 17de1b
Chris PeBenito 17de1b
# suse and debian do not use pam with sulogin...
Chris PeBenito 17de1b
ifdef(`distro_suse', `define(`sulogin_no_pam')')
Chris PeBenito 17de1b
ifdef(`distro_debian', `define(`sulogin_no_pam')')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
ifdef(`sulogin_no_pam', `
Chris PeBenito 17de1b
	allow sulogin_t self:capability sys_tty_config;
Chris PeBenito 17de1b
	init_getpgid(sulogin_t)
Chris PeBenito 17de1b
', `
Chris PeBenito 17de1b
	allow sulogin_t self:process setexec;
Chris PeBenito 17de1b
	selinux_get_fs_mount(sulogin_t)
Chris PeBenito 17de1b
	selinux_validate_context(sulogin_t)
Chris PeBenito 17de1b
	selinux_compute_access_vector(sulogin_t)
Chris PeBenito 17de1b
	selinux_compute_create_context(sulogin_t)
Chris PeBenito 17de1b
	selinux_compute_relabel_context(sulogin_t)
Chris PeBenito 17de1b
	selinux_compute_user_contexts(sulogin_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nis_use_ypbind(sulogin_t)
Chris PeBenito 17de1b
')
Chris PeBenito 17de1b
Chris PeBenito 17de1b
optional_policy(`
Chris PeBenito 17de1b
	nscd_socket_use(sulogin_t)
Chris PeBenito 17de1b
')