aboutsummaryrefslogtreecommitdiff
path: root/docs/tools
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2022-02-08 15:48:13 -0500
committerDr. David Alan Gilbert <dgilbert@redhat.com>2022-02-17 17:22:26 +0000
commit963061dc11e762285a6c1825b9c09e48cc8c6f5f (patch)
tree5fbdd36aea6bef62612687d0480d3bbc4adc2320 /docs/tools
parenta675c9a600389d210882fd1511edc2be65d53cdc (diff)
downloadqemu-963061dc11e762285a6c1825b9c09e48cc8c6f5f.zip
qemu-963061dc11e762285a6c1825b9c09e48cc8c6f5f.tar.gz
qemu-963061dc11e762285a6c1825b9c09e48cc8c6f5f.tar.bz2
virtiofsd: Add an option to enable/disable security label
Provide an option "-o security_label/no_security_label" to enable/disable security label functionality. By default these are turned off. If enabled, server will indicate to client that it is capable of handling one security label during file creation. Typically this is expected to be a SELinux label. File server will set this label on the file. It will try to set it atomically wherever possible. But its not possible in all the cases. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Message-Id: <20220208204813.682906-11-vgoyal@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'docs/tools')
-rw-r--r--docs/tools/virtiofsd.rst32
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst
index 07ac0be..0c05602 100644
--- a/docs/tools/virtiofsd.rst
+++ b/docs/tools/virtiofsd.rst
@@ -104,6 +104,13 @@ Options
* posix_acl|no_posix_acl -
Enable/disable posix acl support. Posix ACLs are disabled by default.
+ * security_label|no_security_label -
+ Enable/disable security label support. Security labels are disabled by
+ default. This will allow client to send a MAC label of file during
+ file creation. Typically this is expected to be SELinux security
+ label. Server will try to set that label on newly created file
+ atomically wherever possible.
+
.. option:: --socket-path=PATH
Listen on vhost-user UNIX domain socket at PATH.
@@ -348,6 +355,31 @@ client arguments or lists returned from the host. This stops
the client seeing any 'security.' attributes on the server and
stops it setting any.
+SELinux support
+---------------
+One can enable support for SELinux by running virtiofsd with option
+"-o security_label". But this will try to save guest's security context
+in xattr security.selinux on host and it might fail if host's SELinux
+policy does not permit virtiofsd to do this operation.
+
+Hence, it is preferred to remap guest's "security.selinux" xattr to say
+"trusted.virtiofs.security.selinux" on host.
+
+"-o xattrmap=:map:security.selinux:trusted.virtiofs.:"
+
+This will make sure that guest and host's SELinux xattrs on same file
+remain separate and not interfere with each other. And will allow both
+host and guest to implement their own separate SELinux policies.
+
+Setting trusted xattr on host requires CAP_SYS_ADMIN. So one will need
+add this capability to daemon.
+
+"-o modcaps=+sys_admin"
+
+Giving CAP_SYS_ADMIN increases the risk on system. Now virtiofsd is more
+powerful and if gets compromised, it can do lot of damage to host system.
+So keep this trade-off in my mind while making a decision.
+
Examples
--------