Chris PeBenito e181fe
# Copyright (C) 2005 Tresys Technology, LLC
Chris PeBenito e181fe
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito c4890e
# Per user domain template for this module
Chris PeBenito c4890e
#
Chris PeBenito c4890e
# authlogin_per_userdomain_template(userdomain_prefix)
Chris PeBenito c4890e
#
Chris PeBenito c4890e
define(`authlogin_per_userdomain_template',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito c4890e
Chris PeBenito c4890e
type $1_chkpwd_t;     # , nscd_client_domain;
Chris PeBenito c4890e
domain_make_domain($1_chkpwd_t)
Chris PeBenito c4890e
domain_make_entrypoint_file($1_chkpwd_t,chkpwd_exec_t)
Chris PeBenito c4890e
role $1_r types $1_chkpwd_t;
Chris PeBenito c4890e
role $1_r types system_chkpwd_t;
Chris PeBenito c4890e
Chris PeBenito c4890e
# Use capabilities.
Chris PeBenito c4890e
allow $1_chkpwd_t self:capability setuid;
Chris PeBenito c4890e
Chris PeBenito c4890e
authlogin_read_shadow_passwords($1_chkpwd_t)
Chris PeBenito c4890e
logging_send_system_log_message($1_chkpwd_t)
Chris PeBenito c4890e
Chris PeBenito c4890e
libraries_use_dynamic_loader($1_chkpwd_t)
Chris PeBenito c4890e
libraries_read_shared_libraries($1_chkpwd_t)
Chris PeBenito c4890e
files_read_general_system_config($1_chkpwd_t)
Chris PeBenito c4890e
miscfiles_read_localization($1_chkpwd_t)
Chris PeBenito c4890e
selinux_read_config($1_chkpwd_t)
Chris PeBenito 219bcf
filesystem_ignore_get_persistent_filesystem_attributes($1_chkpwd_t)
Chris PeBenito c4890e
Chris PeBenito c4890e
# is_selinux_enabled
Chris PeBenito c4890e
kernel_read_system_state($1_chkpwd_t)
Chris PeBenito c4890e
#can_getcon($1_chkpwd_t)
Chris PeBenito c4890e
#can_ypbind($1_chkpwd_t)
Chris PeBenito c4890e
#can_kerberos($1_chkpwd_t)
Chris PeBenito c4890e
#can_ldap($1_chkpwd_t)
Chris PeBenito c4890e
#can_resolve($1_chkpwd_t)
Chris PeBenito c4890e
Chris PeBenito c4890e
# Transition from the user domain to this domain.
Chris PeBenito 3ce6cb
ifelse($1, system, `
Chris PeBenito 3ce6cb
#dontaudit $1_chkpwd_t user_tty_type:chr_file rw_file_perms;
Chris PeBenito 3ce6cb
terminal_use_general_physical_terminal($1_chkpwd_t)
Chris PeBenito 3ce6cb
', `
Chris PeBenito c4890e
# Transition from the user domain to this domain.
Chris PeBenito c4890e
allow $1_t chkpwd_exec_t:file { getattr read execute };
Chris PeBenito c4890e
allow $1_t $1_chkpwd_t:process transition;
Chris PeBenito c4890e
Chris PeBenito c4890e
#allow $1_t sbin_t:dir search;
Chris PeBenito c4890e
Chris PeBenito c4890e
# Write to the user domain tty.
Chris PeBenito c4890e
#userdomain_use_$1_terminal($1_chkpwd_t)
Chris PeBenito c4890e
#userdomain_use_$1_pty($1_chkpwd_t)
Chris PeBenito c4890e
Chris PeBenito 07d6e3
domain_use_widely_inheritable_file_descriptors($1_chkpwd_t)
Chris PeBenito c4890e
Chris PeBenito c4890e
# Inherit and use descriptors from gnome-pty-helper.
Chris PeBenito c4890e
#ifdef(`gnome-pty-helper.te',`allow $1_chkpwd_t $1_gph_t:fd use;')
Chris PeBenito c4890e
Chris PeBenito 07d6e3
optional_policy(`selinux.te',`
Chris PeBenito 07d6e3
selinux_newrole_use_file_descriptors($1_chkpwd_t)
Chris PeBenito 07d6e3
')
Chris PeBenito c4890e
') dnl ifelse system
Chris PeBenito c4890e
Chris PeBenito c4890e
# for nscd
Chris PeBenito c4890e
dontaudit $1_chkpwd_t var_t:dir search;
Chris PeBenito c4890e
')
Chris PeBenito c4890e
Chris PeBenito c4890e
define(`authlogin_per_userdomain_template_depend',`
Chris PeBenito c4890e
type chkpwd_exec_t, system_chkpwd_t;
Chris PeBenito c4890e
class file { getattr read execute };
Chris PeBenito c4890e
class process transition;
Chris PeBenito c4890e
class capability setuid;
Chris PeBenito c4890e
class unix_stream_socket { create read getattr write setattr append bind connect getopt setopt shutdown };
Chris PeBenito c4890e
class unix_dgram_socket { create read getattr write setattr append bind connect getopt setopt shutdown };
Chris PeBenito c4890e
')
Chris PeBenito c4890e
Chris PeBenito c4890e
#######################################
Chris PeBenito c4890e
#
Chris PeBenito dfaf6c
# authlogin_make_login_program_entrypoint(domain)
Chris PeBenito 07efe9
#
Chris PeBenito 07efe9
define(`authlogin_make_login_program_entrypoint',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 07efe9
domain_make_entrypoint_file($1,login_exec_t)
Chris PeBenito 07efe9
')
Chris PeBenito 07efe9
Chris PeBenito 07efe9
define(`authlogin_make_login_program_entrypoint_depend',`
Chris PeBenito 07efe9
type login_exec_t;
Chris PeBenito 07efe9
domain_make_entrypoint_file_depend
Chris PeBenito 07efe9
')
Chris PeBenito 07efe9
Chris PeBenito 07efe9
#######################################
Chris PeBenito 07efe9
#
Chris PeBenito dfaf6c
# authlogin_check_password_transition(domain)
Chris PeBenito c4890e
#
Chris PeBenito c4890e
define(`authlogin_check_password_transition',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito c4890e
allow $1 chkpwd_exec_t:file { getattr read execute };
Chris PeBenito c4890e
allow $1 system_chkpwd_t:process transition;
Chris PeBenito c4890e
dontaudit $1 shadow_t:file { getattr read };
Chris PeBenito c4890e
#allow auth_chkpwd sbin_t:dir search;
Chris PeBenito c4890e
#can_ypbind(auth_chkpwd)
Chris PeBenito c4890e
#can_kerberos(auth_chkpwd)
Chris PeBenito c4890e
#can_ldap(auth_chkpwd)
Chris PeBenito c4890e
#can_resolve(auth_chkpwd)
Chris PeBenito c4890e
')
Chris PeBenito c4890e
Chris PeBenito c4890e
define(`authlogin_check_password_transition_depend',`
Chris PeBenito c4890e
type system_chkpwd_t, chkpwd_exec_t, shadow_t;
Chris PeBenito c4890e
class file { getattr read execute };
Chris PeBenito c4890e
class process transition;
Chris PeBenito c4890e
')
Chris PeBenito c4890e
Chris PeBenito c4890e
#######################################
Chris PeBenito c4890e
#
Chris PeBenito dfaf6c
# authlogin_modify_login_records(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`authlogin_modify_login_records',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 1e5c2a
logging_search_system_log_directory($1)
Chris PeBenito b4cd15
allow $1 wtmp_t:file { getattr read write setattr };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`authlogin_modify_login_records_depend',`
Chris PeBenito b4cd15
type wtmp_t;
Chris PeBenito b4cd15
class file { getattr read write setattr };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
#######################################
Chris PeBenito b4cd15
#
Chris PeBenito dfaf6c
# authlogin_read_shadow_passwords(domain)
Chris PeBenito c4890e
#
Chris PeBenito c4890e
define(`authlogin_read_shadow_passwords',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 3ce6cb
# FIXME: read etc_t dir
Chris PeBenito c4890e
allow $1 shadow_t:file { getattr read };
Chris PeBenito c4890e
typeattribute $1 can_read_shadow_passwords;
Chris PeBenito c4890e
')
Chris PeBenito c4890e
Chris PeBenito c4890e
define(`authlogin_read_shadow_passwords_depend',`
Chris PeBenito c4890e
attribute can_read_shadow_passwords;
Chris PeBenito c4890e
type shadow_t;
Chris PeBenito c4890e
class file { getattr read };
Chris PeBenito c4890e
')
Chris PeBenito c4890e
Chris PeBenito c4890e
#######################################
Chris PeBenito c4890e
#
Chris PeBenito dfaf6c
# authlogin_ignore_read_shadow_passwords(domain)
Chris PeBenito c4890e
#
Chris PeBenito c4890e
define(`authlogin_ignore_read_shadow_passwords',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito c4890e
dontaudit $1 shadow_t:file { getattr read };
Chris PeBenito c4890e
')
Chris PeBenito c4890e
Chris PeBenito c4890e
define(`authlogin_ignore_read_shadow_passwords_depend',`
Chris PeBenito c4890e
type shadow_t;
Chris PeBenito c4890e
class file { getattr read };
Chris PeBenito c4890e
')
Chris PeBenito c4890e
Chris PeBenito c4890e
#######################################
Chris PeBenito c4890e
#
Chris PeBenito dfaf6c
# authlogin_modify_shadow_passwords(domain)
Chris PeBenito c4890e
#
Chris PeBenito c4890e
define(`authlogin_modify_shadow_passwords',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 3ce6cb
# FIXME: read etc_t dir
Chris PeBenito c4890e
allow $1 shadow_t:file { getattr read write };
Chris PeBenito c4890e
typeattribute $1 can_read_shadow_passwords;
Chris PeBenito c4890e
typeattribute $1 can_write_shadow_passwords;
Chris PeBenito c4890e
')
Chris PeBenito c4890e
Chris PeBenito c4890e
define(`authlogin_modify_shadow_passwords_depend',`
Chris PeBenito c4890e
attribute can_read_shadow_passwords;
Chris PeBenito c4890e
attribute can_write_shadow_passwords;
Chris PeBenito c4890e
type shadow_t;
Chris PeBenito c4890e
class file { getattr read write };
Chris PeBenito c4890e
')
Chris PeBenito c4890e
Chris PeBenito c4890e
#######################################
Chris PeBenito c4890e
#
Chris PeBenito dfaf6c
# authlogin_modify_last_login_log(domain)
Chris PeBenito b4cd15
#
Chris PeBenito b4cd15
define(`authlogin_modify_last_login_log',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito b4cd15
allow $1 lastlog_t:file { getattr read write setattr };
Chris PeBenito b4cd15
')
Chris PeBenito b4cd15
Chris PeBenito b4cd15
define(`authlogin_modify_last_login_log_depend',`
Chris PeBenito b4cd15
type lastlog_t;
Chris PeBenito b4cd15
class file { getattr read write setattr };
Chris PeBenito b4cd15
')
Chris PeBenito dfaf6c
Chris PeBenito dfaf6c
#######################################
Chris PeBenito dfaf6c
#
Chris PeBenito 1e5c2a
# authlogin_pam_transition(domain)
Chris PeBenito 1e5c2a
#
Chris PeBenito 1e5c2a
define(`authlogin_pam_transition',`
Chris PeBenito 1e5c2a
requires_block_template(`$0'_depend)
Chris PeBenito 1e5c2a
allow $1 pam_exec_t:file { getattr read execute };
Chris PeBenito 1e5c2a
allow $1 pam_t:process transition;
Chris PeBenito 1e5c2a
type_transition $1 pam_exec_t:file pam_t;
Chris PeBenito 1e5c2a
dontaudit $1 pam_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
define(`authlogin_pam_transition_depend',`
Chris PeBenito 1e5c2a
type pam_t, pam_exec_t;
Chris PeBenito 1e5c2a
class file { getattr read execute };
Chris PeBenito 1e5c2a
class process { transition noatsecure siginh rlimitinh };
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
#######################################
Chris PeBenito 1e5c2a
#
Chris PeBenito 1e5c2a
# authlogin_pam_execute(domain)
Chris PeBenito 1e5c2a
#
Chris PeBenito 1e5c2a
define(`authlogin_pam_execute',`
Chris PeBenito 1e5c2a
requires_block_template(`$0'_depend)
Chris PeBenito 1e5c2a
allow $1 pam_exec_t:file { getattr read execute execute_no_trans };
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
define(`authlogin_pam_execute_depend',`
Chris PeBenito 1e5c2a
type pam_exec_t;
Chris PeBenito 1e5c2a
class file { getattr read execute execute_no_trans };
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
#######################################
Chris PeBenito 1e5c2a
#
Chris PeBenito 3ce6cb
# authlogin_pam_read_runtime_data(domain)
Chris PeBenito dfaf6c
#
Chris PeBenito 3ce6cb
define(`authlogin_pam_read_runtime_data',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 3ce6cb
files_search_system_state_data_directory($1)
Chris PeBenito 3ce6cb
files_search_runtime_data_directory($1)
Chris PeBenito 3ce6cb
allow $1 pam_var_run_t:dir { getattr search read };
Chris PeBenito dfaf6c
allow $1 pam_var_run_t:file { getattr read };
Chris PeBenito dfaf6c
')
Chris PeBenito dfaf6c
Chris PeBenito 3ce6cb
define(`authlogin_pam_read_runtime_data_depend',`
Chris PeBenito 3ce6cb
type pam_var_run_t;
Chris PeBenito 3ce6cb
class dir { getattr search read };
Chris PeBenito dfaf6c
class file { getattr read };
Chris PeBenito dfaf6c
')
Chris PeBenito 3ce6cb
Chris PeBenito 3ce6cb
#######################################
Chris PeBenito 3ce6cb
#
Chris PeBenito 3ce6cb
# authlogin_pam_remove_runtime_data(domain)
Chris PeBenito 3ce6cb
#
Chris PeBenito 3ce6cb
define(`authlogin_pam_remove_runtime_data',`
Chris PeBenito bd202f
requires_block_template(`$0'_depend)
Chris PeBenito 3ce6cb
files_search_system_state_data_directory($1)
Chris PeBenito 3ce6cb
files_search_runtime_data_directory($1)
Chris PeBenito 3ce6cb
allow $1 pam_var_run_t:dir { getattr search read write remove_name };
Chris PeBenito 3ce6cb
allow $1 pam_var_run_t:file { getattr unlink };
Chris PeBenito 3ce6cb
')
Chris PeBenito 3ce6cb
Chris PeBenito 3ce6cb
define(`authlogin_pam_remove_runtime_data_depend',`
Chris PeBenito 3ce6cb
type pam_var_run_t;
Chris PeBenito 3ce6cb
class dir { getattr search read write remove_name };
Chris PeBenito 3ce6cb
class file { getattr unlink };
Chris PeBenito 3ce6cb
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
#######################################
Chris PeBenito 1e5c2a
#
Chris PeBenito 1e5c2a
# authlogin_pam_console_transition(domain)
Chris PeBenito 1e5c2a
#
Chris PeBenito 1e5c2a
define(`authlogin_pam_console_transition',`
Chris PeBenito 1e5c2a
requires_block_template(`$0'_depend)
Chris PeBenito 1e5c2a
allow $1 pam_console_exec_t:file { getattr read execute };
Chris PeBenito 1e5c2a
allow $1 pam_console_t:process transition;
Chris PeBenito 1e5c2a
type_transition $1 pam_console_exec_t:file pam_console_t;
Chris PeBenito 1e5c2a
dontaudit $1 pam_console_t:process { noatsecure siginh rlimitinh };
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
define(`authlogin_pam_console_transition_depend',`
Chris PeBenito 1e5c2a
type pam_console_t, pam_console_exec_t;
Chris PeBenito 1e5c2a
class file { getattr read execute };
Chris PeBenito 1e5c2a
class process { transition noatsecure siginh rlimitinh };
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
#######################################
Chris PeBenito 1e5c2a
#
Chris PeBenito 1e5c2a
# authlogin_pam_console_read_runtime_data(domain)
Chris PeBenito 1e5c2a
#
Chris PeBenito 1e5c2a
define(`authlogin_pam_console_read_runtime_data',`
Chris PeBenito 1e5c2a
requires_block_template(`$0'_depend)
Chris PeBenito 1e5c2a
files_search_system_state_data_directory($1)
Chris PeBenito 1e5c2a
files_search_runtime_data_directory($1)
Chris PeBenito 1e5c2a
allow $1 pam_var_console_t:dir { getattr search read };
Chris PeBenito 1e5c2a
allow $1 pam_var_console_t:file { getattr read };
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
define(`authlogin_pam_console_read_runtime_data_depend',`
Chris PeBenito 1e5c2a
type pam_var_console_t;
Chris PeBenito 1e5c2a
class dir { getattr search read };
Chris PeBenito 1e5c2a
class file { getattr read };
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
#######################################
Chris PeBenito 1e5c2a
#
Chris PeBenito 1e5c2a
# authlogin_pam_console_manage_runtime_data(domain)
Chris PeBenito 1e5c2a
#
Chris PeBenito 1e5c2a
define(`authlogin_pam_console_manage_runtime_data',`
Chris PeBenito 1e5c2a
requires_block_template(`$0'_depend)
Chris PeBenito 1e5c2a
files_search_system_state_data_directory($1)
Chris PeBenito 1e5c2a
files_search_runtime_data_directory($1)
Chris PeBenito 1e5c2a
allow $1 pam_var_console_t:dir { read getattr lock search ioctl add_name remove_name write };
Chris PeBenito 1e5c2a
allow $1 pam_var_console_t:file { create ioctl read getattr lock write setattr append link unlink rename };
Chris PeBenito 1e5c2a
allow $1 pam_var_console_t:lnk_file { create read getattr setattr link unlink rename };
Chris PeBenito 1e5c2a
')
Chris PeBenito 1e5c2a
Chris PeBenito 1e5c2a
define(`authlogin_pam_console_manage_runtime_data_depend',`
Chris PeBenito 1e5c2a
type pam_var_console_t;
Chris PeBenito 1e5c2a
class dir { read getattr lock search ioctl add_name remove_name write };
Chris PeBenito 1e5c2a
class file { create ioctl read getattr lock write setattr append link unlink rename };
Chris PeBenito 1e5c2a
class lnk_file { create read getattr setattr link unlink rename };
Chris PeBenito 1e5c2a
')