]> git.ipfire.org Git - people/stevee/selinux-policy.git/blame - policy/modules/apps/java.te
Bump module versions for release.
[people/stevee/selinux-policy.git] / policy / modules / apps / java.te
CommitLineData
3ffe2988 1
29af4c13 2policy_module(java, 2.3.0)
3ffe2988
CP
3
4########################################
5#
6# Declarations
7#
8
56e1b3d2
CP
9## <desc>
10## <p>
11## Allow java executable stack
12## </p>
13## </desc>
0bfccda4 14gen_tunable(allow_java_execstack, false)
56e1b3d2 15
46c69cb2 16type java_t;
3ffe2988 17type java_exec_t;
296273a7
CP
18application_domain(java_t, java_exec_t)
19ubac_constrained(java_t)
20typealias java_t alias { staff_javaplugin_t user_javaplugin_t sysadm_javaplugin_t };
21typealias java_t alias { auditadm_javaplugin_t secadm_javaplugin_t };
4fd08891 22role system_r types java_t;
296273a7
CP
23
24type java_tmp_t;
25files_tmp_file(java_tmp_t)
26ubac_constrained(java_tmp_t)
27typealias java_tmp_t alias { staff_javaplugin_tmp_t user_javaplugin_tmp_t sysadm_javaplugin_tmp_t };
28typealias java_tmp_t alias { auditadm_tmp_javaplugin_t secadm_javaplugin_tmp_t };
29
30type java_tmpfs_t;
31ubac_constrained(java_tmpfs_t)
32files_tmpfs_file(java_tmpfs_t)
33typealias java_tmpfs_t alias { staff_javaplugin_tmpfs_t user_javaplugin_tmpfs_t sysadm_javaplugin_tmpfs_t };
34typealias java_tmpfs_t alias { auditadm_tmpfs_javaplugin_t secadm_tmpfs_javaplugin_t };
35
36type unconfined_java_t;
37init_system_domain(unconfined_java_t, java_exec_t)
46c69cb2
CP
38
39########################################
40#
41# Local policy
42#
43
296273a7
CP
44allow java_t self:process { signal_perms getsched setsched execmem };
45allow java_t self:fifo_file rw_fifo_file_perms;
46allow java_t self:tcp_socket create_socket_perms;
47allow java_t self:udp_socket create_socket_perms;
48
49manage_dirs_pattern(java_t, java_tmp_t, java_tmp_t)
50manage_files_pattern(java_t, java_tmp_t, java_tmp_t)
4fd08891 51files_tmp_filetrans(java_t, java_tmp_t, { file dir })
296273a7
CP
52
53manage_files_pattern(java_t, java_tmpfs_t, java_tmpfs_t)
54manage_lnk_files_pattern(java_t, java_tmpfs_t, java_tmpfs_t)
55manage_fifo_files_pattern(java_t, java_tmpfs_t, java_tmpfs_t)
56manage_sock_files_pattern(java_t, java_tmpfs_t, java_tmpfs_t)
57fs_tmpfs_filetrans(java_t, java_tmpfs_t, { file lnk_file sock_file fifo_file })
58
59can_exec(java_t, java_exec_t)
60
61kernel_read_all_sysctls(java_t)
62kernel_search_vm_sysctl(java_t)
63kernel_read_network_state(java_t)
64kernel_read_system_state(java_t)
65
66# Search bin directory under java for java executable
67corecmd_search_bin(java_t)
68
69corenet_all_recvfrom_unlabeled(java_t)
70corenet_all_recvfrom_netlabel(java_t)
71corenet_tcp_sendrecv_generic_if(java_t)
72corenet_udp_sendrecv_generic_if(java_t)
c1262146
CP
73corenet_tcp_sendrecv_generic_node(java_t)
74corenet_udp_sendrecv_generic_node(java_t)
296273a7
CP
75corenet_tcp_sendrecv_all_ports(java_t)
76corenet_udp_sendrecv_all_ports(java_t)
77corenet_tcp_connect_all_ports(java_t)
78corenet_sendrecv_all_client_packets(java_t)
79
80dev_read_sound(java_t)
81dev_write_sound(java_t)
82dev_read_urand(java_t)
83dev_read_rand(java_t)
4fd08891 84dev_dontaudit_append_rand(java_t)
296273a7
CP
85
86files_read_etc_files(java_t)
87files_read_usr_files(java_t)
88files_search_home(java_t)
89files_search_var_lib(java_t)
90files_read_etc_runtime_files(java_t)
91# Read global fonts and font config
92files_read_etc_files(java_t)
93
94fs_getattr_xattr_fs(java_t)
95fs_dontaudit_rw_tmpfs_files(java_t)
96
97logging_send_syslog_msg(java_t)
98
99miscfiles_read_localization(java_t)
100# Read global fonts and font config
101miscfiles_read_fonts(java_t)
102
103sysnet_read_config(java_t)
104
105userdom_dontaudit_use_user_terminals(java_t)
106userdom_dontaudit_setattr_user_home_content_files(java_t)
107userdom_dontaudit_exec_user_home_content_files(java_t)
108userdom_manage_user_home_content_dirs(java_t)
109userdom_manage_user_home_content_files(java_t)
110userdom_manage_user_home_content_symlinks(java_t)
111userdom_manage_user_home_content_pipes(java_t)
112userdom_manage_user_home_content_sockets(java_t)
113userdom_user_home_dir_filetrans_user_home_content(java_t, { file lnk_file sock_file fifo_file })
114userdom_write_user_tmp_sockets(java_t)
115
116tunable_policy(`allow_java_execstack',`
117 allow java_t self:process execstack;
118
119 allow java_t java_tmp_t:file execute;
6b19be33 120
296273a7
CP
121 libs_legacy_use_shared_libs(java_t)
122 libs_legacy_use_ld_so(java_t)
123
124 miscfiles_legacy_read_localization(java_t)
125')
126
127optional_policy(`
128 nis_use_ypbind(java_t)
129')
6b19be33 130
350b6ab7 131optional_policy(`
296273a7
CP
132 nscd_socket_use(java_t)
133')
134
135optional_policy(`
136 xserver_user_x_domain_template(java, java_t, java_tmpfs_t)
137')
138
139########################################
140#
141# Unconfined java local policy
142#
143
144optional_policy(`
145 # execheap is needed for itanium/BEA jrocket
146 allow unconfined_java_t self:process { execstack execmem execheap };
147
148 init_dbus_chat_script(unconfined_java_t)
149
84940a09
CP
150 files_execmod_all_files(unconfined_java_t)
151
152 init_dbus_chat_script(unconfined_java_t)
153
296273a7
CP
154 unconfined_domain_noaudit(unconfined_java_t)
155 unconfined_dbus_chat(unconfined_java_t)
84940a09
CP
156
157 optional_policy(`
158 rpm_domtrans(unconfined_java_t)
159 ')
46c69cb2 160')