Chris PeBenito 3ffe29
Chris PeBenito ed3a1f
policy_module(java, 2.2.0)
Chris PeBenito 3ffe29
Chris PeBenito 3ffe29
########################################
Chris PeBenito 3ffe29
#
Chris PeBenito 3ffe29
# Declarations
Chris PeBenito 3ffe29
#
Chris PeBenito 3ffe29
Chris PeBenito 56e1b3
## <desc>
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## Allow java executable stack
Chris PeBenito 56e1b3
## 

Chris PeBenito 56e1b3
## </desc>
Chris PeBenito 0bfccd
gen_tunable(allow_java_execstack, false)
Chris PeBenito 56e1b3
Chris PeBenito 46c69c
type java_t;
Chris PeBenito 3ffe29
type java_exec_t;
Chris PeBenito 296273
application_domain(java_t, java_exec_t)
Chris PeBenito 296273
ubac_constrained(java_t)
Chris PeBenito 296273
typealias java_t alias { staff_javaplugin_t user_javaplugin_t sysadm_javaplugin_t };
Chris PeBenito 296273
typealias java_t alias { auditadm_javaplugin_t secadm_javaplugin_t };
Chris PeBenito 296273
Chris PeBenito 296273
type java_tmp_t;
Chris PeBenito 296273
files_tmp_file(java_tmp_t)
Chris PeBenito 296273
ubac_constrained(java_tmp_t)
Chris PeBenito 296273
typealias java_tmp_t alias { staff_javaplugin_tmp_t user_javaplugin_tmp_t sysadm_javaplugin_tmp_t };
Chris PeBenito 296273
typealias java_tmp_t alias { auditadm_tmp_javaplugin_t secadm_javaplugin_tmp_t };
Chris PeBenito 296273
Chris PeBenito 296273
type java_tmpfs_t;
Chris PeBenito 296273
ubac_constrained(java_tmpfs_t)
Chris PeBenito 296273
files_tmpfs_file(java_tmpfs_t)
Chris PeBenito 296273
typealias java_tmpfs_t alias { staff_javaplugin_tmpfs_t user_javaplugin_tmpfs_t sysadm_javaplugin_tmpfs_t };
Chris PeBenito 296273
typealias java_tmpfs_t alias { auditadm_tmpfs_javaplugin_t secadm_tmpfs_javaplugin_t };
Chris PeBenito 296273
Chris PeBenito 296273
type unconfined_java_t;
Chris PeBenito 296273
init_system_domain(unconfined_java_t, java_exec_t)
Chris PeBenito 46c69c
Chris PeBenito 46c69c
########################################
Chris PeBenito 46c69c
#
Chris PeBenito 46c69c
# Local policy
Chris PeBenito 46c69c
#
Chris PeBenito 46c69c
Chris PeBenito 296273
allow java_t self:process { signal_perms getsched setsched execmem };
Chris PeBenito 296273
allow java_t self:fifo_file rw_fifo_file_perms;
Chris PeBenito 296273
allow java_t self:tcp_socket create_socket_perms;
Chris PeBenito 296273
allow java_t self:udp_socket create_socket_perms;
Chris PeBenito 296273
Chris PeBenito 296273
manage_dirs_pattern(java_t, java_tmp_t, java_tmp_t)
Chris PeBenito 296273
manage_files_pattern(java_t, java_tmp_t, java_tmp_t)
Chris PeBenito 296273
files_tmp_filetrans(java_t, java_tmp_t,{ file dir })
Chris PeBenito 296273
Chris PeBenito 296273
manage_files_pattern(java_t, java_tmpfs_t, java_tmpfs_t)
Chris PeBenito 296273
manage_lnk_files_pattern(java_t, java_tmpfs_t, java_tmpfs_t)
Chris PeBenito 296273
manage_fifo_files_pattern(java_t, java_tmpfs_t, java_tmpfs_t)
Chris PeBenito 296273
manage_sock_files_pattern(java_t, java_tmpfs_t, java_tmpfs_t)
Chris PeBenito 296273
fs_tmpfs_filetrans(java_t, java_tmpfs_t, { file lnk_file sock_file fifo_file })
Chris PeBenito 296273
Chris PeBenito 296273
can_exec(java_t, java_exec_t)
Chris PeBenito 296273
Chris PeBenito 296273
kernel_read_all_sysctls(java_t)
Chris PeBenito 296273
kernel_search_vm_sysctl(java_t)
Chris PeBenito 296273
kernel_read_network_state(java_t)
Chris PeBenito 296273
kernel_read_system_state(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
# Search bin directory under java for java executable
Chris PeBenito 296273
corecmd_search_bin(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
corenet_all_recvfrom_unlabeled(java_t)
Chris PeBenito 296273
corenet_all_recvfrom_netlabel(java_t)
Chris PeBenito 296273
corenet_tcp_sendrecv_generic_if(java_t)
Chris PeBenito 296273
corenet_udp_sendrecv_generic_if(java_t)
Chris PeBenito c12621
corenet_tcp_sendrecv_generic_node(java_t)
Chris PeBenito c12621
corenet_udp_sendrecv_generic_node(java_t)
Chris PeBenito 296273
corenet_tcp_sendrecv_all_ports(java_t)
Chris PeBenito 296273
corenet_udp_sendrecv_all_ports(java_t)
Chris PeBenito 296273
corenet_tcp_connect_all_ports(java_t)
Chris PeBenito 296273
corenet_sendrecv_all_client_packets(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
dev_read_sound(java_t)
Chris PeBenito 296273
dev_write_sound(java_t)
Chris PeBenito 296273
dev_read_urand(java_t)
Chris PeBenito 296273
dev_read_rand(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
files_read_etc_files(java_t)
Chris PeBenito 296273
files_read_usr_files(java_t)
Chris PeBenito 296273
files_search_home(java_t)
Chris PeBenito 296273
files_search_var_lib(java_t)
Chris PeBenito 296273
files_read_etc_runtime_files(java_t)
Chris PeBenito 296273
# Read global fonts and font config
Chris PeBenito 296273
files_read_etc_files(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
fs_getattr_xattr_fs(java_t)
Chris PeBenito 296273
fs_dontaudit_rw_tmpfs_files(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
logging_send_syslog_msg(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
miscfiles_read_localization(java_t)
Chris PeBenito 296273
# Read global fonts and font config
Chris PeBenito 296273
miscfiles_read_fonts(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
sysnet_read_config(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
userdom_dontaudit_use_user_terminals(java_t)
Chris PeBenito 296273
userdom_dontaudit_setattr_user_home_content_files(java_t)
Chris PeBenito 296273
userdom_dontaudit_exec_user_home_content_files(java_t)
Chris PeBenito 296273
userdom_manage_user_home_content_dirs(java_t)
Chris PeBenito 296273
userdom_manage_user_home_content_files(java_t)
Chris PeBenito 296273
userdom_manage_user_home_content_symlinks(java_t)
Chris PeBenito 296273
userdom_manage_user_home_content_pipes(java_t)
Chris PeBenito 296273
userdom_manage_user_home_content_sockets(java_t)
Chris PeBenito 296273
userdom_user_home_dir_filetrans_user_home_content(java_t, { file lnk_file sock_file fifo_file })
Chris PeBenito 296273
userdom_write_user_tmp_sockets(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
tunable_policy(`allow_java_execstack',`
Chris PeBenito 296273
	allow java_t self:process execstack;
Chris PeBenito 296273
Chris PeBenito 296273
	allow java_t java_tmp_t:file execute;
Chris PeBenito 6b19be
Chris PeBenito 296273
	libs_legacy_use_shared_libs(java_t)
Chris PeBenito 296273
	libs_legacy_use_ld_so(java_t)
Chris PeBenito 296273
Chris PeBenito 296273
	miscfiles_legacy_read_localization(java_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	nis_use_ypbind(java_t)
Chris PeBenito 296273
')
Chris PeBenito 6b19be
Chris PeBenito 350b6a
optional_policy(`
Chris PeBenito 296273
	nscd_socket_use(java_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	xserver_user_x_domain_template(java, java_t, java_tmpfs_t)
Chris PeBenito 296273
')
Chris PeBenito 296273
Chris PeBenito 296273
########################################
Chris PeBenito 296273
#
Chris PeBenito 296273
# Unconfined java local policy
Chris PeBenito 296273
#
Chris PeBenito 296273
Chris PeBenito 296273
optional_policy(`
Chris PeBenito 296273
	# execheap is needed for itanium/BEA jrocket
Chris PeBenito 296273
	allow unconfined_java_t self:process { execstack execmem execheap };
Chris PeBenito 296273
Chris PeBenito 296273
	init_dbus_chat_script(unconfined_java_t)
Chris PeBenito 296273
Chris PeBenito 296273
	unconfined_domain_noaudit(unconfined_java_t)
Chris PeBenito 296273
	unconfined_dbus_chat(unconfined_java_t)
Chris PeBenito 46c69c
')