selinux-policy/refpolicy/policy/modules/system/authlogin.if

228 lines
6.4 KiB
Plaintext
Raw Normal View History

2005-04-20 19:07:16 +00:00
# Copyright (C) 2005 Tresys Technology, LLC
#######################################
#
# Per user domain template for this module
#
# authlogin_per_userdomain_template(userdomain_prefix)
#
define(`authlogin_per_userdomain_template',`
requires_block_template(authlogin_per_userdomain_template_depend)
type $1_chkpwd_t; # , nscd_client_domain;
domain_make_domain($1_chkpwd_t)
domain_make_entrypoint_file($1_chkpwd_t,chkpwd_exec_t)
role $1_r types $1_chkpwd_t;
role $1_r types system_chkpwd_t;
# Use capabilities.
allow $1_chkpwd_t self:capability setuid;
authlogin_read_shadow_passwords($1_chkpwd_t)
logging_send_system_log_message($1_chkpwd_t)
libraries_use_dynamic_loader($1_chkpwd_t)
libraries_read_shared_libraries($1_chkpwd_t)
files_read_general_system_config($1_chkpwd_t)
miscfiles_read_localization($1_chkpwd_t)
selinux_read_config($1_chkpwd_t)
filesystem_ignore_get_persistent_filesystem_attributes($1_chkpwd_t)
# is_selinux_enabled
kernel_read_system_state($1_chkpwd_t)
#can_getcon($1_chkpwd_t)
#can_ypbind($1_chkpwd_t)
#can_kerberos($1_chkpwd_t)
#can_ldap($1_chkpwd_t)
#can_resolve($1_chkpwd_t)
# Transition from the user domain to this domain.
ifelse($1, system, `
#dontaudit $1_chkpwd_t user_tty_type:chr_file rw_file_perms;
terminal_use_general_physical_terminal($1_chkpwd_t)
', `
# Transition from the user domain to this domain.
allow $1_t chkpwd_exec_t:file { getattr read execute };
allow $1_t $1_chkpwd_t:process transition;
#allow $1_t sbin_t:dir search;
# Write to the user domain tty.
#userdomain_use_$1_terminal($1_chkpwd_t)
#userdomain_use_$1_pty($1_chkpwd_t)
domain_use_widely_inheritable_file_descriptors($1_chkpwd_t)
# Inherit and use descriptors from gnome-pty-helper.
#ifdef(`gnome-pty-helper.te',`allow $1_chkpwd_t $1_gph_t:fd use;')
optional_policy(`selinux.te',`
selinux_newrole_use_file_descriptors($1_chkpwd_t)
')
') dnl ifelse system
# for nscd
dontaudit $1_chkpwd_t var_t:dir search;
')
define(`authlogin_per_userdomain_template_depend',`
type chkpwd_exec_t, system_chkpwd_t;
class file { getattr read execute };
class process transition;
class capability setuid;
class unix_stream_socket { create read getattr write setattr append bind connect getopt setopt shutdown };
class unix_dgram_socket { create read getattr write setattr append bind connect getopt setopt shutdown };
')
2005-04-28 19:50:58 +00:00
#######################################
#
# authlogin_make_login_program_entrypoint(domain)
2005-04-28 19:50:58 +00:00
#
define(`authlogin_make_login_program_entrypoint',`
requires_block_template(authlogin_make_login_program_entrypoint_depend)
2005-04-28 19:50:58 +00:00
domain_make_entrypoint_file($1,login_exec_t)
')
define(`authlogin_make_login_program_entrypoint_depend',`
type login_exec_t;
domain_make_entrypoint_file_depend
')
#######################################
#
# authlogin_check_password_transition(domain)
#
define(`authlogin_check_password_transition',`
requires_block_template(authlogin_check_password_transition_depend)
allow $1 chkpwd_exec_t:file { getattr read execute };
allow $1 system_chkpwd_t:process transition;
dontaudit $1 shadow_t:file { getattr read };
#allow auth_chkpwd sbin_t:dir search;
#can_ypbind(auth_chkpwd)
#can_kerberos(auth_chkpwd)
#can_ldap(auth_chkpwd)
#can_resolve(auth_chkpwd)
')
define(`authlogin_check_password_transition_depend',`
type system_chkpwd_t, chkpwd_exec_t, shadow_t;
class file { getattr read execute };
class process transition;
')
2005-04-14 20:18:17 +00:00
#######################################
#
# authlogin_modify_login_records(domain)
2005-04-14 20:18:17 +00:00
#
define(`authlogin_modify_login_records',`
requires_block_template(authlogin_modify_login_records_depend)
files_search_system_state_data_directory($1)
# FIXME: search var_log_t
2005-04-14 20:18:17 +00:00
allow $1 wtmp_t:file { getattr read write setattr };
')
define(`authlogin_modify_login_records_depend',`
type wtmp_t;
class file { getattr read write setattr };
')
#######################################
#
# authlogin_read_shadow_passwords(domain)
#
define(`authlogin_read_shadow_passwords',`
requires_block_template(authlogin_read_shadow_passwords_depend)
# FIXME: read etc_t dir
allow $1 shadow_t:file { getattr read };
typeattribute $1 can_read_shadow_passwords;
')
define(`authlogin_read_shadow_passwords_depend',`
attribute can_read_shadow_passwords;
type shadow_t;
class file { getattr read };
')
#######################################
#
# authlogin_ignore_read_shadow_passwords(domain)
#
define(`authlogin_ignore_read_shadow_passwords',`
requires_block_template(authlogin_ignore_read_shadow_passwords_depend)
dontaudit $1 shadow_t:file { getattr read };
')
define(`authlogin_ignore_read_shadow_passwords_depend',`
type shadow_t;
class file { getattr read };
')
#######################################
#
# authlogin_modify_shadow_passwords(domain)
#
define(`authlogin_modify_shadow_passwords',`
requires_block_template(authlogin_modify_shadow_passwords_depend)
# FIXME: read etc_t dir
allow $1 shadow_t:file { getattr read write };
typeattribute $1 can_read_shadow_passwords;
typeattribute $1 can_write_shadow_passwords;
')
define(`authlogin_modify_shadow_passwords_depend',`
attribute can_read_shadow_passwords;
attribute can_write_shadow_passwords;
type shadow_t;
class file { getattr read write };
')
2005-04-14 20:18:17 +00:00
#######################################
#
# authlogin_modify_last_login_log(domain)
2005-04-14 20:18:17 +00:00
#
define(`authlogin_modify_last_login_log',`
requires_block_template(authlogin_modify_last_login_log_depend)
2005-04-14 20:18:17 +00:00
allow $1 lastlog_t:file { getattr read write setattr };
')
define(`authlogin_modify_last_login_log_depend',`
type lastlog_t;
class file { getattr read write setattr };
')
#######################################
#
# authlogin_pam_read_runtime_data(domain)
#
define(`authlogin_pam_read_runtime_data',`
requires_block_template(authlogin_pam_read_runtime_data_depend)
files_search_system_state_data_directory($1)
files_search_runtime_data_directory($1)
allow $1 pam_var_run_t:dir { getattr search read };
allow $1 pam_var_run_t:file { getattr read };
')
define(`authlogin_pam_read_runtime_data_depend',`
type pam_var_run_t;
class dir { getattr search read };
class file { getattr read };
')
#######################################
#
# authlogin_pam_remove_runtime_data(domain)
#
define(`authlogin_pam_remove_runtime_data',`
requires_block_template(authlogin_pam_remove_runtime_data_depend)
files_search_system_state_data_directory($1)
files_search_runtime_data_directory($1)
allow $1 pam_var_run_t:dir { getattr search read write remove_name };
allow $1 pam_var_run_t:file { getattr unlink };
')
define(`authlogin_pam_remove_runtime_data_depend',`
type pam_var_run_t;
class dir { getattr search read write remove_name };
class file { getattr unlink };
')