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 };
|
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>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </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
|
|
|
')
|
|
|
|
|
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>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </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>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </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;
|
|
|
|
')
|