<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 27 Apr 2021, at 13:34, Peng Tao via kata-dev <<a href="mailto:kata-dev@lists.katacontainers.io" class="">kata-dev@lists.katacontainers.io</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">On 2021/4/26 23:51, Stefan Hajnoczi wrote:</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">On Wed, Apr 14, 2021 at 07:41:32PM +0800, Peng Tao wrote:<br class=""><blockquote type="cite" class=""><br class=""><br class="">On 2021/4/14 16:37, Stefan Hajnoczi wrote:<br class=""><blockquote type="cite" class="">On Wed, Apr 14, 2021 at 11:41:41AM +0800, Peng Tao wrote:<br class=""><blockquote type="cite" class="">On 2021/4/12 22:46, Stefan Hajnoczi wrote:<br class=""><blockquote type="cite" class="">On Wed, Apr 07, 2021 at 05:07:05PM -0700, Eric Ernst wrote:<br class=""><blockquote type="cite" class="">On Thu, Apr 1, 2021 at 7:58 AM Stefan Hajnoczi <<a href="mailto:stefanha@redhat.com" class="">stefanha@redhat.com</a>> wrote:<br class=""><blockquote type="cite" class="">On Mon, Mar 29, 2021 at 04:49:31PM -0700, Eric Ernst wrote:<br class=""></blockquote></blockquote><br class="">BTW, one aspect of the draft that isn't clear to me:<br class=""><br class=""> the CSI driver will create a particular file, csiPlugin.json at the root of the volume on the host<br class=""><br class="">Can a malicious user put a csiPlugin.json file onto a persistent volume<br class="">and then attach it to a Kata-enabled container to get the runtime and/or<br class="">agent to execute mount commands either on the host or in the sandbox VM?<br class=""><br class=""></blockquote>It is possible but it violates the current kata threat model, which is<br class="">basically we'd have to trust the host. If a user is able to gain root<br class="">privilege on the host, he/she is capable of doing anything to kata.<br class=""><br class="">That said, it is indeed possible to mitigate this by using an RPC based<br class="">approach between csi and kata.<br class=""></blockquote><br class="">If the host is already compromised then I don't expect Kata to protect<br class="">anything.<br class=""><br class="">My question was about k8s persistent volumes. I wanted to check that the<br class="">csiPlugin.json file is not interpreted if present on a persistent<br class="">volume. It should only be interpreted when the CSI driver places it<br class="">there on the host. The text wasn't completely clear on whether the "root<br class="">of the volume on the host" refers to the contents of the persistent<br class="">volume itself (that's unsafe) or to the container runtime's host path<br class="">(that's safe).<br class=""><br class=""></blockquote><br class="">Ah, good point! Kata needs to differentiate between a PV containing a<br class="">csiPlugin.json file in it, and a CSI driver "hacked" host path. They are<br class="">both host directories from Kata's point of view.<br class=""><br class="">A possible method is to check if the host path is a mountpoint. Then<br class="">1. do not ever try to parse the csiPlugin.json file if it is a mountpoint,<br class="">and<br class="">2. require csi to ensure that the volume host directory is not a mountpoint<br class="">(IOW do not mount the volume to the host directory)<br class=""><br class="">wdyt?<br class=""></blockquote>It would be nice if there was an explicit way for kata-runtime to know<br class="">whether it's looking at a host directory set up by a CSI plugin or an<br class="">actual mounted PV.<br class=""></blockquote><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Hmm, an API based approach is a good candidate of such an explicit way.</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""></div></blockquote><div><br class=""></div><div>Isn't that what your "open a port to communicate with CSI" approach did?</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Cheers,</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Tao</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">The mount point trick sounds okay but I worry that maybe in some<br class="">environments the directory might be a mount point and that would result<br class="">in a false positive.<br class="">I don't have a specific suggestion though because I haven't looked at<br class="">this in detail.<br class="">> Stefan<br class=""></blockquote><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">kata-dev mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><a href="mailto:kata-dev@lists.katacontainers.io" class="">kata-dev@lists.katacontainers.io</a></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 18px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><a href="http://lists.katacontainers.io/cgi-bin/mailman/listinfo/kata-dev" class="">http://lists.katacontainers.io/cgi-bin/mailman/listinfo/kata-dev</a></span></div></blockquote></div><br class=""></body></html>