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

289 lines
8.2 KiB
Plaintext
Raw Normal View History

policy_module(locallogin, 1.19.2)
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)
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)
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
#
allow local_login_t self:capability { chown dac_read_search dac_override fowner fsetid kill setgid setuid sys_nice sys_resource sys_tty_config };
dontaudit local_login_t self:capability net_admin;
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;
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 };
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)
kernel_read_kernel_sysctls(local_login_t)
kernel_search_key(local_login_t)
kernel_link_key(local_login_t)
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)
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)
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)
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)
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
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)
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)
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
init_dontaudit_use_fds(local_login_t)
miscfiles_read_localization(local_login_t)
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
ifdef(`init_systemd',`
auth_manage_faillog(local_login_t)
2018-02-15 22:07:08 +00:00
init_dbus_chat(local_login_t)
systemd_dbus_chat_logind(local_login_t)
systemd_use_logind_fds(local_login_t)
systemd_manage_logind_pid_pipes(local_login_t)
')
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)
')
')
tunable_policy(`console_login',`
# Able to relabel /dev/console to user tty types.
term_relabel_console(local_login_t)
')
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(`
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
optional_policy(`
consolekit_dbus_chat(local_login_t)
')
2007-09-11 19:24:32 +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)
')
optional_policy(`
2005-06-27 16:30:55 +00:00
nis_use_ypbind(local_login_t)
2005-05-31 23:02:11 +00:00
')
optional_policy(`
nscd_use(local_login_t)
2005-07-13 20:48:51 +00:00
')
optional_policy(`
systemd_dbus_chat_logind(local_login_t)
systemd_write_inherited_logind_sessions_pipes(local_login_t)
')
optional_policy(`
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(`
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)
xserver_rw_xdm_keys(local_login_t)
2007-09-11 19:24:32 +00:00
')
2005-05-09 15:38:06 +00:00
#################################
#
2005-05-09 15:38:06 +00:00
# Sulogin local policy
#
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;
allow sulogin_t self:process setexec;
2005-05-09 15:38:06 +00:00
allow sulogin_t self:fd use;
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)
kernel_read_crypto_sysctls(sulogin_t)
kernel_stream_connect(sulogin_t)
kernel_use_fds(sulogin_t)
# 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)
fs_rw_tmpfs_chr_files(sulogin_t)
2005-05-09 15:38:06 +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)
auth_read_shadow(sulogin_t)
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
miscfiles_read_localization(sulogin_t)
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-11-05 16:10:46 +00:00
userdom_search_user_home_dirs(sulogin_t)
userdom_use_user_ptys(sulogin_t)
sysadm_shell_domtrans(sulogin_t)
2005-05-24 15:55:57 +00:00
# by default, sulogin does not use pam...
# sulogin_pam might need to be defined otherwise
ifdef(`sulogin_pam', `
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
')
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
optional_policy(`
nscd_use(sulogin_t)
2006-01-25 15:53:35 +00:00
')