]> git.ipfire.org Git - people/stevee/selinux-policy.git/blame - refpolicy/policy/modules/system/xen.te
add rssh, bug 1544
[people/stevee/selinux-policy.git] / refpolicy / policy / modules / system / xen.te
CommitLineData
a3cf80d8 1
cdc86ee5 2policy_module(xen,1.0.1)
a3cf80d8
CP
3
4########################################
5#
6# Declarations
7#
8
9# console ptys
10type xen_devpts_t;
11term_pty(xen_devpts_t);
12files_type(xen_devpts_t);
13
14type xend_t;
15type xend_exec_t;
16domain_type(xend_t)
17init_daemon_domain(xend_t, xend_exec_t)
18
19# var/lib files
20type xend_var_lib_t;
21files_type(xend_var_lib_t)
cdc86ee5
CP
22# for mounting an NFS store
23files_mountpoint(xend_var_lib_t)
a3cf80d8
CP
24
25# log files
26type xend_var_log_t;
27logging_log_file(xend_var_log_t)
28
29# pid files
30type xend_var_run_t;
31files_pid_file(xend_var_run_t)
32
33type xenstored_t;
34type xenstored_exec_t;
35domain_type(xenstored_t)
36domain_entry_file(xenstored_t,xenstored_exec_t)
37role system_r types xenstored_t;
38
39# var/lib files
40type xenstored_var_lib_t;
41files_type(xenstored_var_lib_t)
42
43# pid files
44type xenstored_var_run_t;
45files_pid_file(xenstored_var_run_t)
46
47type xenconsoled_t;
48type xenconsoled_exec_t;
49domain_type(xenconsoled_t)
50domain_entry_file(xenconsoled_t,xenconsoled_exec_t)
51role system_r types xenconsoled_t;
52
53# pid files
54type xenconsoled_var_run_t;
55files_pid_file(xenconsoled_var_run_t)
56
57########################################
58#
59# xend local policy
60#
61
62allow xend_t self:capability { dac_override ipc_lock net_admin setuid sys_nice sys_tty_config };
63allow xend_t self:process { signal sigkill };
64# internal communication is often done using fifo and unix sockets.
65allow xend_t self:fifo_file rw_file_perms;
66allow xend_t self:unix_stream_socket create_stream_socket_perms;
67allow xend_t self:unix_dgram_socket create_socket_perms;
68allow xend_t self:netlink_route_socket r_netlink_socket_perms;
69allow xend_t self:tcp_socket create_stream_socket_perms;
70allow xend_t self:packet_socket create_socket_perms;
71
72# pid file
73allow xend_t xend_var_run_t:file manage_file_perms;
74allow xend_t xend_var_run_t:sock_file manage_file_perms;
75allow xend_t xend_var_run_t:dir rw_dir_perms;
76files_pid_filetrans(xend_t,xend_var_run_t, { file sock_file })
77
78# log files
79allow xend_t xend_var_log_t:file create_file_perms;
80allow xend_t xend_var_log_t:sock_file create_file_perms;
81allow xend_t xend_var_log_t:dir { rw_dir_perms setattr };
82logging_log_filetrans(xend_t,xend_var_log_t,{ sock_file file dir })
83
84# var/lib files for xend
85allow xend_t xend_var_lib_t:file create_file_perms;
86allow xend_t xend_var_lib_t:sock_file create_file_perms;
87allow xend_t xend_var_lib_t:dir create_dir_perms;
88files_var_lib_filetrans(xend_t,xend_var_lib_t,{ file dir sock_file })
89
90# transition to store
91domain_auto_trans(xend_t, xenstored_exec_t, xenstored_t)
92allow xenstored_t xend_t:fd use;
93allow xenstored_t xend_t:process sigchld;
94allow xenstored_t xend_t:fifo_file write;
95
96# transition to console
97domain_auto_trans(xend_t, xenconsoled_exec_t, xenconsoled_t)
98allow xenconsoled_t xend_t:fd use;
99
100kernel_read_kernel_sysctls(xend_t)
101kernel_read_system_state(xend_t)
102kernel_write_xen_state(xend_t)
103kernel_read_xen_state(xend_t)
104kernel_rw_net_sysctls(xend_t)
105kernel_read_network_state(xend_t)
106
107corecmd_exec_sbin(xend_t)
108corecmd_exec_bin(xend_t)
109corecmd_exec_shell(xend_t)
110
111corenet_tcp_sendrecv_all_if(xend_t)
112corenet_tcp_sendrecv_all_nodes(xend_t)
113corenet_tcp_sendrecv_all_ports(xend_t)
114corenet_non_ipsec_sendrecv(xend_t)
115corenet_tcp_bind_xen_port(xend_t)
116corenet_tcp_bind_soundd_port(xend_t)
117
118dev_read_urand(xend_t)
119dev_manage_xen(xend_t)
120dev_filetrans_xen(xend_t)
121dev_rw_sysfs(xend_t)
122
123domain_read_all_domains_state(xend_t)
124domain_dontaudit_read_all_domains_state(xend_t)
125
126files_read_etc_files(xend_t)
cdc86ee5 127files_read_kernel_symbol_table(xend_t)
a3cf80d8
CP
128
129storage_raw_read_fixed_disk(xend_t)
130
131term_dontaudit_getattr_all_user_ptys(xend_t)
132term_dontaudit_use_generic_ptys(xend_t)
133
134init_use_fds(xend_t)
135
136libs_use_ld_so(xend_t)
137libs_use_shared_libs(xend_t)
138
139logging_send_syslog_msg(xend_t)
140
141miscfiles_read_localization(xend_t)
142
143sysnet_domtrans_dhcpc(xend_t)
144sysnet_signal_dhcpc(xend_t)
145sysnet_domtrans_ifconfig(xend_t)
146sysnet_dns_name_resolve(xend_t)
147sysnet_delete_dhcpc_pid(xend_t)
148sysnet_read_dhcpc_pid(xend_t)
149
150consoletype_exec(xend_t)
151
152xen_stream_connect_xenstore(xend_t)
153
154########################################
155#
156# Xen console local policy
157#
158
159allow xenconsoled_t self:capability { dac_override fsetid ipc_lock };
160allow xenconsoled_t self:unix_stream_socket create_stream_socket_perms;
161allow xenconsoled_t self:fifo_file { read write };
162
163allow xenconsoled_t xen_devpts_t:chr_file rw_term_perms;
164
165# pid file
166allow xenconsoled_t xenconsoled_var_run_t:file manage_file_perms;
167allow xenconsoled_t xenconsoled_var_run_t:sock_file manage_file_perms;
168allow xenconsoled_t xenconsoled_var_run_t:dir rw_dir_perms;
169files_pid_filetrans(xenconsoled_t,xenconsoled_var_run_t, { file sock_file })
170
171kernel_read_kernel_sysctls(xenconsoled_t)
172kernel_write_xen_state(xenconsoled_t)
173kernel_read_xen_state(xenconsoled_t)
174
175term_create_pty(xenconsoled_t,xen_devpts_t);
176term_dontaudit_use_generic_ptys(xenconsoled_t)
177
178init_use_fds(xenconsoled_t)
179
180libs_use_ld_so(xenconsoled_t)
181libs_use_shared_libs(xenconsoled_t)
182
183miscfiles_read_localization(xenconsoled_t)
184
185xen_append_log(xenconsoled_t)
186xen_stream_connect_xenstore(xenconsoled_t)
187
188########################################
189#
190# Xen store local policy
191#
192
193allow xenstored_t self:capability { dac_override mknod ipc_lock };
194allow xenstored_t self:unix_stream_socket create_stream_socket_perms;
195
196# pid file
197allow xenstored_t xenstored_var_run_t:file manage_file_perms;
198allow xenstored_t xenstored_var_run_t:sock_file manage_file_perms;
199allow xenstored_t xenstored_var_run_t:dir rw_dir_perms;
200files_pid_filetrans(xenstored_t,xenstored_var_run_t, { file sock_file })
201
202# var/lib files for xenstored
203allow xenstored_t xenstored_var_lib_t:file create_file_perms;
204allow xenstored_t xenstored_var_lib_t:sock_file create_file_perms;
205allow xenstored_t xenstored_var_lib_t:dir create_dir_perms;
206files_var_lib_filetrans(xenstored_t,xenstored_var_lib_t,{ file dir sock_file })
207
208kernel_write_xen_state(xenstored_t)
209kernel_read_xen_state(xenstored_t)
210
211dev_create_generic_dirs(xenstored_t)
212dev_manage_xen(xenconsoled_t)
213dev_filetrans_xen(xenstored_t)
cdc86ee5 214dev_rw_xen(xenstored_t)
a3cf80d8
CP
215
216term_dontaudit_use_generic_ptys(xenstored_t)
217
218init_use_fds(xenstored_t)
219
220libs_use_ld_so(xenstored_t)
221libs_use_shared_libs(xenstored_t)
222
223miscfiles_read_localization(xenstored_t)
224
225xen_append_log(xenstored_t)