2012-02-15 19:32:45 +00:00
|
|
|
policy_module(usermanage, 1.17.0)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Declarations
|
|
|
|
#
|
|
|
|
|
2011-08-12 14:39:01 +00:00
|
|
|
attribute_role chfn_roles;
|
2011-12-15 07:17:17 +00:00
|
|
|
role chfn_roles types chfn_t;
|
2011-08-12 14:39:01 +00:00
|
|
|
role system_r types chfn_t;
|
|
|
|
|
|
|
|
attribute_role groupadd_roles;
|
2011-12-15 07:17:17 +00:00
|
|
|
role groupadd_roles types groupadd_t;
|
2011-08-12 14:39:01 +00:00
|
|
|
|
|
|
|
attribute_role passwd_roles;
|
|
|
|
roleattribute system_r passwd_roles;
|
|
|
|
|
|
|
|
attribute_role sysadm_passwd_roles;
|
|
|
|
roleattribute system_r sysadm_passwd_roles;
|
|
|
|
|
|
|
|
attribute_role useradd_roles;
|
2011-12-15 07:17:17 +00:00
|
|
|
role useradd_roles types useradd_t;
|
2011-08-12 14:39:01 +00:00
|
|
|
|
2005-05-04 19:15:13 +00:00
|
|
|
type admin_passwd_exec_t;
|
2005-06-29 14:26:41 +00:00
|
|
|
files_type(admin_passwd_exec_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-05-09 18:50:20 +00:00
|
|
|
type chfn_t;
|
2007-07-19 18:57:48 +00:00
|
|
|
type chfn_exec_t;
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_obj_id_change_exemption(chfn_t)
|
2008-07-23 21:38:39 +00:00
|
|
|
application_domain(chfn_t, chfn_exec_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
type crack_t;
|
|
|
|
type crack_exec_t;
|
2008-07-23 21:38:39 +00:00
|
|
|
application_domain(crack_t, crack_exec_t)
|
2007-07-19 18:57:48 +00:00
|
|
|
role system_r types crack_t;
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-10-24 18:40:24 +00:00
|
|
|
type crack_db_t;
|
2006-06-14 20:52:45 +00:00
|
|
|
files_type(crack_db_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
type crack_tmp_t;
|
2005-06-13 17:35:46 +00:00
|
|
|
files_tmp_file(crack_tmp_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
type groupadd_t;
|
2005-05-04 19:15:13 +00:00
|
|
|
type groupadd_exec_t;
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_obj_id_change_exemption(groupadd_t)
|
2008-07-23 21:38:39 +00:00
|
|
|
init_system_domain(groupadd_t, groupadd_exec_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-05-09 18:50:20 +00:00
|
|
|
type passwd_t;
|
2007-07-19 18:57:48 +00:00
|
|
|
type passwd_exec_t;
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_obj_id_change_exemption(passwd_t)
|
2008-07-23 21:38:39 +00:00
|
|
|
application_domain(passwd_t, passwd_exec_t)
|
2011-08-12 14:39:01 +00:00
|
|
|
role passwd_roles types passwd_t;
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-05-09 18:50:20 +00:00
|
|
|
type sysadm_passwd_t;
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_obj_id_change_exemption(sysadm_passwd_t)
|
2008-07-23 21:38:39 +00:00
|
|
|
application_domain(sysadm_passwd_t, admin_passwd_exec_t)
|
2011-08-12 14:39:01 +00:00
|
|
|
role sysadm_passwd_roles types sysadm_passwd_t;
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
type sysadm_passwd_tmp_t;
|
2005-10-25 20:22:25 +00:00
|
|
|
files_tmp_file(sysadm_passwd_tmp_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
type useradd_t;
|
2005-05-04 19:15:13 +00:00
|
|
|
type useradd_exec_t;
|
2006-02-02 21:08:12 +00:00
|
|
|
domain_obj_id_change_exemption(useradd_t)
|
2009-06-26 14:40:13 +00:00
|
|
|
init_system_domain(useradd_t, useradd_exec_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Chfn local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow chfn_t self:capability { chown dac_override fsetid setuid setgid sys_resource };
|
2005-09-01 20:13:42 +00:00
|
|
|
allow chfn_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execheap execstack };
|
2005-05-04 19:15:13 +00:00
|
|
|
allow chfn_t self:process { setrlimit setfscreate };
|
|
|
|
allow chfn_t self:fd use;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow chfn_t self:fifo_file rw_fifo_file_perms;
|
|
|
|
allow chfn_t self:sock_file read_sock_file_perms;
|
2005-06-09 17:21:52 +00:00
|
|
|
allow chfn_t self:shm create_shm_perms;
|
|
|
|
allow chfn_t self:sem create_sem_perms;
|
|
|
|
allow chfn_t self:msgq create_msgq_perms;
|
2005-05-04 19:15:13 +00:00
|
|
|
allow chfn_t self:msg { send receive };
|
2005-10-13 20:59:36 +00:00
|
|
|
allow chfn_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow chfn_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow chfn_t self:unix_dgram_socket sendto;
|
|
|
|
allow chfn_t self:unix_stream_socket connectto;
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(chfn_t)
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(chfn_t)
|
2005-09-16 13:36:26 +00:00
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
selinux_get_fs_mount(chfn_t)
|
|
|
|
selinux_validate_context(chfn_t)
|
|
|
|
selinux_compute_access_vector(chfn_t)
|
|
|
|
selinux_compute_create_context(chfn_t)
|
|
|
|
selinux_compute_relabel_context(chfn_t)
|
|
|
|
selinux_compute_user_contexts(chfn_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2010-02-11 19:20:10 +00:00
|
|
|
term_use_all_ttys(chfn_t)
|
|
|
|
term_use_all_ptys(chfn_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(chfn_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(chfn_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
# for SSP
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_read_urand(chfn_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2011-08-12 14:39:01 +00:00
|
|
|
auth_run_chk_passwd(chfn_t, chfn_roles)
|
2005-09-20 20:48:17 +00:00
|
|
|
auth_dontaudit_read_shadow(chfn_t)
|
2007-12-04 15:05:55 +00:00
|
|
|
auth_use_nsswitch(chfn_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
|
2005-11-08 22:00:30 +00:00
|
|
|
# allow checking if a shell is executable
|
|
|
|
corecmd_check_exec_shell(chfn_t)
|
2005-06-29 20:53:53 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(chfn_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_manage_etc_files(chfn_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_etc_runtime_files(chfn_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
files_dontaudit_search_var(chfn_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
files_dontaudit_search_home(chfn_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
|
|
|
# /usr/bin/passwd asks for w access to utmp, but it will operate
|
|
|
|
# correctly without it. Do not audit write denials to utmp.
|
2006-01-18 18:08:39 +00:00
|
|
|
init_dontaudit_rw_utmp(chfn_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(chfn_t)
|
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(chfn_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-09-20 20:48:17 +00:00
|
|
|
# uses unix_chkpwd for checking passwords
|
|
|
|
seutil_dontaudit_search_config(chfn_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(chfn_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
# user generally runs this from their home directory, so do not audit a search
|
|
|
|
# on user home dir
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_content(chfn_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2005-05-04 19:15:13 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Crack local policy
|
|
|
|
#
|
|
|
|
|
2010-10-04 18:23:56 +00:00
|
|
|
allow crack_t self:process signal_perms;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow crack_t self:fifo_file rw_fifo_file_perms;
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_files_pattern(crack_t, crack_db_t, crack_db_t)
|
|
|
|
manage_lnk_files_pattern(crack_t, crack_db_t, crack_db_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_var(crack_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(crack_t, crack_tmp_t, crack_tmp_t)
|
|
|
|
manage_files_pattern(crack_t, crack_tmp_t, crack_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(crack_t, crack_tmp_t, { file dir })
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
kernel_read_system_state(crack_t)
|
|
|
|
|
|
|
|
# for SSP
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_read_urand(crack_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(crack_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files(crack_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_etc_runtime_files(crack_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
# for dictionaries
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_usr_files(crack_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
corecmd_exec_bin(crack_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(crack_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_dirs(crack_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2008-02-19 14:06:11 +00:00
|
|
|
ifdef(`distro_debian',`
|
|
|
|
# the package cracklib-runtime on Debian contains a daily maintenance
|
|
|
|
# script /etc/cron.daily/cracklib-runtime, that calls
|
|
|
|
# update-cracklib and that calls crack_mkdict, which is a shell script.
|
|
|
|
corecmd_exec_shell(crack_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2008-07-23 21:38:39 +00:00
|
|
|
cron_system_entry(crack_t, crack_exec_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
')
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Groupadd local policy
|
|
|
|
#
|
|
|
|
|
2006-07-13 17:22:08 +00:00
|
|
|
allow groupadd_t self:capability { dac_override chown kill setuid sys_resource audit_write };
|
2006-12-04 20:10:56 +00:00
|
|
|
dontaudit groupadd_t self:capability { fsetid sys_tty_config };
|
2005-09-01 20:13:42 +00:00
|
|
|
allow groupadd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execheap execstack };
|
2005-05-04 19:15:13 +00:00
|
|
|
allow groupadd_t self:process { setrlimit setfscreate };
|
|
|
|
allow groupadd_t self:fd use;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow groupadd_t self:fifo_file rw_fifo_file_perms;
|
2005-06-09 17:21:52 +00:00
|
|
|
allow groupadd_t self:shm create_shm_perms;
|
|
|
|
allow groupadd_t self:sem create_sem_perms;
|
|
|
|
allow groupadd_t self:msgq create_msgq_perms;
|
2005-05-04 19:15:13 +00:00
|
|
|
allow groupadd_t self:msg { send receive };
|
2005-10-13 20:59:36 +00:00
|
|
|
allow groupadd_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow groupadd_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow groupadd_t self:unix_dgram_socket sendto;
|
|
|
|
allow groupadd_t self:unix_stream_socket connectto;
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_getattr_xattr_fs(groupadd_t)
|
|
|
|
fs_search_auto_mountpoints(groupadd_t)
|
|
|
|
|
2005-05-04 19:15:13 +00:00
|
|
|
# Allow access to context for shadow file
|
2005-06-14 20:48:34 +00:00
|
|
|
selinux_get_fs_mount(groupadd_t)
|
|
|
|
selinux_validate_context(groupadd_t)
|
|
|
|
selinux_compute_access_vector(groupadd_t)
|
|
|
|
selinux_compute_create_context(groupadd_t)
|
|
|
|
selinux_compute_relabel_context(groupadd_t)
|
|
|
|
selinux_compute_user_contexts(groupadd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2010-02-11 19:20:10 +00:00
|
|
|
term_use_all_ttys(groupadd_t)
|
|
|
|
term_use_all_ptys(groupadd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(groupadd_t)
|
2006-01-18 18:08:39 +00:00
|
|
|
init_read_utmp(groupadd_t)
|
|
|
|
init_dontaudit_write_utmp(groupadd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(groupadd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_manage_etc_files(groupadd_t)
|
2005-11-25 15:51:50 +00:00
|
|
|
files_relabel_etc_files(groupadd_t)
|
2006-03-30 15:59:39 +00:00
|
|
|
files_read_etc_runtime_files(groupadd_t)
|
2010-07-06 14:56:20 +00:00
|
|
|
files_read_usr_symlinks(groupadd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2009-06-26 14:40:13 +00:00
|
|
|
# Execute /usr/bin/{passwd, chfn, chsh} and /usr/sbin/{useradd, vipw}.
|
2005-06-13 17:35:46 +00:00
|
|
|
corecmd_exec_bin(groupadd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2007-09-04 18:57:58 +00:00
|
|
|
logging_send_audit_msgs(groupadd_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(groupadd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(groupadd_t)
|
|
|
|
|
2011-08-12 14:39:01 +00:00
|
|
|
auth_run_chk_passwd(groupadd_t, groupadd_roles)
|
2009-08-05 18:19:54 +00:00
|
|
|
auth_rw_lastlog(groupadd_t)
|
|
|
|
auth_use_nsswitch(groupadd_t)
|
|
|
|
# these may be unnecessary due to the above
|
|
|
|
# domtrans_chk_passwd() call.
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_manage_shadow(groupadd_t)
|
2005-11-25 15:51:50 +00:00
|
|
|
auth_relabel_shadow(groupadd_t)
|
2006-05-03 20:29:14 +00:00
|
|
|
auth_etc_filetrans_shadow(groupadd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_read_config(groupadd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(groupadd_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
# for when /root is the cwd
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_dirs(groupadd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-03-08 18:43:05 +00:00
|
|
|
dpkg_use_fds(groupadd_t)
|
|
|
|
dpkg_rw_pipes(groupadd_t)
|
|
|
|
')
|
|
|
|
|
2007-09-04 18:57:58 +00:00
|
|
|
optional_policy(`
|
2011-08-12 14:39:01 +00:00
|
|
|
nscd_run(groupadd_t, groupadd_roles)
|
2007-09-04 18:57:58 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2009-11-11 16:28:50 +00:00
|
|
|
puppet_rw_tmp(groupadd_t)
|
2005-07-12 20:34:24 +00:00
|
|
|
')
|
|
|
|
|
2009-11-09 22:54:00 +00:00
|
|
|
optional_policy(`
|
2009-11-11 16:28:50 +00:00
|
|
|
rpm_use_fds(groupadd_t)
|
|
|
|
rpm_rw_pipes(groupadd_t)
|
2009-11-09 22:54:00 +00:00
|
|
|
')
|
|
|
|
|
2005-05-04 19:15:13 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Passwd local policy
|
|
|
|
#
|
|
|
|
|
2010-07-06 14:56:20 +00:00
|
|
|
allow passwd_t self:capability { chown dac_override fsetid setuid setgid sys_nice sys_resource };
|
|
|
|
dontaudit passwd_t self:capability sys_tty_config;
|
2005-09-01 20:13:42 +00:00
|
|
|
allow passwd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
2005-05-04 19:15:13 +00:00
|
|
|
allow passwd_t self:process { setrlimit setfscreate };
|
|
|
|
allow passwd_t self:fd use;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow passwd_t self:fifo_file rw_fifo_file_perms;
|
|
|
|
allow passwd_t self:sock_file read_sock_file_perms;
|
2005-06-09 17:21:52 +00:00
|
|
|
allow passwd_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow passwd_t self:unix_stream_socket create_stream_socket_perms;
|
2005-05-04 19:15:13 +00:00
|
|
|
allow passwd_t self:unix_dgram_socket sendto;
|
|
|
|
allow passwd_t self:unix_stream_socket connectto;
|
2005-06-09 17:21:52 +00:00
|
|
|
allow passwd_t self:shm create_shm_perms;
|
|
|
|
allow passwd_t self:sem create_sem_perms;
|
2005-06-10 01:01:13 +00:00
|
|
|
allow passwd_t self:msgq create_msgq_perms;
|
2005-05-04 19:15:13 +00:00
|
|
|
allow passwd_t self:msg { send receive };
|
|
|
|
|
2006-12-12 20:08:08 +00:00
|
|
|
allow passwd_t crack_db_t:dir list_dir_perms;
|
2008-07-23 21:38:39 +00:00
|
|
|
read_files_pattern(passwd_t, crack_db_t, crack_db_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(passwd_t)
|
2005-09-16 13:36:26 +00:00
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
# for SSP
|
|
|
|
dev_read_urand(passwd_t)
|
|
|
|
|
|
|
|
fs_getattr_xattr_fs(passwd_t)
|
|
|
|
fs_search_auto_mountpoints(passwd_t)
|
|
|
|
|
2007-08-20 18:26:08 +00:00
|
|
|
mls_file_write_all_levels(passwd_t)
|
2006-02-06 22:47:46 +00:00
|
|
|
mls_file_downgrade(passwd_t)
|
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
selinux_get_fs_mount(passwd_t)
|
|
|
|
selinux_validate_context(passwd_t)
|
|
|
|
selinux_compute_access_vector(passwd_t)
|
|
|
|
selinux_compute_create_context(passwd_t)
|
|
|
|
selinux_compute_relabel_context(passwd_t)
|
|
|
|
selinux_compute_user_contexts(passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2010-02-11 19:20:10 +00:00
|
|
|
term_use_all_ttys(passwd_t)
|
|
|
|
term_use_all_ptys(passwd_t)
|
2005-10-26 21:03:19 +00:00
|
|
|
|
2011-08-12 14:39:01 +00:00
|
|
|
auth_run_chk_passwd(passwd_t, passwd_roles)
|
2005-09-20 20:48:17 +00:00
|
|
|
auth_manage_shadow(passwd_t)
|
2005-11-25 15:51:50 +00:00
|
|
|
auth_relabel_shadow(passwd_t)
|
2006-05-03 20:29:14 +00:00
|
|
|
auth_etc_filetrans_shadow(passwd_t)
|
2007-12-04 15:05:55 +00:00
|
|
|
auth_use_nsswitch(passwd_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
|
2005-11-08 22:00:30 +00:00
|
|
|
# allow checking if a shell is executable
|
|
|
|
corecmd_check_exec_shell(passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_etc_runtime_files(passwd_t)
|
2005-06-29 14:26:41 +00:00
|
|
|
files_manage_etc_files(passwd_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
files_search_var(passwd_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
files_dontaudit_search_pids(passwd_t)
|
2005-11-25 15:51:50 +00:00
|
|
|
files_relabel_etc_files(passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-11-08 22:00:30 +00:00
|
|
|
# /usr/bin/passwd asks for w access to utmp, but it will operate
|
|
|
|
# correctly without it. Do not audit write denials to utmp.
|
2006-01-18 18:08:39 +00:00
|
|
|
init_dontaudit_rw_utmp(passwd_t)
|
2009-03-19 17:56:10 +00:00
|
|
|
init_use_fds(passwd_t)
|
2005-11-08 22:00:30 +00:00
|
|
|
|
2007-09-04 18:57:58 +00:00
|
|
|
logging_send_audit_msgs(passwd_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(passwd_t)
|
|
|
|
|
2005-09-20 20:48:17 +00:00
|
|
|
seutil_dontaudit_search_config(passwd_t)
|
2005-05-09 18:50:20 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_use_user_terminals(passwd_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(passwd_t)
|
2005-11-25 15:51:50 +00:00
|
|
|
# make sure that getcon succeeds
|
2006-02-20 21:33:25 +00:00
|
|
|
userdom_getattr_all_users(passwd_t)
|
2006-02-02 21:08:12 +00:00
|
|
|
userdom_read_all_users_state(passwd_t)
|
2009-03-19 17:56:10 +00:00
|
|
|
userdom_read_user_tmp_files(passwd_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
# user generally runs this from their home directory, so do not audit a search
|
|
|
|
# on user home dir
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_content(passwd_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2011-08-12 14:39:01 +00:00
|
|
|
nscd_run(passwd_t, passwd_roles)
|
2006-01-06 22:51:40 +00:00
|
|
|
')
|
|
|
|
|
2005-05-04 19:15:13 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Password admin local policy
|
|
|
|
#
|
|
|
|
|
|
|
|
allow sysadm_passwd_t self:capability { chown dac_override fsetid setuid setgid sys_resource };
|
2005-09-01 20:13:42 +00:00
|
|
|
allow sysadm_passwd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
2005-05-04 19:15:13 +00:00
|
|
|
allow sysadm_passwd_t self:process { setrlimit setfscreate };
|
|
|
|
allow sysadm_passwd_t self:fd use;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow sysadm_passwd_t self:fifo_file rw_fifo_file_perms;
|
|
|
|
allow sysadm_passwd_t self:sock_file read_sock_file_perms;
|
2005-06-09 17:21:52 +00:00
|
|
|
allow sysadm_passwd_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow sysadm_passwd_t self:unix_stream_socket create_stream_socket_perms;
|
2005-05-04 19:15:13 +00:00
|
|
|
allow sysadm_passwd_t self:unix_dgram_socket sendto;
|
|
|
|
allow sysadm_passwd_t self:unix_stream_socket connectto;
|
2005-06-09 17:21:52 +00:00
|
|
|
allow sysadm_passwd_t self:shm create_shm_perms;
|
|
|
|
allow sysadm_passwd_t self:sem create_sem_perms;
|
|
|
|
allow sysadm_passwd_t self:msgq create_msgq_perms;
|
2005-05-04 19:15:13 +00:00
|
|
|
allow sysadm_passwd_t self:msg { send receive };
|
|
|
|
|
|
|
|
# allow vipw to create temporary files under /var/tmp/vi.recover
|
2008-07-23 21:38:39 +00:00
|
|
|
manage_dirs_pattern(sysadm_passwd_t, sysadm_passwd_tmp_t, sysadm_passwd_tmp_t)
|
|
|
|
manage_files_pattern(sysadm_passwd_t, sysadm_passwd_tmp_t, sysadm_passwd_tmp_t)
|
2006-02-21 18:40:44 +00:00
|
|
|
files_tmp_filetrans(sysadm_passwd_t, sysadm_passwd_tmp_t, { file dir })
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_var(sysadm_passwd_t)
|
2006-10-31 21:01:48 +00:00
|
|
|
files_dontaudit_search_home(sysadm_passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2006-01-31 16:49:43 +00:00
|
|
|
kernel_read_kernel_sysctls(sysadm_passwd_t)
|
2005-09-16 13:36:26 +00:00
|
|
|
# for /proc/meminfo
|
|
|
|
kernel_read_system_state(sysadm_passwd_t)
|
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
selinux_get_fs_mount(sysadm_passwd_t)
|
|
|
|
selinux_validate_context(sysadm_passwd_t)
|
|
|
|
selinux_compute_access_vector(sysadm_passwd_t)
|
|
|
|
selinux_compute_create_context(sysadm_passwd_t)
|
|
|
|
selinux_compute_relabel_context(sysadm_passwd_t)
|
|
|
|
selinux_compute_user_contexts(sysadm_passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
# for SSP
|
2005-06-13 16:22:32 +00:00
|
|
|
dev_read_urand(sysadm_passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_getattr_xattr_fs(sysadm_passwd_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
fs_search_auto_mountpoints(sysadm_passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2010-02-11 19:20:10 +00:00
|
|
|
term_use_all_ttys(sysadm_passwd_t)
|
|
|
|
term_use_all_ptys(sysadm_passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
auth_manage_shadow(sysadm_passwd_t)
|
2005-11-25 15:51:50 +00:00
|
|
|
auth_relabel_shadow(sysadm_passwd_t)
|
2006-05-03 20:29:14 +00:00
|
|
|
auth_etc_filetrans_shadow(sysadm_passwd_t)
|
2007-12-04 15:05:55 +00:00
|
|
|
auth_use_nsswitch(sysadm_passwd_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
|
|
|
# allow vipw to exec the editor
|
|
|
|
corecmd_exec_bin(sysadm_passwd_t)
|
|
|
|
corecmd_exec_shell(sysadm_passwd_t)
|
|
|
|
files_read_usr_files(sysadm_passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2006-02-20 21:33:25 +00:00
|
|
|
domain_use_interactive_fds(sysadm_passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_manage_etc_files(sysadm_passwd_t)
|
2005-11-25 15:51:50 +00:00
|
|
|
files_relabel_etc_files(sysadm_passwd_t)
|
2005-06-13 17:35:46 +00:00
|
|
|
files_read_etc_runtime_files(sysadm_passwd_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
# for nscd lookups
|
|
|
|
files_dontaudit_search_pids(sysadm_passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-06-27 16:30:55 +00:00
|
|
|
# /usr/bin/passwd asks for w access to utmp, but it will operate
|
|
|
|
# correctly without it. Do not audit write denials to utmp.
|
2006-01-18 18:08:39 +00:00
|
|
|
init_dontaudit_rw_utmp(sysadm_passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(sysadm_passwd_t)
|
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg(sysadm_passwd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2005-09-20 20:48:17 +00:00
|
|
|
seutil_dontaudit_search_config(sysadm_passwd_t)
|
|
|
|
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(sysadm_passwd_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
# user generally runs this from their home directory, so do not audit a search
|
|
|
|
# on user home dir
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_dontaudit_search_user_home_content(sysadm_passwd_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2011-08-12 14:39:01 +00:00
|
|
|
nscd_run(sysadm_passwd_t, sysadm_passwd_roles)
|
2006-09-22 17:14:35 +00:00
|
|
|
')
|
|
|
|
|
2005-05-04 19:15:13 +00:00
|
|
|
########################################
|
|
|
|
#
|
|
|
|
# Useradd local policy
|
|
|
|
#
|
|
|
|
|
2007-09-04 18:57:58 +00:00
|
|
|
allow useradd_t self:capability { dac_override chown kill fowner fsetid setuid sys_resource };
|
2006-12-04 20:10:56 +00:00
|
|
|
dontaudit useradd_t self:capability sys_tty_config;
|
2005-09-01 20:13:42 +00:00
|
|
|
allow useradd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
|
2005-05-04 19:15:13 +00:00
|
|
|
allow useradd_t self:process setfscreate;
|
|
|
|
allow useradd_t self:fd use;
|
2006-12-12 20:08:08 +00:00
|
|
|
allow useradd_t self:fifo_file rw_fifo_file_perms;
|
2005-06-09 17:21:52 +00:00
|
|
|
allow useradd_t self:shm create_shm_perms;
|
|
|
|
allow useradd_t self:sem create_sem_perms;
|
|
|
|
allow useradd_t self:msgq create_msgq_perms;
|
2005-05-04 19:15:13 +00:00
|
|
|
allow useradd_t self:msg { send receive };
|
2005-10-13 20:59:36 +00:00
|
|
|
allow useradd_t self:unix_dgram_socket create_socket_perms;
|
|
|
|
allow useradd_t self:unix_stream_socket create_stream_socket_perms;
|
|
|
|
allow useradd_t self:unix_dgram_socket sendto;
|
|
|
|
allow useradd_t self:unix_stream_socket connectto;
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2006-10-31 21:01:48 +00:00
|
|
|
# for getting the number of groups
|
|
|
|
kernel_read_kernel_sysctls(useradd_t)
|
|
|
|
|
|
|
|
corecmd_exec_shell(useradd_t)
|
|
|
|
# Execute /usr/bin/{passwd,chfn,chsh} and /usr/sbin/{useradd,vipw}.
|
|
|
|
corecmd_exec_bin(useradd_t)
|
|
|
|
|
|
|
|
domain_use_interactive_fds(useradd_t)
|
2010-07-06 14:56:20 +00:00
|
|
|
domain_read_all_domains_state(useradd_t)
|
2006-10-31 21:01:48 +00:00
|
|
|
|
|
|
|
files_manage_etc_files(useradd_t)
|
|
|
|
files_search_var_lib(useradd_t)
|
|
|
|
files_relabel_etc_files(useradd_t)
|
|
|
|
files_read_etc_runtime_files(useradd_t)
|
|
|
|
|
|
|
|
fs_search_auto_mountpoints(useradd_t)
|
|
|
|
fs_getattr_xattr_fs(useradd_t)
|
|
|
|
|
2007-02-16 23:01:42 +00:00
|
|
|
mls_file_upgrade(useradd_t)
|
|
|
|
|
2005-05-04 19:15:13 +00:00
|
|
|
# Allow access to context for shadow file
|
2005-06-14 20:48:34 +00:00
|
|
|
selinux_get_fs_mount(useradd_t)
|
|
|
|
selinux_validate_context(useradd_t)
|
|
|
|
selinux_compute_access_vector(useradd_t)
|
|
|
|
selinux_compute_create_context(useradd_t)
|
|
|
|
selinux_compute_relabel_context(useradd_t)
|
|
|
|
selinux_compute_user_contexts(useradd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2010-02-11 19:20:10 +00:00
|
|
|
term_use_all_ttys(useradd_t)
|
|
|
|
term_use_all_ptys(useradd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2011-08-12 14:39:01 +00:00
|
|
|
auth_run_chk_passwd(useradd_t, useradd_roles)
|
2005-06-27 16:30:55 +00:00
|
|
|
auth_rw_lastlog(useradd_t)
|
2006-08-29 02:41:00 +00:00
|
|
|
auth_rw_faillog(useradd_t)
|
2005-10-13 20:59:36 +00:00
|
|
|
auth_use_nsswitch(useradd_t)
|
2009-08-05 18:19:54 +00:00
|
|
|
# these may be unnecessary due to the above
|
|
|
|
# domtrans_chk_passwd() call.
|
|
|
|
auth_manage_shadow(useradd_t)
|
|
|
|
auth_relabel_shadow(useradd_t)
|
|
|
|
auth_etc_filetrans_shadow(useradd_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2006-03-02 23:41:11 +00:00
|
|
|
init_use_fds(useradd_t)
|
2006-01-18 18:08:39 +00:00
|
|
|
init_rw_utmp(useradd_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2007-09-04 18:57:58 +00:00
|
|
|
logging_send_audit_msgs(useradd_t)
|
2005-06-27 16:30:55 +00:00
|
|
|
logging_send_syslog_msg(useradd_t)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
|
|
|
miscfiles_read_localization(useradd_t)
|
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_read_config(useradd_t)
|
2005-09-15 15:34:31 +00:00
|
|
|
seutil_read_file_contexts(useradd_t)
|
2006-10-31 21:01:48 +00:00
|
|
|
seutil_read_default_contexts(useradd_t)
|
2011-08-12 14:39:01 +00:00
|
|
|
seutil_run_semanage(useradd_t, useradd_roles)
|
|
|
|
seutil_run_setfiles(useradd_t, useradd_roles)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2006-02-21 18:40:44 +00:00
|
|
|
userdom_use_unpriv_users_fds(useradd_t)
|
2005-09-20 20:48:17 +00:00
|
|
|
# Add/remove user home directories
|
2010-02-18 01:34:23 +00:00
|
|
|
userdom_manage_user_home_dirs(useradd_t)
|
|
|
|
userdom_home_filetrans_user_home_dir(useradd_t)
|
2008-11-05 16:10:46 +00:00
|
|
|
userdom_manage_user_home_content_dirs(useradd_t)
|
|
|
|
userdom_manage_user_home_content_files(useradd_t)
|
|
|
|
userdom_home_filetrans_user_home_dir(useradd_t)
|
|
|
|
userdom_user_home_dir_filetrans_user_home_content(useradd_t, notdevfile_class_set)
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2011-09-09 14:10:03 +00:00
|
|
|
optional_policy(`
|
|
|
|
mta_manage_spool(useradd_t)
|
|
|
|
')
|
2005-05-04 19:15:13 +00:00
|
|
|
|
2009-03-19 17:56:10 +00:00
|
|
|
ifdef(`distro_redhat',`
|
|
|
|
optional_policy(`
|
|
|
|
unconfined_domain(useradd_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2007-10-18 19:31:14 +00:00
|
|
|
optional_policy(`
|
|
|
|
apache_manage_all_user_content(useradd_t)
|
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2006-03-08 18:43:05 +00:00
|
|
|
dpkg_use_fds(useradd_t)
|
|
|
|
dpkg_rw_pipes(useradd_t)
|
|
|
|
')
|
|
|
|
|
2007-09-04 18:57:58 +00:00
|
|
|
optional_policy(`
|
2011-08-12 14:39:01 +00:00
|
|
|
nscd_run(useradd_t, useradd_roles)
|
2007-09-04 18:57:58 +00:00
|
|
|
')
|
|
|
|
|
2006-03-24 16:13:54 +00:00
|
|
|
optional_policy(`
|
2009-11-11 16:28:50 +00:00
|
|
|
puppet_rw_tmp(useradd_t)
|
2005-07-12 20:34:24 +00:00
|
|
|
')
|
2009-11-09 22:54:00 +00:00
|
|
|
|
2010-07-06 14:56:20 +00:00
|
|
|
optional_policy(`
|
|
|
|
tunable_policy(`samba_domain_controller',`
|
|
|
|
samba_append_log(useradd_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2009-11-09 22:54:00 +00:00
|
|
|
optional_policy(`
|
2009-11-11 16:28:50 +00:00
|
|
|
rpm_use_fds(useradd_t)
|
|
|
|
rpm_rw_pipes(useradd_t)
|
2009-11-09 22:54:00 +00:00
|
|
|
')
|