2005-05-24 15:55:57 +00:00
|
|
|
## <summary>Common policy for authentication and user login.</summary>
|
2005-04-20 19:07:16 +00:00
|
|
|
|
2005-04-19 20:45:54 +00:00
|
|
|
#######################################
|
2005-06-24 20:37:09 +00:00
|
|
|
## <summary>
|
2005-12-08 17:42:08 +00:00
|
|
|
## Common template to create a domain for authentication.
|
2005-06-24 20:37:09 +00:00
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## This template creates a derived domain which is allowed
|
|
|
|
## to authenticate users by using PAM unix_chkpwd support.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
## <param name="userdomain_prefix">
|
|
|
|
## The prefix of the user domain (e.g., user
|
|
|
|
## is the prefix for user_t).
|
|
|
|
## </param>
|
2005-04-19 20:45:54 +00:00
|
|
|
#
|
2005-12-08 17:42:08 +00:00
|
|
|
template(`authlogin_common_auth_domain_template',`
|
2005-06-22 16:07:14 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute can_read_shadow_passwords;
|
2005-12-08 17:42:08 +00:00
|
|
|
type chkpwd_exec_t, shadow_t;
|
2005-06-22 16:07:14 +00:00
|
|
|
')
|
2005-04-19 20:45:54 +00:00
|
|
|
|
2005-07-13 20:48:51 +00:00
|
|
|
type $1_chkpwd_t, can_read_shadow_passwords;
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_type($1_chkpwd_t)
|
|
|
|
domain_entry_file($1_chkpwd_t,chkpwd_exec_t)
|
2005-04-19 20:45:54 +00:00
|
|
|
|
2005-09-16 19:36:10 +00:00
|
|
|
allow $1_chkpwd_t self:capability { audit_write audit_control setuid };
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1_chkpwd_t self:process getattr;
|
2005-04-19 20:45:54 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
files_list_etc($1_chkpwd_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1_chkpwd_t shadow_t:file { getattr read };
|
2005-05-09 21:06:51 +00:00
|
|
|
|
2005-06-03 12:25:14 +00:00
|
|
|
# is_selinux_enabled
|
|
|
|
kernel_read_system_state($1_chkpwd_t)
|
2005-05-09 21:06:51 +00:00
|
|
|
|
2005-09-16 19:36:10 +00:00
|
|
|
dev_read_rand($1_chkpwd_t)
|
|
|
|
dev_read_urand($1_chkpwd_t)
|
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
fs_dontaudit_getattr_xattr_fs($1_chkpwd_t)
|
2005-05-09 21:06:51 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
libs_use_ld_so($1_chkpwd_t)
|
|
|
|
libs_use_shared_libs($1_chkpwd_t)
|
2005-05-09 21:06:51 +00:00
|
|
|
|
2005-06-29 14:26:41 +00:00
|
|
|
files_read_etc_files($1_chkpwd_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
# for nscd
|
2005-06-13 17:35:46 +00:00
|
|
|
files_dontaudit_search_var($1_chkpwd_t)
|
2005-05-09 21:06:51 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_send_syslog_msg($1_chkpwd_t)
|
2005-05-09 21:06:51 +00:00
|
|
|
|
2005-10-21 15:38:22 +00:00
|
|
|
miscfiles_read_certs($1_chkpwd_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
miscfiles_read_localization($1_chkpwd_t)
|
2005-05-09 21:06:51 +00:00
|
|
|
|
2005-06-14 20:48:34 +00:00
|
|
|
seutil_read_config($1_chkpwd_t)
|
2005-04-19 20:45:54 +00:00
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
sysnet_dns_name_resolve($1_chkpwd_t)
|
2005-09-16 19:36:10 +00:00
|
|
|
sysnet_use_ldap($1_chkpwd_t)
|
2005-04-19 20:45:54 +00:00
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`kerberos',`
|
2005-07-01 13:31:34 +00:00
|
|
|
kerberos_use($1_chkpwd_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nis',`
|
2005-06-27 16:30:55 +00:00
|
|
|
nis_use_ypbind($1_chkpwd_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nscd',`
|
2005-07-13 20:48:51 +00:00
|
|
|
nscd_use_socket($1_chkpwd_t)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`samba',`
|
2005-10-24 19:50:21 +00:00
|
|
|
samba_connect_winbind($1_chkpwd_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
')
|
2005-12-08 17:42:08 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## The per user domain template for the authlogin module.
|
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## This template creates a derived domain which is allowed
|
|
|
|
## to authenticate users by using PAM unix_chkpwd support.
|
|
|
|
## This domain will be used by any programs running in the
|
|
|
|
## user domain which use PAM to authenticate.
|
|
|
|
## </p>
|
|
|
|
## <p>
|
|
|
|
## This template is invoked automatically for each user, and
|
|
|
|
## generally does not need to be invoked directly
|
|
|
|
## by policy writers.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
## <param name="userdomain_prefix">
|
|
|
|
## The prefix of the user domain (e.g., user
|
|
|
|
## is the prefix for user_t).
|
|
|
|
## </param>
|
|
|
|
## <param name="user_domain">
|
|
|
|
## The type of the user domain.
|
|
|
|
## </param>
|
|
|
|
## <param name="user_role">
|
|
|
|
## The role associated with the user domain.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
template(`authlogin_per_userdomain_template',`
|
2005-09-16 19:36:10 +00:00
|
|
|
|
2005-12-08 17:42:08 +00:00
|
|
|
gen_require(`
|
|
|
|
type system_chkpwd_t, shadow_t;
|
2005-09-16 19:36:10 +00:00
|
|
|
')
|
2005-12-08 17:42:08 +00:00
|
|
|
|
|
|
|
authlogin_common_auth_domain_template($1)
|
|
|
|
|
|
|
|
role $3 types $1_chkpwd_t;
|
|
|
|
role $3 types system_chkpwd_t;
|
|
|
|
|
|
|
|
allow $2 self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
|
|
|
|
|
|
|
|
dontaudit $2 shadow_t:file { getattr read };
|
|
|
|
|
|
|
|
# Transition from the user domain to this domain.
|
|
|
|
domain_auto_trans($2,chkpwd_exec_t,$1_chkpwd_t)
|
|
|
|
allow $1_chkpwd_t $2:fd use;
|
|
|
|
allow $2 $1_chkpwd_t:fd use;
|
|
|
|
allow $1_chkpwd_t $2:fifo_file rw_file_perms;
|
|
|
|
allow $1_chkpwd_t $2:process sigchld;
|
|
|
|
|
|
|
|
domain_use_wide_inherit_fd($1_chkpwd_t)
|
|
|
|
|
|
|
|
seutil_use_newrole_fd($1_chkpwd_t)
|
|
|
|
|
|
|
|
# Write to the user domain tty.
|
|
|
|
userdom_use_user_terminals($1,$1_chkpwd_t)
|
2005-07-01 13:31:34 +00:00
|
|
|
')
|
2005-04-19 20:45:54 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
########################################
|
2005-08-25 20:27:20 +00:00
|
|
|
## <summary>
|
|
|
|
## Run unix_chkpwd to check a password
|
|
|
|
## for a user domain.
|
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Run unix_chkpwd to check a password
|
|
|
|
## for a user domain.
|
|
|
|
## </p>
|
|
|
|
## <p>
|
|
|
|
## This is a templated interface, and should only
|
|
|
|
## be called from a per-userdomain template.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
## <param name="userdomain_prefix">
|
|
|
|
## The prefix of the user domain (e.g., user
|
|
|
|
## is the prefix for user_t).
|
|
|
|
## </param>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
template(`auth_domtrans_user_chk_passwd',`
|
2005-10-25 14:31:53 +00:00
|
|
|
ifdef(`targeted_policy',`
|
|
|
|
gen_require(`
|
2005-12-02 22:06:05 +00:00
|
|
|
type system_chkpwd_t, chkpwd_exec_t;
|
2005-10-25 14:31:53 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
domain_auto_trans($2,chkpwd_exec_t,system_chkpwd_t)
|
|
|
|
allow $2 system_chkpwd_t:fd use;
|
|
|
|
allow system_chkpwd_t $2:fd use;
|
|
|
|
allow system_chkpwd_t $2:fifo_file rw_file_perms;
|
|
|
|
allow system_chkpwd_t $2:process sigchld;
|
|
|
|
',`
|
2005-10-24 12:38:45 +00:00
|
|
|
gen_require(`
|
|
|
|
type chkpwd_exec_t;
|
|
|
|
')
|
|
|
|
|
2005-10-24 19:50:21 +00:00
|
|
|
corecmd_search_bin($2)
|
|
|
|
domain_auto_trans($2,chkpwd_exec_t,$1_chkpwd_t)
|
2005-10-24 12:38:45 +00:00
|
|
|
|
2005-10-24 19:50:21 +00:00
|
|
|
allow $2 $1_chkpwd_t:fd use;
|
|
|
|
allow $1_chkpwd_t $2:fd use;
|
|
|
|
allow $1_chkpwd_t $2:fifo_file rw_file_perms;
|
|
|
|
allow $1_chkpwd_t $2:process sigchld;
|
2005-08-25 20:27:20 +00:00
|
|
|
')
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Use the login program as an entry point program.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of process using the login program as entry point.
|
|
|
|
## </param>
|
2005-06-09 14:50:48 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_login_entry_type',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type login_exec_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
domain_entry_file($1,login_exec_t)
|
2005-04-28 19:50:58 +00:00
|
|
|
')
|
|
|
|
|
2005-05-24 20:45:27 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute a login_program in the target domain.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="target_domain">
|
|
|
|
## The type of the login_program process.
|
|
|
|
## </param>
|
2005-05-24 20:45:27 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_domtrans_login_program',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type login_exec_t;
|
|
|
|
class process sigchld;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-20 17:41:29 +00:00
|
|
|
corecmd_search_bin($1)
|
|
|
|
domain_auto_trans($1,login_exec_t,$2)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 $2:fd use;
|
|
|
|
allow $2 $1:fd use;
|
|
|
|
allow $2 $1:fifo_file rw_file_perms;
|
|
|
|
allow $2 $1:process sigchld;
|
2005-05-24 20:45:27 +00:00
|
|
|
')
|
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Run unix_chkpwd to check a password.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-06-09 14:50:48 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_domtrans_chk_passwd',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type system_chkpwd_t, chkpwd_exec_t, shadow_t;
|
|
|
|
class process sigchld;
|
|
|
|
class udp_socket create_socket_perms;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-20 17:41:29 +00:00
|
|
|
corecmd_search_sbin($1)
|
2005-06-08 13:12:00 +00:00
|
|
|
domain_auto_trans($1,chkpwd_exec_t,system_chkpwd_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-09-16 19:36:10 +00:00
|
|
|
allow $1 self:capability { audit_write audit_control };
|
|
|
|
allow $1 self:netlink_audit_socket { create_netlink_socket_perms nlmsg_relay };
|
|
|
|
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 system_chkpwd_t:fd use;
|
|
|
|
allow system_chkpwd_t $1:fd use;
|
|
|
|
allow system_chkpwd_t $1:fifo_file rw_file_perms;
|
|
|
|
allow system_chkpwd_t $1:process sigchld;
|
|
|
|
|
|
|
|
dontaudit $1 shadow_t:file { getattr read };
|
|
|
|
|
2005-09-16 19:36:10 +00:00
|
|
|
dev_read_rand($1)
|
|
|
|
dev_read_urand($1)
|
|
|
|
|
2005-10-21 15:38:22 +00:00
|
|
|
miscfiles_read_certs($1)
|
|
|
|
|
2005-09-15 21:03:29 +00:00
|
|
|
sysnet_dns_name_resolve($1)
|
2005-09-16 19:36:10 +00:00
|
|
|
sysnet_use_ldap($1)
|
2005-06-27 16:30:55 +00:00
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`kerberos',`
|
2005-07-01 13:31:34 +00:00
|
|
|
kerberos_use($1)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nis',`
|
2005-06-27 16:30:55 +00:00
|
|
|
nis_use_ypbind($1)
|
|
|
|
')
|
2005-09-16 19:36:10 +00:00
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`samba',`
|
2005-10-24 19:50:21 +00:00
|
|
|
samba_connect_winbind($1)
|
2005-09-16 19:36:10 +00:00
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
')
|
2005-04-19 20:45:54 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
########################################
|
2005-07-13 20:48:51 +00:00
|
|
|
## <summary>
|
|
|
|
## Get the attributes of the shadow passwords file.
|
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-06-09 14:50:48 +00:00
|
|
|
#
|
2005-07-13 20:48:51 +00:00
|
|
|
interface(`auth_getattr_shadow',`
|
|
|
|
gen_require(`
|
|
|
|
type shadow_t;
|
|
|
|
class file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_etc($1)
|
|
|
|
allow $1 shadow_t:file getattr;
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attempts to get the attributes
|
|
|
|
## of the shadow passwords file.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_dontaudit_getattr_shadow',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type shadow_t;
|
2005-07-13 20:48:51 +00:00
|
|
|
class file getattr;
|
2005-06-20 17:41:29 +00:00
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 shadow_t:file getattr;
|
2005-05-23 17:56:26 +00:00
|
|
|
')
|
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Read the shadow passwords file (/etc/shadow)
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-06-09 14:50:48 +00:00
|
|
|
#
|
2006-01-06 22:51:40 +00:00
|
|
|
# cjp: these next three interfaces are split
|
|
|
|
# since typeattribute does not work in conditionals
|
|
|
|
# yet, otherwise they should be one interface.
|
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_read_shadow',`
|
2006-01-06 22:51:40 +00:00
|
|
|
auth_can_read_shadow_passwords($1)
|
|
|
|
auth_tunable_read_shadow($1)
|
|
|
|
')
|
|
|
|
|
|
|
|
interface(`auth_can_read_shadow_passwords',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute can_read_shadow_passwords;
|
2006-01-06 22:51:40 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 can_read_shadow_passwords;
|
|
|
|
')
|
|
|
|
|
|
|
|
interface(`auth_tunable_read_shadow',`
|
|
|
|
gen_require(`
|
2005-06-20 17:41:29 +00:00
|
|
|
type shadow_t;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
files_list_etc($1)
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 shadow_t:file r_file_perms;
|
2005-04-19 20:45:54 +00:00
|
|
|
')
|
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Do not audit attempts to read the shadow
|
|
|
|
## password file (/etc/shadow).
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the domain to not audit.
|
|
|
|
## </param>
|
2005-06-09 14:50:48 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_dontaudit_read_shadow',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type shadow_t;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 shadow_t:file { getattr read };
|
2005-04-19 20:45:54 +00:00
|
|
|
')
|
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Read and write the shadow password file (/etc/shadow).
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-06-09 14:50:48 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_rw_shadow',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute can_read_shadow_passwords, can_write_shadow_passwords;
|
|
|
|
type shadow_t;
|
|
|
|
class file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-17 17:59:26 +00:00
|
|
|
files_list_etc($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 shadow_t:file rw_file_perms;
|
|
|
|
typeattribute $1 can_read_shadow_passwords, can_write_shadow_passwords;
|
2005-04-19 20:45:54 +00:00
|
|
|
')
|
|
|
|
|
2005-05-09 18:50:20 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# auth_manage_shadow(domain)
|
2005-05-09 18:50:20 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_manage_shadow',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute can_read_shadow_passwords, can_write_shadow_passwords;
|
|
|
|
type shadow_t;
|
|
|
|
class file create_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 shadow_t:file create_file_perms;
|
2006-01-13 21:06:49 +00:00
|
|
|
files_filetrans_etc($1,shadow_t,file)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
typeattribute $1 can_read_shadow_passwords, can_write_shadow_passwords;
|
2005-05-09 18:50:20 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
2005-11-25 15:51:50 +00:00
|
|
|
## <summary>
|
|
|
|
## Relabel to the shadow
|
|
|
|
## password file type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
2005-05-09 18:50:20 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_relabelto_shadow',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
attribute can_relabelto_shadow_passwords;
|
|
|
|
type shadow_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_etc($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 shadow_t:file relabelto;
|
|
|
|
typeattribute $1 can_relabelto_shadow_passwords;
|
2005-05-09 18:50:20 +00:00
|
|
|
')
|
|
|
|
|
2005-11-25 15:51:50 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Relabel from and to the shadow
|
|
|
|
## password file type.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_relabel_shadow',`
|
|
|
|
gen_require(`
|
|
|
|
attribute can_relabelto_shadow_passwords;
|
|
|
|
type shadow_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_etc($1)
|
|
|
|
allow $1 shadow_t:file { relabelfrom relabelto };
|
|
|
|
typeattribute $1 can_relabelto_shadow_passwords;
|
|
|
|
')
|
|
|
|
|
2005-09-16 21:20:37 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Append to the login failure log.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_append_faillog',`
|
|
|
|
gen_require(`
|
|
|
|
type faillog_t;
|
|
|
|
class file { getattr append };
|
|
|
|
')
|
|
|
|
|
|
|
|
logging_search_logs($1)
|
|
|
|
allow $1 faillog_t:file { getattr append };
|
|
|
|
')
|
|
|
|
|
2005-05-31 19:52:57 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# auth_rw_faillog(domain)
|
2005-05-31 19:52:57 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_rw_faillog',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type faillog_t;
|
|
|
|
class file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_search_logs($1)
|
2005-06-20 17:41:29 +00:00
|
|
|
allow $1 faillog_t:file rw_file_perms;
|
2005-05-31 19:52:57 +00:00
|
|
|
')
|
|
|
|
|
2005-04-14 20:18:17 +00:00
|
|
|
#######################################
|
2005-10-07 21:45:04 +00:00
|
|
|
## <summary>
|
|
|
|
## Read the last logins log.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-10-07 21:45:04 +00:00
|
|
|
interface(`auth_read_lastlog',`
|
|
|
|
gen_require(`
|
|
|
|
type lastlog_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
logging_search_logs($1)
|
|
|
|
allow $1 lastlog_t:file { getattr read };
|
|
|
|
')
|
|
|
|
|
2005-10-19 19:45:20 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Append only to the last logins log.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_append_lastlog',`
|
|
|
|
gen_require(`
|
|
|
|
type lastlog_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
logging_search_logs($1)
|
|
|
|
allow $1 lastlog_t:file { getattr lock append };
|
|
|
|
')
|
|
|
|
|
2005-10-07 21:45:04 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Read and write to the last logins log.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
2005-04-14 20:18:17 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_rw_lastlog',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type lastlog_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_search_logs($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 lastlog_t:file { getattr read write setattr };
|
2005-04-14 20:18:17 +00:00
|
|
|
')
|
|
|
|
|
2005-05-24 15:55:57 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute pam programs in the pam domain.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-04 17:01:46 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_domtrans_pam',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type pam_t, pam_exec_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
domain_auto_trans($1,pam_exec_t,pam_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 pam_t:fd use;
|
|
|
|
allow pam_t $1:fd use;
|
|
|
|
allow pam_t $1:fifo_file rw_file_perms;
|
|
|
|
allow pam_t $1:process sigchld;
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
2005-05-24 15:55:57 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute pam programs in the PAM domain.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## The role to allow the PAM domain.
|
|
|
|
## </param>
|
|
|
|
## <param name="terminal">
|
|
|
|
## The type of the terminal allow the PAM domain to use.
|
|
|
|
## </param>
|
2005-05-24 15:55:57 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_run_pam',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type pam_t;
|
|
|
|
class chr_file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_domtrans_pam($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
role $2 types pam_t;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow pam_t $3:chr_file rw_file_perms;
|
2005-05-24 15:55:57 +00:00
|
|
|
')
|
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute the pam program.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-06-09 14:50:48 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_exec_pam',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type pam_exec_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-10 01:01:13 +00:00
|
|
|
can_exec($1,pam_exec_t)
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
2005-05-02 18:41:20 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# auth_read_pam_pid(domain)
|
2005-05-02 18:41:20 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_read_pam_pid',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type pam_var_run_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_var($1)
|
|
|
|
files_search_pids($1)
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 pam_var_run_t:dir r_dir_perms;
|
|
|
|
allow $1 pam_var_run_t:file r_file_perms;
|
2005-05-02 18:41:20 +00:00
|
|
|
')
|
|
|
|
|
2005-11-29 21:27:15 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attemps to read PAM pid files.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_dontaudit_read_pam_pid',`
|
|
|
|
gen_require(`
|
|
|
|
type pam_var_run_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 pam_var_run_t:file { getattr read };
|
|
|
|
')
|
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Delete pam PID files.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-06-09 14:50:48 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_delete_pam_pid',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type pam_var_run_t;
|
|
|
|
class dir { getattr search read write remove_name };
|
|
|
|
class file { getattr unlink };
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_var($1)
|
|
|
|
files_search_pids($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 pam_var_run_t:dir { getattr search read write remove_name };
|
|
|
|
allow $1 pam_var_run_t:file { getattr unlink };
|
2005-05-03 20:23:33 +00:00
|
|
|
')
|
|
|
|
|
2005-05-04 17:01:46 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# auth_domtrans_pam_console(domain)
|
2005-05-04 17:01:46 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_domtrans_pam_console',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type pam_console_t, pam_console_exec_t;
|
|
|
|
class process sigchld;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
domain_auto_trans($1,pam_console_exec_t,pam_console_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 pam_console_t:fd use;
|
|
|
|
allow pam_console_t $1:fd use;
|
|
|
|
allow pam_console_t $1:fifo_file rw_file_perms;
|
|
|
|
allow pam_console_t $1:process sigchld;
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
2005-11-29 15:49:18 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Search the contents of the
|
|
|
|
## pam_console data directory.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_search_pam_console_data',`
|
|
|
|
gen_require(`
|
|
|
|
type pam_var_console_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_var($1)
|
|
|
|
files_search_pids($1)
|
|
|
|
allow $1 pam_var_console_t:dir search_dir_perms;
|
|
|
|
')
|
|
|
|
|
2005-05-30 21:17:20 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# auth_list_pam_console_data(domain)
|
2005-05-30 21:17:20 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_list_pam_console_data',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type pam_var_console_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_var($1)
|
|
|
|
files_search_pids($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 pam_var_console_t:dir r_dir_perms;
|
2005-05-30 21:17:20 +00:00
|
|
|
')
|
|
|
|
|
2005-05-04 17:01:46 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# auth_read_pam_console_data(domain)
|
2005-05-04 17:01:46 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_read_pam_console_data',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type pam_var_console_t;
|
|
|
|
class dir r_dir_perms;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_var($1)
|
|
|
|
files_search_pids($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
allow $1 pam_var_console_t:dir r_dir_perms;
|
|
|
|
allow $1 pam_var_console_t:file r_file_perms;
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# auth_manage_pam_console_data(domain)
|
2005-05-04 17:01:46 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_manage_pam_console_data',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type pam_var_console_t;
|
|
|
|
class dir rw_dir_perms;
|
|
|
|
class file create_file_perms;
|
|
|
|
class lnk_file create_lnk_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
files_search_var($1)
|
|
|
|
files_search_pids($1)
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 pam_var_console_t:dir rw_dir_perms;
|
2005-06-10 01:01:13 +00:00
|
|
|
allow $1 pam_var_console_t:file create_file_perms;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 pam_var_console_t:lnk_file create_lnk_perms;
|
2005-05-04 17:01:46 +00:00
|
|
|
')
|
|
|
|
|
2005-09-19 21:17:45 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Delete pam_console data.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_delete_pam_console_data',`
|
|
|
|
gen_require(`
|
|
|
|
type pam_var_console_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_search_var($1)
|
|
|
|
files_search_pids($1)
|
|
|
|
allow $1 pam_var_console_t:dir rw_dir_perms;
|
|
|
|
allow $1 pam_var_console_t:file unlink;
|
|
|
|
')
|
|
|
|
|
2005-10-24 01:53:13 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read all directories on the filesystem, except
|
|
|
|
## the shadow passwords and listed exceptions.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the domain perfoming this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="exception_types" optional="true">
|
|
|
|
## The types to be excluded. Each type or attribute
|
|
|
|
## must be negated by the caller.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_read_all_dirs_except_shadow',`
|
|
|
|
gen_require(`
|
|
|
|
type shadow_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_read_all_dirs_except($1,$2 -shadow_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read all files on the filesystem, except
|
|
|
|
## the shadow passwords and listed exceptions.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the domain perfoming this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="exception_types" optional="true">
|
|
|
|
## The types to be excluded. Each type or attribute
|
|
|
|
## must be negated by the caller.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_read_all_files_except_shadow',`
|
|
|
|
gen_require(`
|
|
|
|
type shadow_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_read_all_files_except($1,$2 -shadow_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read all symbolic links on the filesystem, except
|
|
|
|
## the shadow passwords and listed exceptions.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## The type of the domain perfoming this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="exception_types" optional="true">
|
|
|
|
## The types to be excluded. Each type or attribute
|
|
|
|
## must be negated by the caller.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_read_all_symlinks_except_shadow',`
|
|
|
|
gen_require(`
|
|
|
|
type shadow_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
files_read_all_symlinks_except($1,$2 -shadow_t)
|
|
|
|
')
|
|
|
|
|
2005-05-25 20:58:21 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Relabel all files on the filesystem, except
|
|
|
|
## the shadow passwords and listed exceptions.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the domain perfoming this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="exception_types" optional="true">
|
|
|
|
## The types to be excluded. Each type or attribute
|
|
|
|
## must be negated by the caller.
|
|
|
|
## </param>
|
2005-05-25 20:58:21 +00:00
|
|
|
#
|
|
|
|
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_relabel_all_files_except_shadow',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type shadow_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
files_relabel_all_files($1,$2 -shadow_t)
|
2005-05-25 20:58:21 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Manage all files on the filesystem, except
|
|
|
|
## the shadow passwords and listed exceptions.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the domain perfoming this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="exception_types" optional="true">
|
|
|
|
## The types to be excluded. Each type or attribute
|
|
|
|
## must be negated by the caller.
|
|
|
|
## </param>
|
2005-05-25 20:58:21 +00:00
|
|
|
#
|
|
|
|
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_manage_all_files_except_shadow',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type shadow_t;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
files_manage_all_files($1,$2 -shadow_t)
|
2005-05-25 20:58:21 +00:00
|
|
|
')
|
|
|
|
|
2005-05-24 15:55:57 +00:00
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute utempter programs in the utempter domain.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
2005-05-24 15:55:57 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_domtrans_utempter',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type utempter_t, utempter_exec_t;
|
|
|
|
class process sigchld;
|
|
|
|
class fd use;
|
|
|
|
class fifo_file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-09 14:50:48 +00:00
|
|
|
domain_auto_trans($1,utempter_exec_t,utempter_t)
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 utempter_t:fd use;
|
|
|
|
allow utempter_t $1:fd use;
|
|
|
|
allow utempter_t $1:fifo_file rw_file_perms;
|
|
|
|
allow utempter_t $1:process sigchld;
|
2005-05-24 15:55:57 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
########################################
|
2005-08-11 17:46:39 +00:00
|
|
|
## <summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## Execute utempter programs in the utempter domain.
|
2005-08-11 17:46:39 +00:00
|
|
|
## </summary>
|
2005-06-23 21:30:57 +00:00
|
|
|
## <param name="domain">
|
|
|
|
## The type of the process performing this action.
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## The role to allow the utempter domain.
|
|
|
|
## </param>
|
|
|
|
## <param name="terminal">
|
|
|
|
## The type of the terminal allow the utempter domain to use.
|
|
|
|
## </param>
|
2005-05-24 15:55:57 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_run_utempter',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type utempter_t;
|
|
|
|
class chr_file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
auth_domtrans_utempter($1)
|
2005-06-03 12:25:14 +00:00
|
|
|
role $2 types utempter_t;
|
2005-06-09 14:50:48 +00:00
|
|
|
allow utempter_t $3:chr_file rw_file_perms;
|
2005-05-24 15:55:57 +00:00
|
|
|
')
|
|
|
|
|
2006-01-11 18:10:49 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Do not audit attemps to execute utempter executable.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain to not audit.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_dontaudit_exec_utempter',`
|
|
|
|
gen_require(`
|
|
|
|
type utempter_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
dontaudit $1 utempter_exec_t:file { execute execute_no_trans };
|
|
|
|
')
|
|
|
|
|
2006-01-17 17:50:10 +00:00
|
|
|
#######################################
|
|
|
|
#
|
|
|
|
# auth_setattr_login_records(domain)
|
|
|
|
#
|
|
|
|
interface(`auth_setattr_login_records',`
|
|
|
|
gen_require(`
|
|
|
|
type wtmp_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 wtmp_t:file setattr;
|
|
|
|
logging_search_logs($1)
|
|
|
|
')
|
|
|
|
|
2005-05-16 21:10:33 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# auth_read_login_records(domain)
|
2005-05-16 21:10:33 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_read_login_records',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type wtmp_t;
|
|
|
|
class file r_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_search_logs($1)
|
2005-06-09 14:50:48 +00:00
|
|
|
allow $1 wtmp_t:file r_file_perms;
|
2005-05-16 21:10:33 +00:00
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# auth_dontaudit_write_login_records(domain)
|
2005-05-16 21:10:33 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_dontaudit_write_login_records',`
|
2005-06-20 17:41:29 +00:00
|
|
|
gen_require(`
|
|
|
|
type wtmp_t;
|
|
|
|
class file write;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
dontaudit $1 wtmp_t:file write;
|
2005-05-16 21:10:33 +00:00
|
|
|
')
|
|
|
|
|
2005-10-05 19:52:53 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Append to login records (wtmp).
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_append_login_records',`
|
|
|
|
gen_require(`
|
|
|
|
type wtmp_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 wtmp_t:file { getattr append };
|
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## Write to login records (wtmp).
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_write_login_records',`
|
|
|
|
gen_require(`
|
|
|
|
type wtmp_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 wtmp_t:file { write lock };
|
|
|
|
')
|
|
|
|
|
2005-05-16 21:10:33 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2005-06-13 17:35:46 +00:00
|
|
|
# auth_rw_login_records(domain)
|
2005-05-16 21:10:33 +00:00
|
|
|
#
|
2005-06-22 19:21:31 +00:00
|
|
|
interface(`auth_rw_login_records',`
|
2005-06-16 20:54:18 +00:00
|
|
|
gen_require(`
|
|
|
|
type wtmp_t;
|
|
|
|
class file rw_file_perms;
|
|
|
|
')
|
2005-06-03 12:25:14 +00:00
|
|
|
|
|
|
|
allow $1 wtmp_t:file rw_file_perms;
|
2005-06-13 17:35:46 +00:00
|
|
|
logging_search_logs($1)
|
2005-05-16 21:10:33 +00:00
|
|
|
')
|
|
|
|
|
2005-08-05 14:32:12 +00:00
|
|
|
#######################################
|
|
|
|
#
|
2006-01-13 21:06:49 +00:00
|
|
|
# auth_filetrans_login_records(domain)
|
2005-08-05 14:32:12 +00:00
|
|
|
#
|
2006-01-13 21:06:49 +00:00
|
|
|
interface(`auth_filetrans_login_records',`
|
2005-08-05 14:32:12 +00:00
|
|
|
gen_require(`
|
|
|
|
type wtmp_t;
|
|
|
|
')
|
|
|
|
|
2006-01-13 21:06:49 +00:00
|
|
|
logging_filetrans_log($1,wtmp_t,file)
|
2005-08-05 14:32:12 +00:00
|
|
|
')
|
|
|
|
|
2005-06-28 20:54:49 +00:00
|
|
|
#######################################
|
|
|
|
#
|
|
|
|
# auth_manage_login_records(domain)
|
|
|
|
#
|
|
|
|
interface(`auth_manage_login_records',`
|
|
|
|
gen_require(`
|
|
|
|
type wtmp_t;
|
|
|
|
class file create_file_perms;
|
|
|
|
')
|
|
|
|
|
|
|
|
logging_rw_log_dir($1)
|
|
|
|
allow $1 wtmp_t:file create_file_perms;
|
|
|
|
')
|
2005-07-19 18:40:19 +00:00
|
|
|
|
2005-10-13 20:59:36 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Use nsswitch to look up uid-username mappings.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_use_nsswitch',`
|
2005-11-15 16:34:10 +00:00
|
|
|
gen_require(`
|
|
|
|
type var_auth_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 var_auth_t:dir r_dir_perms;
|
|
|
|
allow $1 var_auth_t:file create_file_perms;
|
2005-11-21 22:15:11 +00:00
|
|
|
files_list_var_lib($1)
|
2005-10-13 20:59:36 +00:00
|
|
|
|
|
|
|
sysnet_dns_name_resolve($1)
|
|
|
|
sysnet_use_ldap($1)
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`nis',`
|
2005-10-13 20:59:36 +00:00
|
|
|
nis_use_ypbind($1)
|
|
|
|
')
|
|
|
|
|
2005-11-23 20:24:27 +00:00
|
|
|
optional_policy(`samba',`
|
2005-10-24 19:50:21 +00:00
|
|
|
samba_connect_winbind($1)
|
2005-10-13 20:59:36 +00:00
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2005-07-19 18:40:19 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Unconfined access to the authlogin module.
|
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## Unconfined access to the authlogin module.
|
|
|
|
## </p>
|
|
|
|
## <p>
|
|
|
|
## Currently, this only allows assertions for
|
|
|
|
## the shadow passwords file (/etc/shadow) to
|
|
|
|
## be passed. No access is granted yet.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
## <param name="domain">
|
|
|
|
## Domain allowed access.
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`auth_unconfined',`
|
|
|
|
gen_require(`
|
|
|
|
attribute can_read_shadow_passwords;
|
|
|
|
attribute can_write_shadow_passwords;
|
|
|
|
attribute can_relabelto_shadow_passwords;
|
|
|
|
')
|
|
|
|
|
|
|
|
typeattribute $1 can_read_shadow_passwords;
|
|
|
|
typeattribute $1 can_write_shadow_passwords;
|
|
|
|
typeattribute $1 can_relabelto_shadow_passwords;
|
|
|
|
')
|