selinux-refpolicy/policy/modules/apps/java.if

201 lines
3.9 KiB
Plaintext
Raw Normal View History

2006-01-12 22:26:46 +00:00
## <summary>Java virtual machine</summary>
2008-11-05 16:10:46 +00:00
########################################
2006-01-12 22:26:46 +00:00
## <summary>
2008-11-05 16:10:46 +00:00
## Role access for java
2006-01-12 22:26:46 +00:00
## </summary>
2008-11-05 16:10:46 +00:00
## <param name="role">
## <summary>
2008-11-05 16:10:46 +00:00
## Role allowed access
## </summary>
2006-01-12 22:26:46 +00:00
## </param>
2008-11-05 16:10:46 +00:00
## <param name="domain">
## <summary>
2008-11-05 16:10:46 +00:00
## User domain for the role
## </summary>
2006-01-12 22:26:46 +00:00
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`java_role',`
2006-01-12 22:26:46 +00:00
gen_require(`
2008-11-05 16:10:46 +00:00
type java_t, java_exec_t;
2006-01-12 22:26:46 +00:00
')
2008-10-17 15:52:39 +00:00
2008-11-05 16:10:46 +00:00
role $1 types java_t;
2008-10-17 15:52:39 +00:00
2006-01-12 22:26:46 +00:00
# The user role is authorized for this domain.
2008-11-05 16:10:46 +00:00
domtrans_pattern($2, java_exec_t, java_t)
allow java_t $2:process signull;
2006-01-12 22:26:46 +00:00
# Unrestricted inheritance from the caller.
2008-11-05 16:10:46 +00:00
allow $2 java_t:process { noatsecure siginh rlimitinh };
2006-01-12 22:26:46 +00:00
2008-11-05 16:10:46 +00:00
allow java_t $2:unix_stream_socket connectto;
allow java_t $2:unix_stream_socket { read write };
2010-02-19 16:21:38 +00:00
allow java_t $2:tcp_socket { read write };
')
#######################################
## <summary>
## The role template for the java module.
## </summary>
## <desc>
## <p>
## This template creates a derived domains which are used
## for java applications.
## </p>
## </desc>
## <param name="role_prefix">
## <summary>
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
## </param>
## <param name="user_role">
## <summary>
## The role associated with the user domain.
## </summary>
## </param>
## <param name="user_domain">
## <summary>
## The type of the user domain.
## </summary>
## </param>
#
template(`java_role_template',`
gen_require(`
type java_exec_t;
')
type $1_java_t;
domain_type($1_java_t)
domain_entry_file($1_java_t, java_exec_t)
role $2 types $1_java_t;
domain_interactive_fd($1_java_t)
userdom_manage_user_tmpfs_files($1_java_t)
2010-02-19 16:21:38 +00:00
allow $1_java_t self:process { ptrace signal getsched execmem execstack };
dontaudit $1_java_t $3:tcp_socket { read write };
allow $3 $1_java_t:process { getattr ptrace noatsecure signal_perms };
domtrans_pattern($3, java_exec_t, $1_java_t)
corecmd_bin_domtrans($1_java_t, $3)
dev_dontaudit_append_rand($1_java_t)
files_execmod_all_files($1_java_t)
fs_dontaudit_rw_tmpfs_files($1_java_t)
optional_policy(`
xserver_role($2, $1_java_t)
')
2006-01-12 22:26:46 +00:00
')
########################################
## <summary>
## Run java in javaplugin domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
template(`java_domtrans',`
gen_require(`
2008-11-05 16:10:46 +00:00
type java_t, java_exec_t;
')
2008-11-05 16:10:46 +00:00
domtrans_pattern($1, java_exec_t, java_t)
')
2010-02-19 16:21:38 +00:00
########################################
## <summary>
## Execute java in the java domain, and
## allow the specified role the java domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
2010-02-19 16:21:38 +00:00
## </summary>
## </param>
## <param name="role">
## <summary>
## Role allowed access.
2010-02-19 16:21:38 +00:00
## </summary>
## </param>
#
interface(`java_run',`
gen_require(`
type java_t;
')
java_domtrans($1)
role $2 types java_t;
')
########################################
## <summary>
2008-11-05 16:10:46 +00:00
## Execute the java program in the unconfined java domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
2008-11-05 16:10:46 +00:00
interface(`java_domtrans_unconfined',`
gen_require(`
2008-11-05 16:10:46 +00:00
type unconfined_java_t, java_exec_t;
')
2008-11-05 16:10:46 +00:00
domtrans_pattern($1, java_exec_t, unconfined_java_t)
corecmd_search_bin($1)
')
########################################
## <summary>
## Execute the java program in the unconfined java domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
## <param name="role">
## <summary>
## Role allowed access.
## </summary>
## </param>
#
interface(`java_run_unconfined',`
gen_require(`
type unconfined_java_t;
')
java_domtrans_unconfined($1)
role $2 types unconfined_java_t;
')
2010-02-19 16:21:38 +00:00
########################################
## <summary>
## Execute the java program in the java domain.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`java_exec',`
gen_require(`
type java_exec_t;
')
can_exec($1, java_exec_t)
')