diff --git a/gpu-operator/security.rst b/gpu-operator/security.rst index 319100acf..32d4ac4bc 100644 --- a/gpu-operator/security.rst +++ b/gpu-operator/security.rst @@ -1,11 +1,46 @@ ***************************** -Security Considerations -***************************** - - -Pod Security Context of the Operator and Operands -================================================= +Security Considerations +***************************** + + +Preventing Unprivileged GPU Access +================================== + +By default, a container can request GPU access by setting the +``NVIDIA_VISIBLE_DEVICES`` environment variable, even when it does not request +an ``nvidia.com/gpu`` resource. This can allow an unprivileged workload to +access more GPUs than the Kubernetes device plugin allocated to it. + +Cluster administrators can prevent this configuration by making the NVIDIA +Container Toolkit accept the device list only from the device plugin. Add the +following values during GPU Operator installation or upgrade: + +.. code-block:: yaml + + toolkit: + env: + - name: ACCEPT_NVIDIA_VISIBLE_DEVICES_ENVVAR_WHEN_UNPRIVILEGED + value: "false" + - name: ACCEPT_NVIDIA_VISIBLE_DEVICES_AS_VOLUME_MOUNTS + value: "true" + devicePlugin: + env: + - name: DEVICE_LIST_STRATEGY + value: volume-mounts + +This configuration assumes that the cluster's security policy does not allow +unprivileged workloads to create arbitrary host volume mounts. Review the +resulting pod security policy and admission controls before enabling it. + +Privileged containers can still access all GPUs on a node. Restrict access to +the Operator namespace and avoid granting privileged access to ordinary +workloads. Components that need access to all GPUs, such as the device plugin +and DCGM Exporter, should be treated as infrastructure workloads. + + +Pod Security Context of the Operator and Operands +================================================= Several of the NVIDIA GPU Operator operands, such as the driver containers and container toolkit, require the following elevated privileges: @@ -27,8 +62,9 @@ As a best practice, establish proper security policies and prevent any other use CVEs ================================================= -The following is a list of known CVEs in the GPU Operator or its operands. -To view any published security bulletins for NVIDIA products published security bulletins for NVIDIA products, refer to the NVIDIA product security page at https://www.nvidia.com/en-us/security/. +The following is a list of known CVEs in the GPU Operator or its operands. +To view published security bulletins for NVIDIA products, refer to the +`NVIDIA product security page `_. .. list-table:: CVEs :widths: 20 45 35 @@ -96,4 +132,5 @@ To view any published security bulletins for NVIDIA products published security Report a Vulnerability ----------------------------- -For details on reporting a suspected vulnerability, refer to the `GPU Operator Security policies `_ page. +For details on reporting a suspected vulnerability, refer to the `GPU Operator +Security policy `_.