@@ -144,6 +144,7 @@ template(`virt_driver_template',`
144144 read_files_pattern($1_t, virt_etc_t, virt_etc_t)
145145 manage_dirs_pattern($1_t, virt_etc_rw_t, virt_etc_rw_t)
146146 manage_files_pattern($1_t, virt_etc_rw_t, virt_etc_rw_t)
147+ filetrans_pattern($1_t, virt_etc_t, virt_etc_rw_t, dir)
147148
148149 allow virt_driver_domain virtqemud_t:unix_stream_socket connectto;
149150 read_files_pattern(virt_driver_domain, virtqemud_t, virtqemud_t)
@@ -164,6 +165,11 @@ template(`virt_driver_template',`
164165 miscfiles_read_generic_certs($1_t)
165166
166167 optional_policy(`
168+ dbus_system_bus_client($1_t)
169+ ')
170+
171+ optional_policy(`
172+ systemd_dbus_chat_logind($1_t)
167173 systemd_write_inhibit_pipes($1_t)
168174 ')
169175')
@@ -202,6 +208,7 @@ interface(`virt_image',`
202208#
203209interface(`virt_getattr_exec',`
204210 gen_require(`
211+ attribute virt_driver_executable;
205212 type virtd_exec_t;
206213 ')
207214
@@ -239,6 +246,7 @@ interface(`virt_domtrans',`
239246#
240247interface(`virt_exec',`
241248 gen_require(`
249+ attribute virt_driver_executable;
242250 type virtd_exec_t;
243251 ')
244252
@@ -268,6 +276,26 @@ interface(`virt_stream_connect',`
268276 stream_connect_pattern($1, virt_driver_var_run, virt_driver_var_run, virt_driver_domain)
269277')
270278
279+ ########################################
280+ ## <summary>
281+ ## Read and write to virt_domain unix
282+ ## stream sockets.
283+ ## </summary>
284+ ## <param name="domain">
285+ ## <summary>
286+ ## Domain allowed access.
287+ ## </summary>
288+ ## </param>
289+ #
290+ interface(`virt_rw_stream_sockets_virt_domain',`
291+ gen_require(`
292+ attribute virt_domain;
293+ ')
294+
295+ allow $1 virt_domain:unix_stream_socket { read write };
296+ ')
297+
298+
271299#######################################
272300## <summary>
273301## Connect to svirt process over a unix domain stream socket.
@@ -1252,7 +1280,7 @@ interface(`virt_signal',`
12521280#
12531281interface(`virt_signull',`
12541282 gen_require(`
1255- virt_driver_domain;
1283+ attribute virt_driver_domain;
12561284 type virtd_t;
12571285 ')
12581286
@@ -1402,6 +1430,43 @@ interface(`virt_dontaudit_read_chr_dev',`
14021430 dontaudit $1 virt_image_type:chr_file read_chr_file_perms;
14031431')
14041432
1433+ ########################################
1434+ ## <summary>
1435+ ## Make the specified type usable as a virt file type
1436+ ## </summary>
1437+ ## <param name="type">
1438+ ## <summary>
1439+ ## Type to be used as a virt file type
1440+ ## </summary>
1441+ ## </param>
1442+ #
1443+ interface(`virt_file_types',`
1444+ gen_require(`
1445+ attribute virt_file_type;
1446+ ')
1447+
1448+ typeattribute $1 virt_file_type;
1449+ ')
1450+
1451+ ########################################
1452+ ## <summary>
1453+ ## Make the specified type usable as a svirt file type
1454+ ## </summary>
1455+ ## <param name="type">
1456+ ## <summary>
1457+ ## Type to be used as a svirt file type
1458+ ## </summary>
1459+ ## </param>
1460+ #
1461+ interface(`svirt_file_types',`
1462+ gen_require(`
1463+ attribute svirt_file_type;
1464+ ')
1465+
1466+ typeattribute $1 svirt_file_type;
1467+ ')
1468+
1469+
14051470########################################
14061471## <summary>
14071472## Creates types and rules for a basic
@@ -1472,6 +1537,24 @@ template(`virt_sandbox_net_domain',`
14721537 typeattribute $1 sandbox_net_domain;
14731538')
14741539
1540+ ########################################
1541+ ## <summary>
1542+ ## Make the specified type usable as a virt system domain
1543+ ## </summary>
1544+ ## <param name="type">
1545+ ## <summary>
1546+ ## Type to be used as a virt system domain
1547+ ## </summary>
1548+ ## </param>
1549+ #
1550+ interface(`virt_system_domain_type',`
1551+ gen_require(`
1552+ attribute virt_system_domain;
1553+ ')
1554+
1555+ typeattribute $1 virt_system_domain;
1556+ ')
1557+
14751558########################################
14761559## <summary>
14771560## Execute a qemu_exec_t in the callers domain
@@ -1802,6 +1885,26 @@ interface(`virt_dgram_send',`
18021885 dgram_send_pattern($1, virt_var_run_t, virt_var_run_t, virtd_t)
18031886')
18041887
1888+ ########################################
1889+ ## <summary>
1890+ ## Manage svirt home files,dirs and sockfiles.
1891+ ## </summary>
1892+ ## <param name="domain">
1893+ ## <summary>
1894+ ## Domain allowed access.
1895+ ## </summary>
1896+ ## </param>
1897+ #
1898+ interface(`virt_svirt_manage_home',`
1899+ gen_require(`
1900+ type svirt_home_t;
1901+ ')
1902+
1903+ manage_files_pattern($1, svirt_home_t, svirt_home_t)
1904+ manage_dirs_pattern($1, svirt_home_t, svirt_home_t)
1905+ manage_sock_files_pattern($1, svirt_home_t, svirt_home_t)
1906+ ')
1907+
18051908########################################
18061909## <summary>
18071910## Manage svirt tmp files,dirs and sockfiles.
0 commit comments