Chris PeBenito 849380
Chris PeBenito 849380
policy_module(usermanage,1.0)
Chris PeBenito 849380
Chris PeBenito 849380
########################################
Chris PeBenito 849380
#
Chris PeBenito 849380
# Declarations
Chris PeBenito 849380
#
Chris PeBenito 849380
Chris PeBenito 849380
type admin_passwd_exec_t;
Chris PeBenito 8fd367
files_type(admin_passwd_exec_t)
Chris PeBenito 849380
Chris PeBenito a1f94a
type chfn_t;
Chris PeBenito 8bd678
domain_obj_id_change_exempt(chfn_t)
Chris PeBenito c9428d
domain_type(chfn_t)
Chris PeBenito 849380
role system_r types chfn_t;
Chris PeBenito 849380
Chris PeBenito 849380
type chfn_exec_t;
Chris PeBenito c9428d
domain_entry_file(chfn_t,chfn_exec_t)
Chris PeBenito 849380
Chris PeBenito 849380
type crack_t;
Chris PeBenito 9d3bdc
domain_type(crack_t)
Chris PeBenito 849380
role system_r types crack_t;
Chris PeBenito 849380
Chris PeBenito 849380
type crack_exec_t;
Chris PeBenito c9428d
domain_entry_file(crack_t,crack_exec_t)
Chris PeBenito 849380
Chris PeBenito 849380
type crack_db_t; #, usercanread;
Chris PeBenito 8fd367
files_type(crack_db_t)
Chris PeBenito 849380
Chris PeBenito 849380
type crack_tmp_t;
Chris PeBenito c9428d
files_tmp_file(crack_tmp_t)
Chris PeBenito 849380
Chris PeBenito 493d6c
type groupadd_t;
Chris PeBenito 849380
type groupadd_exec_t;
Chris PeBenito 8bd678
domain_obj_id_change_exempt(groupadd_t)
Chris PeBenito c9428d
init_system_domain(groupadd_t,groupadd_exec_t)
Chris PeBenito bbd6a6
role system_r types groupadd_t;
Chris PeBenito 849380
Chris PeBenito a1f94a
type passwd_t;
Chris PeBenito 8bd678
domain_obj_id_change_exempt(passwd_t)
Chris PeBenito c9428d
domain_type(passwd_t)
Chris PeBenito 849380
role system_r types passwd_t;
Chris PeBenito 849380
Chris PeBenito 849380
type passwd_exec_t;
Chris PeBenito c9428d
domain_entry_file(passwd_t,passwd_exec_t)
Chris PeBenito 849380
Chris PeBenito a1f94a
type sysadm_passwd_t;
Chris PeBenito 8bd678
domain_obj_id_change_exempt(sysadm_passwd_t)
Chris PeBenito c9428d
domain_type(sysadm_passwd_t)
Chris PeBenito c9428d
domain_entry_file(sysadm_passwd_t,admin_passwd_exec_t)
Chris PeBenito 849380
Chris PeBenito 849380
type sysadm_passwd_tmp_t;
Chris PeBenito 8fd367
files_type(sysadm_passwd_tmp_t)
Chris PeBenito 849380
Chris PeBenito 493d6c
type useradd_t;
Chris PeBenito 849380
type useradd_exec_t;
Chris PeBenito 8bd678
domain_obj_id_change_exempt(useradd_t)
Chris PeBenito c9428d
init_system_domain(useradd_t,useradd_exec_t)
Chris PeBenito bbd6a6
role system_r types useradd_t;
Chris PeBenito 849380
Chris PeBenito 849380
########################################
Chris PeBenito 849380
#
Chris PeBenito 849380
# Chfn local policy
Chris PeBenito 849380
#
Chris PeBenito 849380
Chris PeBenito 849380
allow chfn_t self:capability { chown dac_override fsetid setuid setgid sys_resource };
Chris PeBenito 9d3bdc
allow chfn_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execheap execstack };
Chris PeBenito 849380
allow chfn_t self:process { setrlimit setfscreate };
Chris PeBenito 849380
allow chfn_t self:fd use;
Chris PeBenito dc67f7
allow chfn_t self:fifo_file rw_file_perms;
Chris PeBenito 0fd9dc
allow chfn_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito 0fd9dc
allow chfn_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 849380
allow chfn_t self:unix_dgram_socket sendto;
Chris PeBenito 849380
allow chfn_t self:unix_stream_socket connectto;
Chris PeBenito dc67f7
allow chfn_t self:shm create_shm_perms;
Chris PeBenito dc67f7
allow chfn_t self:sem create_sem_perms;
Chris PeBenito dc67f7
allow chfn_t self:msgq create_msgq_perms;
Chris PeBenito 849380
allow chfn_t self:msg { send receive };
Chris PeBenito 849380
Chris PeBenito 849380
kernel_read_system_state(chfn_t)
Chris PeBenito a08248
kernel_read_kernel_sysctl(chfn_t)
Chris PeBenito a08248
Chris PeBenito 5e0da6
selinux_get_fs_mount(chfn_t)
Chris PeBenito 5e0da6
selinux_validate_context(chfn_t)
Chris PeBenito 5e0da6
selinux_compute_access_vector(chfn_t)
Chris PeBenito 5e0da6
selinux_compute_create_context(chfn_t)
Chris PeBenito 5e0da6
selinux_compute_relabel_context(chfn_t)
Chris PeBenito 5e0da6
selinux_compute_user_contexts(chfn_t)
Chris PeBenito 849380
Chris PeBenito 0fd9dc
term_use_all_user_ttys(chfn_t)
Chris PeBenito 0fd9dc
term_use_all_user_ptys(chfn_t)
Chris PeBenito 849380
Chris PeBenito 0fd9dc
fs_getattr_xattr_fs(chfn_t)
Chris PeBenito ab940a
fs_search_auto_mountpoints(chfn_t)
Chris PeBenito 849380
Chris PeBenito 849380
# for SSP
Karl MacMillan f0c985
dev_read_urand(chfn_t)
Chris PeBenito 849380
Chris PeBenito 3774e4
auth_domtrans_chk_passwd(chfn_t)
Chris PeBenito 3774e4
auth_dontaudit_read_shadow(chfn_t)
Chris PeBenito 3774e4
Chris PeBenito ebdc3b
# can exec /sbin/unix_chkpwd
Chris PeBenito ebdc3b
corecmd_search_bin(chfn_t)
Chris PeBenito ebdc3b
corecmd_search_sbin(chfn_t)
Chris PeBenito ebdc3b
Chris PeBenito c9428d
domain_use_wide_inherit_fd(chfn_t)
Chris PeBenito 849380
Chris PeBenito 8fd367
files_manage_etc_files(chfn_t)
Chris PeBenito c9428d
files_read_etc_runtime_files(chfn_t)
Chris PeBenito ab940a
files_dontaudit_search_var(chfn_t)
Chris PeBenito ab940a
Chris PeBenito ab940a
# /usr/bin/passwd asks for w access to utmp, but it will operate
Chris PeBenito ab940a
# correctly without it.  Do not audit write denials to utmp.
Chris PeBenito ab940a
init_dontaudit_rw_script_pid(chfn_t)
Chris PeBenito 849380
Chris PeBenito c9428d
libs_use_ld_so(chfn_t)
Chris PeBenito c9428d
libs_use_shared_libs(chfn_t)
Chris PeBenito 849380
Chris PeBenito 849380
miscfiles_read_localization(chfn_t)
Chris PeBenito 849380
Chris PeBenito c9428d
logging_send_syslog_msg(chfn_t)
Chris PeBenito 849380
Chris PeBenito 3774e4
# uses unix_chkpwd for checking passwords
Chris PeBenito 3774e4
seutil_dontaudit_search_config(chfn_t)
Chris PeBenito 849380
Chris PeBenito ab940a
userdom_use_unpriv_users_fd(chfn_t)
Chris PeBenito 3774e4
# user generally runs this from their home directory, so do not audit a search
Chris PeBenito 3774e4
# on user home dir
Chris PeBenito 3774e4
userdom_dontaudit_search_all_users_home(chfn_t)
Chris PeBenito ab940a
Chris PeBenito ab940a
optional_policy(`nis.te',`
Chris PeBenito ab940a
	nis_use_ypbind(chfn_t)
Chris PeBenito ab940a
')
Chris PeBenito ab940a
Chris PeBenito 849380
ifdef(`TODO',`
Chris PeBenito 849380
ifdef(`gnome-pty-helper.te', `allow chfn_t gphdomain:fd use;')
Chris PeBenito 849380
Chris PeBenito 849380
# allow checking if a shell is executable
Chris PeBenito 849380
allow chfn_t shell_exec_t:file execute;
Chris PeBenito 849380
') dnl endif TODO
Chris PeBenito 849380
Chris PeBenito 849380
########################################
Chris PeBenito 849380
#
Chris PeBenito 849380
# Crack local policy
Chris PeBenito 849380
#
Chris PeBenito 849380
Chris PeBenito 849380
allow crack_t self:process { sigkill sigstop signull signal };
Chris PeBenito dc67f7
allow crack_t self:fifo_file rw_file_perms;
Chris PeBenito 849380
Chris PeBenito dc67f7
allow crack_t crack_db_t:dir rw_dir_perms;
Chris PeBenito dc67f7
allow crack_t crack_db_t:file create_file_perms;
Chris PeBenito dc67f7
allow crack_t crack_db_t:lnk_file create_file_perms;
Chris PeBenito c9428d
files_search_var(crack_t)
Chris PeBenito 849380
Chris PeBenito dc67f7
allow crack_t crack_tmp_t:dir create_dir_perms;
Chris PeBenito dc67f7
allow crack_t crack_tmp_t:file create_file_perms;
Chris PeBenito c9428d
files_create_tmp_files(crack_t, crack_tmp_t, { file dir })
Chris PeBenito 849380
Chris PeBenito 849380
kernel_read_system_state(crack_t)
Chris PeBenito 849380
Chris PeBenito 849380
# for SSP
Karl MacMillan f0c985
dev_read_urand(crack_t)
Chris PeBenito 849380
Chris PeBenito 0fd9dc
fs_getattr_xattr_fs(crack_t)
Chris PeBenito 849380
Chris PeBenito 8fd367
files_read_etc_files(crack_t)
Chris PeBenito c9428d
files_read_etc_runtime_files(crack_t)
Chris PeBenito 849380
# for dictionaries
Chris PeBenito c9428d
files_read_usr_files(crack_t)
Chris PeBenito 849380
Chris PeBenito c9428d
corecmd_exec_bin(crack_t)
Chris PeBenito 849380
Chris PeBenito c9428d
libs_use_ld_so(crack_t)
Chris PeBenito c9428d
libs_use_shared_libs(crack_t)
Chris PeBenito 849380
Chris PeBenito c9428d
logging_send_syslog_msg(crack_t)
Chris PeBenito 849380
Chris PeBenito 3774e4
userdom_dontaudit_search_sysadm_home_dir(crack_t)
Chris PeBenito 849380
Chris PeBenito 3774e4
optional_policy(`cron.te',`
Chris PeBenito 3774e4
	cron_system_entry(crack_t,crack_exec_t)
Chris PeBenito 3774e4
')
Chris PeBenito 849380
Chris PeBenito 849380
########################################
Chris PeBenito 849380
#
Chris PeBenito 849380
# Groupadd local policy
Chris PeBenito 849380
#
Chris PeBenito 849380
Chris PeBenito 849380
allow groupadd_t self:capability { dac_override chown kill setuid sys_resource };
Chris PeBenito 849380
dontaudit groupadd_t self:capability fsetid;
Chris PeBenito 9d3bdc
allow groupadd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execheap execstack };
Chris PeBenito 849380
allow groupadd_t self:process { setrlimit setfscreate };
Chris PeBenito 849380
allow groupadd_t self:fd use;
Chris PeBenito dc67f7
allow groupadd_t self:fifo_file rw_file_perms;
Chris PeBenito dc67f7
allow groupadd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito dc67f7
allow groupadd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 849380
allow groupadd_t self:unix_dgram_socket sendto;
Chris PeBenito 849380
allow groupadd_t self:unix_stream_socket connectto;
Chris PeBenito dc67f7
allow groupadd_t self:shm create_shm_perms;
Chris PeBenito dc67f7
allow groupadd_t self:sem create_sem_perms;
Chris PeBenito dc67f7
allow groupadd_t self:msgq create_msgq_perms;
Chris PeBenito 849380
allow groupadd_t self:msg { send receive };
Chris PeBenito 849380
Chris PeBenito ab940a
fs_getattr_xattr_fs(groupadd_t)
Chris PeBenito ab940a
fs_search_auto_mountpoints(groupadd_t)
Chris PeBenito ab940a
Chris PeBenito 849380
# Allow access to context for shadow file
Chris PeBenito 5e0da6
selinux_get_fs_mount(groupadd_t)
Chris PeBenito 5e0da6
selinux_validate_context(groupadd_t)
Chris PeBenito 5e0da6
selinux_compute_access_vector(groupadd_t)
Chris PeBenito 5e0da6
selinux_compute_create_context(groupadd_t)
Chris PeBenito 5e0da6
selinux_compute_relabel_context(groupadd_t)
Chris PeBenito 5e0da6
selinux_compute_user_contexts(groupadd_t)
Chris PeBenito 849380
Chris PeBenito 0fd9dc
term_use_all_user_ttys(groupadd_t)
Chris PeBenito 0fd9dc
term_use_all_user_ptys(groupadd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
init_use_fd(groupadd_t)
Chris PeBenito c9428d
init_read_script_pid(groupadd_t)
Chris PeBenito ab940a
init_dontaudit_write_script_pid(groupadd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
domain_use_wide_inherit_fd(groupadd_t)
Chris PeBenito 849380
Chris PeBenito 8fd367
files_manage_etc_files(groupadd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
libs_use_ld_so(groupadd_t)
Chris PeBenito c9428d
libs_use_shared_libs(groupadd_t)
Chris PeBenito 849380
Chris PeBenito 849380
# Execute /usr/bin/{passwd,chfn,chsh} and /usr/sbin/{useradd,vipw}.
Chris PeBenito c9428d
corecmd_exec_bin(groupadd_t)
Chris PeBenito c9428d
corecmd_exec_sbin(groupadd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
logging_send_syslog_msg(groupadd_t)
Chris PeBenito 849380
Chris PeBenito 849380
miscfiles_read_localization(groupadd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
auth_manage_shadow(groupadd_t)
Chris PeBenito c9428d
auth_rw_lastlog(groupadd_t)
Chris PeBenito 849380
Chris PeBenito 5e0da6
seutil_read_config(groupadd_t)
Chris PeBenito 849380
Chris PeBenito ab940a
userdom_use_unpriv_users_fd(groupadd_t)
Chris PeBenito 3774e4
# for when /root is the cwd
Chris PeBenito 3774e4
userdom_dontaudit_search_sysadm_home_dir(groupadd_t)
Chris PeBenito 849380
Chris PeBenito ab940a
optional_policy(`nis.te',`
Chris PeBenito ab940a
	nis_use_ypbind(groupadd_t)
Chris PeBenito 849380
')
Chris PeBenito 849380
Chris PeBenito 493d6c
optional_policy(`nscd.te',`
Chris PeBenito 493d6c
	nscd_use_socket(groupadd_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito b24f35
optional_policy(`rpm.te',`
Chris PeBenito b24f35
	rpm_use_fd(groupadd_t)
Chris PeBenito b24f35
	rpm_rw_pipe(groupadd_t)
Chris PeBenito b24f35
')
Chris PeBenito b24f35
Chris PeBenito ab940a
ifdef(`TODO',`
Chris PeBenito 849380
# Update /etc/shadow and /etc/passwd
Chris PeBenito 849380
allow groupadd_t { etc_t shadow_t }:file { relabelfrom relabelto };
Chris PeBenito 849380
Chris PeBenito 849380
# Access terminals.
Chris PeBenito 849380
ifdef(`gnome-pty-helper.te', `allow groupadd_t gphdomain:fd use;')
Chris PeBenito 849380
') dnl end TODO
Chris PeBenito 849380
Chris PeBenito 849380
########################################
Chris PeBenito 849380
#
Chris PeBenito 849380
# Passwd local policy
Chris PeBenito 849380
#
Chris PeBenito 849380
Chris PeBenito 849380
allow passwd_t self:capability { chown dac_override fsetid setuid setgid sys_resource };
Chris PeBenito 9d3bdc
allow passwd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 849380
allow passwd_t self:process { setrlimit setfscreate };
Chris PeBenito 849380
allow passwd_t self:fd use;
Chris PeBenito dc67f7
allow passwd_t self:fifo_file rw_file_perms;
Chris PeBenito dc67f7
allow passwd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito dc67f7
allow passwd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 849380
allow passwd_t self:unix_dgram_socket sendto;
Chris PeBenito 849380
allow passwd_t self:unix_stream_socket connectto;
Chris PeBenito 0907bd
allow passwd_t self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
Chris PeBenito dc67f7
allow passwd_t self:shm create_shm_perms;
Chris PeBenito dc67f7
allow passwd_t self:sem create_sem_perms;
Chris PeBenito 0fd9dc
allow passwd_t self:msgq create_msgq_perms;
Chris PeBenito 849380
allow passwd_t self:msg { send receive };
Chris PeBenito 849380
Chris PeBenito ab940a
allow passwd_t crack_db_t:dir r_dir_perms;
Chris PeBenito ab940a
allow passwd_t crack_db_t:file r_file_perms;
Chris PeBenito ab940a
Chris PeBenito a08248
kernel_read_kernel_sysctl(passwd_t)
Chris PeBenito a08248
Chris PeBenito ab940a
# for SSP
Chris PeBenito ab940a
dev_read_urand(passwd_t)
Chris PeBenito ab940a
Chris PeBenito ab940a
fs_getattr_xattr_fs(passwd_t)
Chris PeBenito ab940a
fs_search_auto_mountpoints(passwd_t)
Chris PeBenito ab940a
Chris PeBenito 5e0da6
selinux_get_fs_mount(passwd_t)
Chris PeBenito 5e0da6
selinux_validate_context(passwd_t)
Chris PeBenito 5e0da6
selinux_compute_access_vector(passwd_t)
Chris PeBenito 5e0da6
selinux_compute_create_context(passwd_t)
Chris PeBenito 5e0da6
selinux_compute_relabel_context(passwd_t)
Chris PeBenito 5e0da6
selinux_compute_user_contexts(passwd_t)
Chris PeBenito 849380
Chris PeBenito 3774e4
auth_manage_shadow(passwd_t)
Chris PeBenito 3774e4
Chris PeBenito 849380
# /usr/bin/passwd asks for w access to utmp, but it will operate
Chris PeBenito 849380
# correctly without it.  Do not audit write denials to utmp.
Chris PeBenito c9428d
init_dontaudit_rw_script_pid(passwd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
domain_use_wide_inherit_fd(passwd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
files_read_etc_runtime_files(passwd_t)
Chris PeBenito 8fd367
files_manage_etc_files(passwd_t)
Chris PeBenito ab940a
files_search_var(passwd_t)
Chris PeBenito 3774e4
files_dontaudit_search_pids(passwd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
libs_use_ld_so(passwd_t)
Chris PeBenito c9428d
libs_use_shared_libs(passwd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
logging_send_syslog_msg(passwd_t)
Chris PeBenito 849380
Chris PeBenito 849380
miscfiles_read_localization(passwd_t)
Chris PeBenito 849380
Chris PeBenito 3774e4
seutil_dontaudit_search_config(passwd_t)
Chris PeBenito a1f94a
Chris PeBenito ab940a
userdom_use_unpriv_users_fd(passwd_t)
Chris PeBenito 3774e4
# user generally runs this from their home directory, so do not audit a search
Chris PeBenito 3774e4
# on user home dir
Chris PeBenito 3774e4
userdom_dontaudit_search_all_users_home(passwd_t)
Chris PeBenito ab940a
Chris PeBenito ab940a
optional_policy(`nis.te',`
Chris PeBenito ab940a
	nis_use_ypbind(passwd_t)
Chris PeBenito ab940a
')
Chris PeBenito ab940a
Chris PeBenito 849380
ifdef(`TODO',`
Chris PeBenito 849380
# Update /etc/shadow and /etc/passwd
Chris PeBenito 849380
allow passwd_t { etc_t shadow_t }:file { relabelfrom relabelto };
Chris PeBenito 849380
Chris PeBenito 849380
# Inherit and use descriptors from login.
Chris PeBenito 849380
ifdef(`gnome-pty-helper.te', `allow passwd_t gphdomain:fd use;')
Chris PeBenito 849380
Chris PeBenito 849380
# allow checking if a shell is executable
Chris PeBenito 849380
allow passwd_t shell_exec_t:file execute;
Chris PeBenito 849380
Chris PeBenito 849380
# make sure that getcon succeeds
Chris PeBenito 849380
allow passwd_t userdomain:dir search;
Chris PeBenito 849380
allow passwd_t userdomain:file read;
Chris PeBenito 849380
allow passwd_t userdomain:process getattr;
Chris PeBenito 849380
') dnl endif TODO
Chris PeBenito 849380
Chris PeBenito 849380
########################################
Chris PeBenito 849380
#
Chris PeBenito 849380
# Password admin local policy
Chris PeBenito 849380
#
Chris PeBenito 849380
Chris PeBenito 849380
allow sysadm_passwd_t self:capability { chown dac_override fsetid setuid setgid sys_resource };
Chris PeBenito 9d3bdc
allow sysadm_passwd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 849380
allow sysadm_passwd_t self:process { setrlimit setfscreate };
Chris PeBenito 849380
allow sysadm_passwd_t self:fd use;
Chris PeBenito dc67f7
allow sysadm_passwd_t self:fifo_file rw_file_perms;
Chris PeBenito dc67f7
allow sysadm_passwd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito dc67f7
allow sysadm_passwd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 849380
allow sysadm_passwd_t self:unix_dgram_socket sendto;
Chris PeBenito 849380
allow sysadm_passwd_t self:unix_stream_socket connectto;
Chris PeBenito dc67f7
allow sysadm_passwd_t self:shm create_shm_perms;
Chris PeBenito dc67f7
allow sysadm_passwd_t self:sem create_sem_perms;
Chris PeBenito dc67f7
allow sysadm_passwd_t self:msgq create_msgq_perms;
Chris PeBenito 849380
allow sysadm_passwd_t self:msg { send receive };
Chris PeBenito 849380
Chris PeBenito 849380
# allow vipw to create temporary files under /var/tmp/vi.recover
Chris PeBenito dc67f7
allow sysadm_passwd_t sysadm_passwd_tmp_t:dir create_dir_perms;
Chris PeBenito 0fd9dc
allow sysadm_passwd_t sysadm_passwd_tmp_t:file create_file_perms;
Chris PeBenito c9428d
files_create_tmp_files(sysadm_passwd_t, sysadm_passwd_tmp_t, { file dir })
Chris PeBenito c9428d
files_search_var(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito a08248
kernel_read_kernel_sysctl(sysadm_passwd_t)
Chris PeBenito a08248
# for /proc/meminfo
Chris PeBenito a08248
kernel_read_system_state(sysadm_passwd_t)
Chris PeBenito a08248
Chris PeBenito 5e0da6
selinux_get_fs_mount(sysadm_passwd_t)
Chris PeBenito 5e0da6
selinux_validate_context(sysadm_passwd_t)
Chris PeBenito 5e0da6
selinux_compute_access_vector(sysadm_passwd_t)
Chris PeBenito 5e0da6
selinux_compute_create_context(sysadm_passwd_t)
Chris PeBenito 5e0da6
selinux_compute_relabel_context(sysadm_passwd_t)
Chris PeBenito 5e0da6
selinux_compute_user_contexts(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito 849380
# for SSP
Karl MacMillan f0c985
dev_read_urand(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito 0fd9dc
fs_getattr_xattr_fs(sysadm_passwd_t)
Chris PeBenito ab940a
fs_search_auto_mountpoints(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito 0fd9dc
term_use_all_user_ttys(sysadm_passwd_t)
Chris PeBenito 0fd9dc
term_use_all_user_ptys(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito ab940a
auth_manage_shadow(sysadm_passwd_t)
Chris PeBenito ab940a
Chris PeBenito ab940a
# allow vipw to exec the editor
Chris PeBenito ab940a
corecmd_exec_bin(sysadm_passwd_t)
Chris PeBenito ab940a
corecmd_exec_shell(sysadm_passwd_t)
Chris PeBenito ab940a
files_read_usr_files(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
domain_use_wide_inherit_fd(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito 8fd367
files_manage_etc_files(sysadm_passwd_t)
Chris PeBenito c9428d
files_read_etc_runtime_files(sysadm_passwd_t)
Chris PeBenito 3774e4
# for nscd lookups
Chris PeBenito 3774e4
files_dontaudit_search_pids(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito ab940a
# /usr/bin/passwd asks for w access to utmp, but it will operate
Chris PeBenito ab940a
# correctly without it.  Do not audit write denials to utmp.
Chris PeBenito ab940a
init_dontaudit_rw_script_pid(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
libs_use_ld_so(sysadm_passwd_t)
Chris PeBenito c9428d
libs_use_shared_libs(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito 849380
miscfiles_read_localization(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
logging_send_syslog_msg(sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito 3774e4
seutil_dontaudit_search_config(sysadm_passwd_t)
Chris PeBenito 3774e4
Chris PeBenito ab940a
userdom_use_unpriv_users_fd(sysadm_passwd_t)
Chris PeBenito 3774e4
# user generally runs this from their home directory, so do not audit a search
Chris PeBenito 3774e4
# on user home dir
Chris PeBenito 3774e4
userdom_dontaudit_search_all_users_home(sysadm_passwd_t)
Chris PeBenito ab940a
Chris PeBenito ab940a
optional_policy(`nis.te',`
Chris PeBenito ab940a
	nis_use_ypbind(sysadm_passwd_t)
Chris PeBenito ab940a
')
Chris PeBenito a1f94a
Chris PeBenito 849380
ifdef(`TODO',`
Chris PeBenito 849380
role sysadm_r types sysadm_passwd_t;
Chris PeBenito 849380
domain_auto_trans(sysadm_t, admin_passwd_exec_t, sysadm_passwd_t)
Chris PeBenito 849380
Chris PeBenito 849380
# Inherit and use descriptors from login.
Chris PeBenito 849380
ifdef(`gnome-pty-helper.te', `allow sysadm_passwd_t gphdomain:fd use;')
Chris PeBenito 849380
Chris PeBenito 849380
# allow checking if a shell is executable
Chris PeBenito 849380
allow sysadm_passwd_t shell_exec_t:file execute;
Chris PeBenito 849380
Chris PeBenito 849380
# Update /etc/shadow and /etc/passwd
Chris PeBenito 849380
allow sysadm_passwd_t { etc_t shadow_t }:file { relabelfrom relabelto };
Chris PeBenito 849380
Chris PeBenito a08248
ifdef(`targeted_policy', `
Chris PeBenito a08248
role system_r types sysadm_passwd_t;
Chris PeBenito a08248
allow sysadm_passwd_t devpts_t:chr_file rw_file_perms;
Chris PeBenito a08248
')
Chris PeBenito 849380
') dnl endif TODO
Chris PeBenito 849380
Chris PeBenito 849380
########################################
Chris PeBenito 849380
#
Chris PeBenito 849380
# Useradd local policy
Chris PeBenito 849380
#
Chris PeBenito 849380
Chris PeBenito 849380
allow useradd_t self:capability { dac_override chown kill fowner fsetid setuid sys_resource };
Chris PeBenito 9d3bdc
allow useradd_t self:process ~{ ptrace setcurrent setexec setfscreate setrlimit execmem execstack execheap };
Chris PeBenito 849380
allow useradd_t self:process setfscreate;
Chris PeBenito 849380
allow useradd_t self:fd use;
Chris PeBenito dc67f7
allow useradd_t self:fifo_file rw_file_perms;
Chris PeBenito dc67f7
allow useradd_t self:unix_dgram_socket create_socket_perms;
Chris PeBenito dc67f7
allow useradd_t self:unix_stream_socket create_stream_socket_perms;
Chris PeBenito 849380
allow useradd_t self:unix_dgram_socket sendto;
Chris PeBenito 849380
allow useradd_t self:unix_stream_socket connectto;
Chris PeBenito dc67f7
allow useradd_t self:shm create_shm_perms;
Chris PeBenito dc67f7
allow useradd_t self:sem create_sem_perms;
Chris PeBenito dc67f7
allow useradd_t self:msgq create_msgq_perms;
Chris PeBenito 849380
allow useradd_t self:msg { send receive };
Chris PeBenito 849380
Chris PeBenito 849380
# Allow access to context for shadow file
Chris PeBenito 5e0da6
selinux_get_fs_mount(useradd_t)
Chris PeBenito 5e0da6
selinux_validate_context(useradd_t)
Chris PeBenito 5e0da6
selinux_compute_access_vector(useradd_t)
Chris PeBenito 5e0da6
selinux_compute_create_context(useradd_t)
Chris PeBenito 5e0da6
selinux_compute_relabel_context(useradd_t)
Chris PeBenito 5e0da6
selinux_compute_user_contexts(useradd_t)
Chris PeBenito 849380
# for getting the number of groups
Chris PeBenito 849380
kernel_read_kernel_sysctl(useradd_t)
Chris PeBenito 849380
Chris PeBenito ab940a
fs_search_auto_mountpoints(useradd_t)
Chris PeBenito 0fd9dc
fs_getattr_xattr_fs(useradd_t)
Chris PeBenito 849380
Chris PeBenito 0fd9dc
term_use_all_user_ttys(useradd_t)
Chris PeBenito 0fd9dc
term_use_all_user_ptys(useradd_t)
Chris PeBenito 849380
Chris PeBenito ab940a
auth_manage_shadow(useradd_t)
Chris PeBenito ab940a
auth_rw_lastlog(useradd_t)
Chris PeBenito ab940a
Chris PeBenito ab940a
corecmd_exec_shell(useradd_t)
Chris PeBenito ab940a
# Execute /usr/bin/{passwd,chfn,chsh} and /usr/sbin/{useradd,vipw}.
Chris PeBenito ab940a
corecmd_exec_bin(useradd_t)
Chris PeBenito ab940a
corecmd_exec_sbin(useradd_t)
Chris PeBenito 849380
Chris PeBenito c9428d
domain_use_wide_inherit_fd(useradd_t)
Chris PeBenito 849380
Chris PeBenito 8fd367
files_manage_etc_files(useradd_t)
Chris PeBenito a08248
files_search_var_lib(useradd_t)
Chris PeBenito 849380
Chris PeBenito ab940a
init_use_fd(useradd_t)
Chris PeBenito ab940a
init_rw_script_pid(useradd_t)
Chris PeBenito ab940a
Chris PeBenito c9428d
libs_use_ld_so(useradd_t)
Chris PeBenito c9428d
libs_use_shared_libs(useradd_t)
Chris PeBenito 849380
Chris PeBenito ab940a
logging_send_syslog_msg(useradd_t)
Chris PeBenito 849380
Chris PeBenito 849380
miscfiles_read_localization(useradd_t)
Chris PeBenito 849380
Chris PeBenito 5e0da6
seutil_read_config(useradd_t)
Chris PeBenito 605ba2
seutil_read_file_contexts(useradd_t)
Chris PeBenito 849380
Chris PeBenito ab940a
userdom_use_unpriv_users_fd(useradd_t)
Chris PeBenito 3774e4
# for when /root is the cwd
Chris PeBenito 3774e4
userdom_dontaudit_search_sysadm_home_dir(useradd_t)
Chris PeBenito 3774e4
# Add/remove user home directories
Chris PeBenito 3774e4
userdom_create_user_home_dir(useradd_t)
Chris PeBenito 3774e4
userdom_manage_user_home_dir(useradd_t)
Chris PeBenito 3774e4
userdom_create_user_home(useradd_t,notdevfile_class_set)
Chris PeBenito 849380
Chris PeBenito ab940a
mta_manage_spool(useradd_t)
Chris PeBenito 849380
Chris PeBenito ab940a
optional_policy(`nis.te',`
Chris PeBenito ab940a
	nis_use_ypbind(useradd_t)
Chris PeBenito 849380
')
Chris PeBenito 849380
Chris PeBenito 493d6c
optional_policy(`nscd.te',`
Chris PeBenito 493d6c
	nscd_use_socket(useradd_t)
Chris PeBenito 493d6c
')
Chris PeBenito 493d6c
Chris PeBenito b24f35
optional_policy(`rpm.te',`
Chris PeBenito b24f35
	rpm_use_fd(useradd_t)
Chris PeBenito b24f35
	rpm_rw_pipe(useradd_t)
Chris PeBenito b24f35
')
Chris PeBenito b24f35
Chris PeBenito ab940a
ifdef(`TODO',`
Chris PeBenito 849380
# Update /etc/shadow and /etc/passwd
Chris PeBenito 849380
allow useradd_t { etc_t shadow_t }:file { relabelfrom relabelto };
Chris PeBenito 849380
Chris PeBenito 849380
# Access terminals.
Chris PeBenito 849380
ifdef(`gnome-pty-helper.te', `allow useradd_t gphdomain:fd use;')
Chris PeBenito 849380
Chris PeBenito 849380
# /var/mail is a link to /var/spool/mail
Chris PeBenito 849380
allow useradd_t mail_spool_t:lnk_file read;
Chris PeBenito 849380
') dnl end TODO