2019-09-07 20:58:51 +00:00
|
|
|
policy_module(locallogin, 1.19.2)
|
2005-05-05 14:01:59 +00:00
|
|
|
|
2005-04-28 19:50:58 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2005-09-26 20:26:32 +00:00
|
|
|
type local_login_t;
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_interactive_fd(local_login_t)
|
2006-07-31 22:26:59 +00:00
|
|
|
auth_login_pgm_domain(local_login_t)
|
|
|
|
auth_login_entry_type(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
type local_login_lock_t;
|
|
|
|
files_lock_file(local_login_lock_t)
|
|
|
|
|
2005-04-28 19:50:58 +00:00
|
|
|
type local_login_tmp_t;
|
2005-10-25 20:06:27 +00:00
|
|
|
files_tmp_file(local_login_tmp_t)
|
2006-03-23 19:19:38 +00:00
|
|
|
files_poly_parent(local_login_tmp_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2005-05-09 15:38:06 +00:00
|
|
|
type sulogin_t;
|
|
|
|
type sulogin_exec_t;
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_obj_id_change_exemption(sulogin_t)
|
|
|
|
domain_subj_id_change_exemption(sulogin_t)
|
|
|
|
domain_role_change_exemption(sulogin_t)
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_interactive_fd(sulogin_t)
|
2009-06-26 14:40:13 +00:00
|
|
|
init_domain(sulogin_t, sulogin_exec_t)
|
|
|
|
init_system_domain(sulogin_t, sulogin_exec_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
role system_r types sulogin_t;
|
|
|
|
|
2005-04-28 19:50:58 +00:00
|
|
|
########################################
|
|
|
|
#
|
2005-05-09 15:38:06 +00:00
|
|
|
# Local login local policy
|
2005-04-28 19:50:58 +00:00
|
|
|
#
|
|
|
|
|
2017-11-15 07:10:14 +00:00
|
|
|
allow local_login_t self:capability { chown dac_read_search dac_override fowner fsetid kill setgid setuid sys_nice sys_resource sys_tty_config };
|
2017-04-26 10:26:50 +00:00
|
|
|
dontaudit local_login_t self:capability net_admin;
|
2019-01-04 07:35:03 +00:00
|
|
|
allow local_login_t self:process { getcap setcap setexec setrlimit setsched };
|
2005-05-04 21:44:51 +00:00
|
|
|
allow local_login_t self:fd use;
|
2007-10-09 17:29:48 +00:00
|
|
|
allow local_login_t self:fifo_file rw_fifo_file_perms;
|
|
|
|
allow local_login_t self:sock_file read_sock_file_perms;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow local_login_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow local_login_t self:unix_stream_socket create_stream_socket_perms;
|
2005-05-04 21:44:51 +00:00
|
|
|
allow local_login_t self:unix_dgram_socket sendto;
|
|
|
|
allow local_login_t self:unix_stream_socket connectto;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow local_login_t self:shm create_shm_perms;
|
|
|
|
allow local_login_t self:sem create_sem_perms;
|
|
|
|
allow local_login_t self:msgq create_msgq_perms;
|
2005-05-04 21:44:51 +00:00
|
|
|
allow local_login_t self:msg { send receive };
|
2006-10-31 21:01:48 +00:00
|
|
|
allow local_login_t self:key { search write link };
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow local_login_t local_login_lock_t:file manage_file_perms;
|
2009-06-26 14:40:13 +00:00
|
|
|
files_lock_filetrans(local_login_t, local_login_lock_t, file)
|
2005-09-15 21:03:29 +00:00
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow local_login_t local_login_tmp_t:dir manage_dir_perms;
|
|
|
|
allow local_login_t local_login_tmp_t:file manage_file_perms;
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(local_login_t, local_login_tmp_t, { file dir })
|
2005-04-28 19:50:58 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(local_login_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(local_login_t)
|
2006-08-29 02:41:00 +00:00
|
|
|
kernel_search_key(local_login_t)
|
|
|
|
kernel_link_key(local_login_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
|
2009-08-05 14:06:04 +00:00
|
|
|
corecmd_list_bin(local_login_t)
|
|
|
|
# cjp: these are probably not needed:
|
|
|
|
corecmd_read_bin_files(local_login_t)
|
|
|
|
corecmd_read_bin_pipes(local_login_t)
|
|
|
|
corecmd_read_bin_sockets(local_login_t)
|
|
|
|
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_setattr_mouse_dev(local_login_t)
|
|
|
|
dev_getattr_mouse_dev(local_login_t)
|
|
|
|
dev_getattr_power_mgmt_dev(local_login_t)
|
|
|
|
dev_setattr_power_mgmt_dev(local_login_t)
|
|
|
|
dev_getattr_sound_dev(local_login_t)
|
|
|
|
dev_setattr_sound_dev(local_login_t)
|
2017-04-26 10:36:20 +00:00
|
|
|
dev_dontaudit_getattr_acpi_bios_dev(local_login_t)
|
|
|
|
dev_dontaudit_setattr_acpi_bios_dev(local_login_t)
|
2005-06-30 18:54:08 +00:00
|
|
|
dev_dontaudit_read_framebuffer(local_login_t)
|
2006-01-31 16:08:56 +00:00
|
|
|
dev_dontaudit_setattr_framebuffer_dev(local_login_t)
|
|
|
|
dev_dontaudit_getattr_generic_blk_files(local_login_t)
|
|
|
|
dev_dontaudit_setattr_generic_blk_files(local_login_t)
|
|
|
|
dev_dontaudit_getattr_generic_chr_files(local_login_t)
|
|
|
|
dev_dontaudit_setattr_generic_chr_files(local_login_t)
|
|
|
|
dev_dontaudit_setattr_generic_symlinks(local_login_t)
|
|
|
|
dev_dontaudit_getattr_misc_dev(local_login_t)
|
|
|
|
dev_dontaudit_setattr_misc_dev(local_login_t)
|
|
|
|
dev_dontaudit_getattr_scanner_dev(local_login_t)
|
|
|
|
dev_dontaudit_setattr_scanner_dev(local_login_t)
|
2005-06-29 20:53:53 +00:00
|
|
|
dev_dontaudit_search_sysfs(local_login_t)
|
2005-06-30 18:54:08 +00:00
|
|
|
dev_dontaudit_getattr_video_dev(local_login_t)
|
|
|
|
dev_dontaudit_setattr_video_dev(local_login_t)
|
2005-06-16 20:33:51 +00:00
|
|
|
|
2009-08-05 14:06:04 +00:00
|
|
|
domain_read_all_entry_files(local_login_t)
|
|
|
|
|
|
|
|
files_read_etc_files(local_login_t)
|
|
|
|
files_read_etc_runtime_files(local_login_t)
|
|
|
|
files_read_usr_files(local_login_t)
|
|
|
|
files_list_mnt(local_login_t)
|
|
|
|
files_list_world_readable(local_login_t)
|
|
|
|
files_read_world_readable_files(local_login_t)
|
|
|
|
files_read_world_readable_symlinks(local_login_t)
|
|
|
|
files_read_world_readable_pipes(local_login_t)
|
|
|
|
files_read_world_readable_sockets(local_login_t)
|
|
|
|
# for when /var/mail is a symlink
|
|
|
|
files_read_var_symlinks(local_login_t)
|
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(local_login_t)
|
|
|
|
|
2006-02-02 21:08:12 +00:00
|
|
|
storage_dontaudit_getattr_fixed_disk_dev(local_login_t)
|
|
|
|
storage_dontaudit_setattr_fixed_disk_dev(local_login_t)
|
|
|
|
storage_dontaudit_getattr_removable_dev(local_login_t)
|
|
|
|
storage_dontaudit_setattr_removable_dev(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2010-02-11 19:20:10 +00:00
|
|
|
term_use_all_ttys(local_login_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
term_use_unallocated_ttys(local_login_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
term_relabel_unallocated_ttys(local_login_t)
|
2010-02-11 19:20:10 +00:00
|
|
|
term_relabel_all_ttys(local_login_t)
|
|
|
|
term_setattr_all_ttys(local_login_t)
|
2005-06-10 01:01:13 +00:00
|
|
|
term_setattr_unallocated_ttys(local_login_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_rw_login_records(local_login_t)
|
|
|
|
auth_rw_faillog(local_login_t)
|
2008-07-18 13:25:31 +00:00
|
|
|
auth_manage_pam_pid(local_login_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_manage_pam_console_data(local_login_t)
|
2005-10-14 17:55:40 +00:00
|
|
|
auth_domtrans_pam_console(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_dontaudit_use_fds(local_login_t)
|
2005-05-19 21:06:06 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(local_login_t)
|
|
|
|
|
2019-01-04 07:35:03 +00:00
|
|
|
userdom_manage_all_users_keys(local_login_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
userdom_spec_domtrans_all_users(local_login_t)
|
|
|
|
userdom_signal_all_users(local_login_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_search_user_home_content(local_login_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(local_login_t)
|
2006-01-11 15:28:14 +00:00
|
|
|
userdom_sigchld_all_users(local_login_t)
|
2006-06-21 21:02:49 +00:00
|
|
|
userdom_create_all_users_keys(local_login_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
|
2015-10-20 18:48:38 +00:00
|
|
|
ifdef(`init_systemd',`
|
|
|
|
auth_manage_faillog(local_login_t)
|
|
|
|
|
2018-02-15 22:07:08 +00:00
|
|
|
init_dbus_chat(local_login_t)
|
2015-10-20 18:48:38 +00:00
|
|
|
systemd_dbus_chat_logind(local_login_t)
|
|
|
|
systemd_use_logind_fds(local_login_t)
|
|
|
|
systemd_manage_logind_pid_pipes(local_login_t)
|
|
|
|
')
|
|
|
|
|
2019-09-01 11:44:28 +00:00
|
|
|
ifdef(`distro_debian',`
|
|
|
|
auth_use_pam_motd_dynamic(local_login_t)
|
|
|
|
')
|
|
|
|
|
2008-02-05 18:24:43 +00:00
|
|
|
ifdef(`distro_ubuntu',`
|
|
|
|
optional_policy(`
|
|
|
|
unconfined_domain(local_login_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2011-01-14 16:44:42 +00:00
|
|
|
tunable_policy(`console_login',`
|
2011-01-10 10:09:22 +00:00
|
|
|
# Able to relabel /dev/console to user tty types.
|
|
|
|
term_relabel_console(local_login_t)
|
|
|
|
')
|
|
|
|
|
2005-06-16 20:33:51 +00:00
|
|
|
tunable_policy(`use_nfs_home_dirs',`
|
|
|
|
fs_read_nfs_files(local_login_t)
|
|
|
|
fs_read_nfs_symlinks(local_login_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
tunable_policy(`use_samba_home_dirs',`
|
|
|
|
fs_read_cifs_files(local_login_t)
|
|
|
|
fs_read_cifs_symlinks(local_login_t)
|
|
|
|
')
|
|
|
|
|
2007-09-11 19:24:32 +00:00
|
|
|
optional_policy(`
|
2007-10-02 16:04:50 +00:00
|
|
|
alsa_domtrans(local_login_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
optional_policy(`
|
2008-11-05 16:10:46 +00:00
|
|
|
dbus_system_bus_client(local_login_t)
|
2007-09-11 19:24:32 +00:00
|
|
|
|
2017-01-05 12:21:10 +00:00
|
|
|
optional_policy(`
|
|
|
|
consolekit_dbus_chat(local_login_t)
|
|
|
|
')
|
2007-09-11 19:24:32 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-08-17 21:28:31 +00:00
|
|
|
gpm_getattr_gpmctl(local_login_t)
|
|
|
|
gpm_setattr_gpmctl(local_login_t)
|
|
|
|
')
|
|
|
|
|
2006-07-03 18:26:26 +00:00
|
|
|
optional_policy(`
|
|
|
|
# Search for mail spool file.
|
|
|
|
mta_getattr_spool(local_login_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-27 16:30:55 +00:00
|
|
|
nis_use_ypbind(local_login_t)
|
2005-05-31 23:02:11 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2012-12-17 20:06:29 +00:00
|
|
|
nscd_use(local_login_t)
|
2005-07-13 20:48:51 +00:00
|
|
|
')
|
|
|
|
|
2017-04-06 21:37:50 +00:00
|
|
|
optional_policy(`
|
|
|
|
systemd_dbus_chat_logind(local_login_t)
|
|
|
|
systemd_write_inherited_logind_sessions_pipes(local_login_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2007-10-02 16:04:50 +00:00
|
|
|
usermanage_read_crack_db(local_login_t)
|
2006-01-25 15:53:35 +00:00
|
|
|
')
|
|
|
|
|
2007-09-11 19:24:32 +00:00
|
|
|
optional_policy(`
|
2019-01-31 02:58:52 +00:00
|
|
|
xserver_link_xdm_keys(local_login_t)
|
2007-09-11 19:24:32 +00:00
|
|
|
xserver_read_xdm_tmp_files(local_login_t)
|
|
|
|
xserver_rw_xdm_tmp_files(local_login_t)
|
2017-11-02 17:30:46 +00:00
|
|
|
xserver_rw_xdm_keys(local_login_t)
|
2007-09-11 19:24:32 +00:00
|
|
|
')
|
|
|
|
|
2005-05-09 15:38:06 +00:00
|
|
|
#################################
|
2011-04-14 15:36:56 +00:00
|
|
|
#
|
2005-05-09 15:38:06 +00:00
|
|
|
# Sulogin local policy
|
|
|
|
#
|
|
|
|
|
2017-04-27 23:45:33 +00:00
|
|
|
allow sulogin_t self:capability { dac_read_search sys_admin sys_tty_config };
|
2017-04-29 15:27:05 +00:00
|
|
|
dontaudit sulogin_t self:capability dac_override;
|
2017-04-25 22:50:02 +00:00
|
|
|
allow sulogin_t self:process setexec;
|
2005-05-09 15:38:06 +00:00
|
|
|
allow sulogin_t self:fd use;
|
2011-04-14 15:36:56 +00:00
|
|
|
allow sulogin_t self:fifo_file rw_fifo_file_perms;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow sulogin_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow sulogin_t self:unix_stream_socket create_stream_socket_perms;
|
2005-05-09 15:38:06 +00:00
|
|
|
allow sulogin_t self:unix_dgram_socket sendto;
|
|
|
|
allow sulogin_t self:unix_stream_socket connectto;
|
2005-06-09 14:26:05 +00:00
|
|
|
allow sulogin_t self:shm create_shm_perms;
|
|
|
|
allow sulogin_t self:sem create_sem_perms;
|
2005-06-10 01:01:13 +00:00
|
|
|
allow sulogin_t self:msgq create_msgq_perms;
|
2005-05-09 15:38:06 +00:00
|
|
|
allow sulogin_t self:msg { send receive };
|
|
|
|
|
|
|
|
kernel_read_system_state(sulogin_t)
|
2017-04-25 22:50:02 +00:00
|
|
|
kernel_read_crypto_sysctls(sulogin_t)
|
|
|
|
kernel_stream_connect(sulogin_t)
|
|
|
|
kernel_use_fds(sulogin_t)
|
2014-01-16 16:24:25 +00:00
|
|
|
# because file systems are not mounted:
|
|
|
|
kernel_dontaudit_search_unlabeled(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(sulogin_t)
|
2006-01-31 20:29:27 +00:00
|
|
|
fs_rw_tmpfs_chr_files(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2017-04-26 10:16:22 +00:00
|
|
|
term_use_console(sulogin_t)
|
|
|
|
term_use_unallocated_ttys(sulogin_t)
|
|
|
|
|
2009-08-05 14:06:04 +00:00
|
|
|
auth_read_shadow(sulogin_t)
|
|
|
|
|
2017-04-25 22:50:02 +00:00
|
|
|
init_getpgid(sulogin_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
init_getpgid_script(sulogin_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2017-04-25 22:50:02 +00:00
|
|
|
miscfiles_read_localization(sulogin_t)
|
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_read_config(sulogin_t)
|
|
|
|
seutil_read_default_contexts(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(sulogin_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_search_user_home_dirs(sulogin_t)
|
|
|
|
userdom_use_user_ptys(sulogin_t)
|
2008-04-29 13:58:34 +00:00
|
|
|
|
|
|
|
sysadm_shell_domtrans(sulogin_t)
|
2005-05-24 15:55:57 +00:00
|
|
|
|
2017-04-25 22:50:02 +00:00
|
|
|
# by default, sulogin does not use pam...
|
|
|
|
# sulogin_pam might need to be defined otherwise
|
|
|
|
ifdef(`sulogin_pam', `
|
2005-06-14 20:48:34 +00:00
|
|
|
selinux_get_fs_mount(sulogin_t)
|
|
|
|
selinux_validate_context(sulogin_t)
|
|
|
|
selinux_compute_access_vector(sulogin_t)
|
|
|
|
selinux_compute_create_context(sulogin_t)
|
|
|
|
selinux_compute_relabel_context(sulogin_t)
|
|
|
|
selinux_compute_user_contexts(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2005-06-27 16:30:55 +00:00
|
|
|
nis_use_ypbind(sulogin_t)
|
2005-05-09 15:38:06 +00:00
|
|
|
')
|
2006-01-25 15:53:35 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2012-12-17 20:06:29 +00:00
|
|
|
nscd_use(sulogin_t)
|
2006-01-25 15:53:35 +00:00
|
|
|
')
|