-
Notifications
You must be signed in to change notification settings - Fork 0
/
oracle.te
190 lines (154 loc) · 5.77 KB
/
oracle.te
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
policy_module(oracle, 1.0.2)
# Intended to be started by oracle_u:staff_r:staff_t, not via init or systemd
require {
type oracle_port_t;
type xauth_t;
type staff_t;
role staff_r;
}
## Declarations
### Domains
## oracle domain
type oracle_exec_t;
userdom_login_user_template(oracle)
application_domain(oracle_t, oracle_exec_t)
permissive oracle_t;
## oracle listener domain
type oracle_lsnr_exec_t;
userdom_login_user_template(oracle_lsnr)
application_domain(oracle_lsnr_t, oracle_lsnr_exec_t)
permissive oracle_lsnr_t;
### Contents
type oracle_lib_t;
files_type(oracle_lib_t)
type oracle_db_t;
files_type(oracle_db_t)
type oracle_home_t;
userdom_user_home_content(oracle_home_t)
userdom_dontaudit_search_user_home_content(oracle_home_t)
type oracle_conf_t;
files_config_file(oracle_conf_t)
type oracle_log_t;
logging_log_file(oracle_log_t)
## Interface Policy
### oracle_t
corecmd_exec_bin(oracle_t)
corenet_tcp_connect_http_port(oracle_t)
corenet_tcp_connect_oracle_port(oracle_t)
corenet_udp_bind_generic_port(oracle_t)
dev_read_kmsg(oracle_t)
dev_rwx_zero(oracle_t)
domain_user_exemption_target(oracle_t)
fs_read_cgroup_files(oracle_t)
files_read_default_symlinks(oracle_t)
files_list_kernel_modules(oracle_t)
files_list_isid_type_dirs(oracle_t)
files_read_isid_type_files(oracle_t)
init_read_utmp(oracle_t)
init_read_state(oracle_t)
init_status(oracle_t)
kernel_list_proc(oracle_t)
kernel_get_sysvipc_info(oracle_t)
kernel_read_ring_buffer(oracle_t)
kernel_read_state(oracle_t)
kernel_read_system_state(oracle_t)
kernel_read_network_state(oracle_t)
kernel_request_load_module(oracle_t)
libs_legacy_use_ld_so(oracle_t)
lvm_exec(oracle_t)
logging_read_audit_log(oracle_t)
logging_read_syslog_pid(oracle_t)
miscfiles_read_hwdata(oracle_t)
modutils_list_module_config(oracle_t)
mount_run(oracle_t, oracle_r)
networkmanager_read_state(oracle_t)
storage_getattr_fixed_disk_dev(oracle_t)
oracle_lsnr_list_proc(oracle_t)
oracle_use_libs(oracle_t)
rhnsd_initrc_domtrans(oracle_t)
sysnet_read_config(oracle_t)
userdom_list_all_user_home_content(oracle_t)
modutils_read_module_deps(oracle_t)
### oracle_lsnr_t
corenet_tcp_bind_unreserved_ports(oracle_lsnr_t)
corenet_tcp_connect_unreserved_ports(oracle_lsnr_t)
domain_user_exemption_target(oracle_lsnr_t)
files_manage_isid_type_files(oracle_lsnr_t)
files_read_default_symlinks(oracle_lsnr_t)
files_rw_isid_type_dirs(oracle_lsnr_t)
init_read_utmp(oracle_lsnr_t)
kernel_read_network_state(oracle_lsnr_t)
oracle_list_proc(oracle_lsnr_t)
oracle_use_libs(oracle_lsnr_t)
sysnet_read_config(oracle_lsnr_t)
### staff_t
domain_role_change_exemption(staff_t)
oracle_noatsecure(staff_t)
oracle_nosuid_transition(staff_t)
oracle_exec_roletrans_from(staff_r, staff_t)
oracle_lsnr_exec_roletrans_from(staff_r, staff_t)
userdom_list_all_user_home_content(staff_t)
## Local Policy
#============= oracle_t ==============
allow oracle_t self:capability { chown setgid setuid sys_rawio net_bind_service audit_write sys_nice sys_chroot net_raw dac_override };
allow oracle_t self:process { fork ptrace setpgid setrlimit signal_perms execmem getattr setsched };
allow oracle_t self:key write;
allow oracle_t self:fifo_file manage_fifo_file_perms;
allow oracle_t self:tcp_socket all_tcp_socket_perms;
allow oracle_t self:udp_socket all_udp_socket_perms;
allow oracle_t self:unix_dgram_socket all_unix_dgram_socket_perms;
allow oracle_t self:unix_stream_socket all_unix_stream_socket_perms;
allow oracle_t self:netlink_route_socket rw_netlink_socket_perms;
allow oracle_t self:rawip_socket { rw_socket_perms create };
allow oracle_t proc_t:file { getattr open read };
allow oracle_t oracle_conf_t:dir manage_dir_perms;
allow oracle_t oracle_conf_t:file { manage_file_perms map };
allow oracle_t { oracle_log_t oracle_db_t }:dir manage_dir_perms;
allow oracle_t { oracle_log_t oracle_db_t }:file manage_file_perms;
allow oracle_t oracle_log_t:sock_file { create setattr unlink };
allow oracle_t oracle_lsnr_t:process signal;
allow oracle_t oracle_lsnr_t:unix_stream_socket connectto;
#============= oracle_lsnr_t ==============
allow oracle_lsnr_t self:netlink_route_socket all_netlink_route_socket_perms;
allow oracle_lsnr_t self:tcp_socket all_tcp_socket_perms;
allow oracle_lsnr_t oracle_port_t:tcp_socket all_tcp_socket_perms;
allow oracle_lsnr_t oracle_home_t:file { append map execute ioctl open read setattr };
allow oracle_lsnr_t oracle_db_t:dir search_dir_perms;
allow oracle_lsnr_t oracle_db_t:file rw_file_perms;
allow oracle_lsnr_t oracle_log_t:dir add_entry_dir_perms;
allow oracle_lsnr_t oracle_log_t:file manage_file_perms;
allow oracle_lsnr_t oracle_t:sem rw_sem_perms;
allow oracle_lsnr_t oracle_t:shm rw_shm_perms;
allow oracle_lsnr_t proc_t:file { getattr open read };
allow oracle_lsnr_t oracle_conf_t:dir search_dir_perms;
allow oracle_lsnr_t oracle_conf_t:file rw_file_perms;
#============= staff_t ==============
allow staff_t oracle_lib_t:dir search_dir_perms;
allow staff_t oracle_lib_t:file read_file_perms;
### Tunables
gen_tunable(enable_oracle_xauth, true)
tunable_policy(`enable_oracle_xauth',`
corenet_tcp_connect_xserver_port(oracle_t)
allow staff_t xauth_t:process { noatsecure rlimitinh siginh };
')
gen_tunable(enable_oracle_oem, false)
tunable_policy(`enable_oracle_oem',`
corenet_tcp_connect_http_port(oracle_t)
corenet_tcp_connect_echo_port(oracle_t)
corenet_tcp_connect_generic_port(oracle_t)
corenet_tcp_connect_http_cache_port(oracle_t)
allow oracle_t http_cache_port_t:tcp_socket { name_bind name_connect };
')
gen_tunable(enable_oracle_use_lvm, false)
tunable_policy(`enable_oracle_use_lvm', `
dev_getattr_lvm_control(oracle_t)
lvm_read_config(oracle_t)
')
optional_policy(`
gen_tunable(enable_oracle_use_dbus, false)
tunable_policy(`enable_oracle_use_dbus', `
init_dbus_chat(oracle_t)
dbus_send_system_bus(oracle_t)
dbus_stream_connect_system_dbusd(oracle_t)
')
')