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">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## Role allowed access
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-12 22:26:46 +00:00
|
|
|
## </param>
|
2008-11-05 16:10:46 +00:00
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## User domain for the role
|
2006-02-10 18:41:53 +00:00
|
|
|
## </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)
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
userdom_unpriv_usertype($1, $1_java_t)
|
|
|
|
userdom_manage_tmpfs_role($2, $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)
|
|
|
|
|
2010-08-26 13:41:21 +00:00
|
|
|
corecmd_bin_domtrans($1_java_t, $1_t)
|
2010-02-19 16:21:38 +00:00
|
|
|
|
|
|
|
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
|
|
|
')
|
2006-02-20 16:31:54 +00:00
|
|
|
|
2007-02-16 23:01:42 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Run java in javaplugin domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2010-08-03 15:53:36 +00:00
|
|
|
## Domain allowed to transition.
|
2007-02-16 23:01:42 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
2008-11-05 16:10:46 +00:00
|
|
|
template(`java_domtrans',`
|
2007-02-16 23:01:42 +00:00
|
|
|
gen_require(`
|
2008-11-05 16:10:46 +00:00
|
|
|
type java_t, java_exec_t;
|
2007-02-16 23:01:42 +00:00
|
|
|
')
|
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
domtrans_pattern($1, java_exec_t, java_t)
|
2007-02-16 23:01:42 +00:00
|
|
|
')
|
|
|
|
|
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>
|
2010-08-03 15:53:36 +00:00
|
|
|
## Domain allowed to transition.
|
2010-02-19 16:21:38 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
2010-08-03 13:20:22 +00:00
|
|
|
## 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;
|
|
|
|
')
|
|
|
|
|
2006-02-20 16:31:54 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
2008-11-05 16:10:46 +00:00
|
|
|
## Execute the java program in the unconfined java domain.
|
2006-02-20 16:31:54 +00:00
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2010-08-03 15:53:36 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-20 16:31:54 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
2008-11-05 16:10:46 +00:00
|
|
|
interface(`java_domtrans_unconfined',`
|
2007-10-02 16:04:50 +00:00
|
|
|
gen_require(`
|
2008-11-05 16:10:46 +00:00
|
|
|
type unconfined_java_t, java_exec_t;
|
2006-02-20 16:31:54 +00:00
|
|
|
')
|
2007-10-02 16:04:50 +00:00
|
|
|
|
2008-11-05 16:10:46 +00:00
|
|
|
domtrans_pattern($1, java_exec_t, unconfined_java_t)
|
2007-10-02 16:04:50 +00:00
|
|
|
corecmd_search_bin($1)
|
2006-02-20 16:31:54 +00:00
|
|
|
')
|
2009-08-17 17:19:26 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute the java program in the unconfined java domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2010-08-03 15:53:36 +00:00
|
|
|
## Domain allowed to transition.
|
2009-08-17 17:19:26 +00:00
|
|
|
## </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-08-26 13:41:21 +00:00
|
|
|
nsplugin_role_notrans($2, unconfined_java_t)
|
2009-08-17 17:19:26 +00:00
|
|
|
')
|
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)
|
|
|
|
')
|