Chris PeBenito 31b7c0
# Home macros
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
################################################
Chris PeBenito 31b7c0
# network_home(source)
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Allows source domain to use a network home
Chris PeBenito 31b7c0
# This includes privileges of create and execute
Chris PeBenito 31b7c0
# as well as the ability to create sockets and fifo
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`network_home', `
Chris PeBenito 31b7c0
allow $1 autofs_t:dir { search getattr };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
if (use_nfs_home_dirs) {
Chris PeBenito 31b7c0
create_dir_file($1, nfs_t)
Chris PeBenito 31b7c0
can_exec($1, nfs_t)
Chris PeBenito 31b7c0
allow $1 nfs_t:{ sock_file fifo_file } create_file_perms;
Chris PeBenito 31b7c0
}
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
if (use_samba_home_dirs) {
Chris PeBenito 31b7c0
create_dir_file($1, cifs_t)
Chris PeBenito 31b7c0
can_exec($1, cifs_t)
Chris PeBenito 31b7c0
allow $1 cifs_t:{ sock_file fifo_file } create_file_perms;
Chris PeBenito 31b7c0
}
Chris PeBenito 31b7c0
') dnl network_home
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
################################################
Chris PeBenito 31b7c0
# write_network_home(source)
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Allows source domain to create directories and
Chris PeBenito 31b7c0
# files on network file system
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`write_network_home', `
Chris PeBenito 31b7c0
allow $1 home_root_t:dir search;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
if (use_nfs_home_dirs) {
Chris PeBenito 31b7c0
create_dir_file($1, nfs_t)
Chris PeBenito 31b7c0
}
Chris PeBenito 31b7c0
if (use_samba_home_dirs) {
Chris PeBenito 31b7c0
create_dir_file($1, cifs_t)
Chris PeBenito 31b7c0
}
Chris PeBenito 31b7c0
allow $1 autofs_t:dir { search getattr };
Chris PeBenito 31b7c0
') dnl write_network_home
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
################################################
Chris PeBenito 31b7c0
# read_network_home(source)
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Allows source domain to read directories and
Chris PeBenito 31b7c0
# files on network file system
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`read_network_home', `
Chris PeBenito 31b7c0
allow $1 home_root_t:dir search;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
if (use_nfs_home_dirs) {
Chris PeBenito 31b7c0
r_dir_file($1, nfs_t)
Chris PeBenito 31b7c0
}
Chris PeBenito 31b7c0
if (use_samba_home_dirs) {
Chris PeBenito 31b7c0
r_dir_file($1, cifs_t)
Chris PeBenito 31b7c0
}
Chris PeBenito 31b7c0
allow $1 autofs_t:dir { search getattr };
Chris PeBenito 31b7c0
') dnl read_network_home
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
##################################################
Chris PeBenito 31b7c0
# home_domain_ro_access(source, user, app)
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Gives source access to the read-only home
Chris PeBenito 31b7c0
# domain of app for the given user type
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`home_domain_ro_access', `
Chris PeBenito 31b7c0
allow $1 { home_root_t $2_home_dir_t }:dir { search getattr };
Chris PeBenito 31b7c0
read_network_home($1)
Chris PeBenito 31b7c0
ifelse($3, `', `
Chris PeBenito 31b7c0
r_dir_file($1, $2_home_t)
Chris PeBenito 31b7c0
', `
Chris PeBenito 31b7c0
r_dir_file($1, $2_$3_ro_home_t)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
') dnl home_domain_ro_access
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
#################################################
Chris PeBenito 31b7c0
# home_domain_access(source, user, app)
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Gives source full access to the home
Chris PeBenito 31b7c0
# domain of app for the given user type
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Requires transition in caller
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`home_domain_access', `
Chris PeBenito 31b7c0
allow $1 { home_root_t $2_home_dir_t }:dir { search getattr };
Chris PeBenito 31b7c0
write_network_home($1)
Chris PeBenito 31b7c0
ifelse($3, `', `
Chris PeBenito 31b7c0
file_type_auto_trans($1, $2_home_dir_t, $2_home_t)
Chris PeBenito 31b7c0
create_dir_file($1, $2_home_t)
Chris PeBenito 31b7c0
', `
Chris PeBenito 31b7c0
create_dir_file($1, $2_$3_home_t)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
') dnl home_domain_access
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
####################################################################
Chris PeBenito 31b7c0
# home_domain (prefix, app)
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Creates a domain in the prefix home where an application can
Chris PeBenito 31b7c0
# store its settings. It is accessible by the prefix domain.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Requires transition in caller
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`home_domain', `
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Declare home domain
Chris PeBenito 31b7c0
type $1_$2_home_t, file_type, $1_file_type, sysadmfile, polymember;
Chris PeBenito 31b7c0
typealias $1_$2_home_t alias $1_$2_rw_t;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# User side access
Chris PeBenito 31b7c0
create_dir_file($1_t, $1_$2_home_t)
Chris PeBenito 31b7c0
allow $1_t $1_$2_home_t:{ dir file lnk_file } { relabelfrom relabelto };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# App side access
Chris PeBenito 31b7c0
home_domain_access($1_$2_t, $1, $2)
Chris PeBenito 31b7c0
')
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
####################################################################
Chris PeBenito 31b7c0
# home_domain_ro (user, app)
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
# Creates a read-only domain in the user home where an application can
Chris PeBenito 31b7c0
# store its settings. It is fully accessible by the user, but
Chris PeBenito 31b7c0
# it is read-only for the application.
Chris PeBenito 31b7c0
#
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
define(`home_domain_ro', `
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# Declare home domain
Chris PeBenito 31b7c0
type $1_$2_ro_home_t, file_type, $1_file_type, sysadmfile;
Chris PeBenito 31b7c0
typealias $1_$2_ro_home_t alias $1_$2_ro_t;
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# User side access
Chris PeBenito 31b7c0
create_dir_file($1_t, $1_$2_ro_home_t)
Chris PeBenito 31b7c0
allow $1_t $1_$2_ro_home_t:{ dir file lnk_file } { relabelfrom relabelto };
Chris PeBenito 31b7c0
Chris PeBenito 31b7c0
# App side access
Chris PeBenito 31b7c0
home_domain_ro_access($1_$2_t, $1, $2)
Chris PeBenito 31b7c0
')