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
|
policy_module(uml, 2.2.0)
########################################
#
# Declarations
#
type uml_t;
type uml_exec_t;
typealias uml_t alias { user_uml_t staff_uml_t sysadm_uml_t };
typealias uml_t alias { auditadm_uml_t secadm_uml_t };
userdom_user_application_domain(uml_t, uml_exec_t)
type uml_ro_t;
typealias uml_ro_t alias { user_uml_ro_t staff_uml_ro_t sysadm_uml_ro_t };
typealias uml_ro_t alias { auditadm_uml_ro_t secadm_uml_ro_t };
userdom_user_home_content(uml_ro_t)
type uml_rw_t;
typealias uml_rw_t alias { user_uml_rw_t staff_uml_rw_t sysadm_uml_rw_t };
typealias uml_rw_t alias { auditadm_uml_rw_t secadm_uml_rw_t };
userdom_user_home_content(uml_rw_t)
type uml_tmp_t;
typealias uml_tmp_t alias { user_uml_tmp_t staff_uml_tmp_t sysadm_uml_tmp_t };
typealias uml_tmp_t alias { auditadm_uml_tmp_t secadm_uml_tmp_t };
userdom_user_tmp_file(uml_tmp_t)
type uml_tmpfs_t;
typealias uml_tmpfs_t alias { user_uml_tmpfs_t staff_uml_tmpfs_t sysadm_uml_tmpfs_t };
typealias uml_tmpfs_t alias { auditadm_uml_tmpfs_t secadm_uml_tmpfs_t };
userdom_user_tmpfs_file(uml_tmpfs_t)
type uml_devpts_t;
typealias uml_devpts_t alias { user_uml_devpts_t staff_uml_devpts_t sysadm_uml_devpts_t };
typealias uml_devpts_t alias { auditadm_uml_devpts_t secadm_uml_devpts_t };
term_pty(uml_devpts_t)
ubac_constrained(uml_devpts_t)
type uml_switch_t;
type uml_switch_exec_t;
init_daemon_domain(uml_switch_t, uml_switch_exec_t)
type uml_switch_var_run_t;
files_pid_file(uml_switch_var_run_t)
########################################
#
# Local policy
#
allow uml_t self:fifo_file rw_fifo_file_perms;
allow uml_t self:process { signal_perms ptrace };
allow uml_t self:unix_stream_socket create_stream_socket_perms;
allow uml_t self:unix_dgram_socket create_socket_perms;
# Use the network.
allow uml_t self:tcp_socket create_stream_socket_perms;
allow uml_t self:udp_socket create_socket_perms;
allow uml_t self:tun_socket create;
# for mconsole
allow uml_t self:unix_dgram_socket sendto;
# allow the UML thing to happen
allow uml_t uml_devpts_t:chr_file { rw_file_perms setattr };
term_create_pty(uml_t, uml_devpts_t)
manage_dirs_pattern(uml_t, uml_tmp_t, uml_tmp_t)
manage_files_pattern(uml_t, uml_tmp_t, uml_tmp_t)
files_tmp_filetrans(uml_t, uml_tmp_t, { file dir })
can_exec(uml_t, uml_tmp_t)
manage_files_pattern(uml_t, uml_tmpfs_t, uml_tmpfs_t)
manage_lnk_files_pattern(uml_t, uml_tmpfs_t, uml_tmpfs_t)
manage_fifo_files_pattern(uml_t, uml_tmpfs_t, uml_tmpfs_t)
manage_sock_files_pattern(uml_t, uml_tmpfs_t, uml_tmpfs_t)
fs_tmpfs_filetrans(uml_t, uml_tmpfs_t, { file lnk_file sock_file fifo_file })
can_exec(uml_t, uml_tmpfs_t)
# access config files
allow uml_t { uml_ro_t uml_ro_t }:dir list_dir_perms;
read_files_pattern(uml_t, { uml_ro_t uml_ro_t }, { uml_ro_t uml_ro_t })
read_lnk_files_pattern(uml_t, { uml_ro_t uml_ro_t }, { uml_ro_t uml_ro_t })
manage_dirs_pattern(uml_t, uml_rw_t, uml_rw_t)
manage_files_pattern(uml_t, uml_rw_t, uml_rw_t)
manage_lnk_files_pattern(uml_t, uml_rw_t, uml_rw_t)
manage_fifo_files_pattern(uml_t, uml_rw_t, uml_rw_t)
manage_sock_files_pattern(uml_t, uml_rw_t, uml_rw_t)
userdom_user_home_dir_filetrans(uml_t, uml_rw_t, { file lnk_file sock_file fifo_file })
can_exec(uml_t, { uml_exec_t uml_exec_t })
kernel_read_system_state(uml_t)
# for SKAS - need something better
kernel_write_proc_files(uml_t)
# for xterm
corecmd_exec_bin(uml_t)
corenet_all_recvfrom_unlabeled(uml_t)
corenet_all_recvfrom_netlabel(uml_t)
corenet_tcp_sendrecv_generic_if(uml_t)
corenet_udp_sendrecv_generic_if(uml_t)
corenet_tcp_sendrecv_generic_node(uml_t)
corenet_udp_sendrecv_generic_node(uml_t)
corenet_tcp_sendrecv_all_ports(uml_t)
corenet_udp_sendrecv_all_ports(uml_t)
corenet_tcp_connect_all_ports(uml_t)
corenet_sendrecv_all_client_packets(uml_t)
corenet_rw_tun_tap_dev(uml_t)
domain_use_interactive_fds(uml_t)
# for xterm
files_read_etc_files(uml_t)
files_dontaudit_read_etc_runtime_files(uml_t)
# putting uml data under /var is usual...
files_search_var(uml_t)
fs_getattr_xattr_fs(uml_t)
init_read_utmp(uml_t)
init_dontaudit_write_utmp(uml_t)
# for xterm
libs_exec_lib_files(uml_t)
# Inherit and use descriptors from newrole.
seutil_use_newrole_fds(uml_t)
# Use the network.
sysnet_read_config(uml_t)
userdom_use_user_terminals(uml_t)
userdom_attach_admin_tun_iface(uml_t)
optional_policy(`
nis_use_ypbind(uml_t)
')
optional_policy(`
virt_attach_tun_iface(uml_t)
')
########################################
#
# Local policy
#
dontaudit uml_switch_t self:capability sys_tty_config;
allow uml_switch_t self:process signal_perms;
allow uml_switch_t self:unix_dgram_socket create_socket_perms;
allow uml_switch_t self:unix_stream_socket create_stream_socket_perms;
manage_files_pattern(uml_switch_t, uml_switch_var_run_t, uml_switch_var_run_t)
manage_sock_files_pattern(uml_switch_t, uml_switch_var_run_t, uml_switch_var_run_t)
files_pid_filetrans(uml_switch_t, uml_switch_var_run_t, file)
kernel_read_kernel_sysctls(uml_switch_t)
kernel_list_proc(uml_switch_t)
kernel_read_proc_symlinks(uml_switch_t)
dev_read_sysfs(uml_switch_t)
domain_use_interactive_fds(uml_switch_t)
fs_getattr_all_fs(uml_switch_t)
fs_search_auto_mountpoints(uml_switch_t)
term_dontaudit_use_console(uml_switch_t)
init_use_fds(uml_switch_t)
init_use_script_ptys(uml_switch_t)
logging_send_syslog_msg(uml_switch_t)
miscfiles_read_localization(uml_switch_t)
userdom_dontaudit_use_unpriv_user_fds(uml_switch_t)
userdom_dontaudit_search_user_home_dirs(uml_switch_t)
optional_policy(`
seutil_sigchld_newrole(uml_switch_t)
')
optional_policy(`
udev_read_db(uml_switch_t)
')
|