<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><span style="font-family:arial,sans-serif;color:rgb(34,34,34)">On Wed, Aug 16, 2017 at 2:13 PM, Denis Kudriashov </span><span dir="ltr" style="font-family:arial,sans-serif;color:rgb(34,34,34)"><<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>></span><span style="font-family:arial,sans-serif;color:rgb(34,34,34)"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">2017-08-16 13:52 GMT+02:00 Bert Freudenberg <span dir="ltr"><<a href="mailto:bert@freudenbergs.de" target="_blank">bert@freudenbergs.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr"><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)"><span style="font-family:arial,sans-serif;color:rgb(34,34,34)">On Wed, Aug 16, 2017 at 1:36 PM, Denis Kudriashov </span><span dir="ltr" style="font-family:arial,sans-serif;color:rgb(34,34,34)"><<a href="mailto:dionisiydk@gmail.com" target="_blank">dionisiydk@gmail.com</a>></span><span style="font-family:arial,sans-serif;color:rgb(34,34,34)"> wrote:</span><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Eliot.<span><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(0,0,0);font-size:12.8px">I asked David why he didn't add it to the SocketPlugin in the first place and he discussed Andreas Rabb's security concerns</span></blockquote><div><span style="color:rgb(0,0,0);font-size:12.8px"><br></span></div></span><div>It would be interesting to read about them because it looks strange that it is secure to manage OS handle from VM but not secure to manage it from image side. Both ways are requested by user directly or indirectly which means that user has OS permissions. So what the difference?</div></div></blockquote><div><br></div><div style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​It's for when yo​u want to allow arbitrary code to be executed in the image, yet still protect the machine from harm. This happens when sharing objects between images - an object could have malicious code attached. So in that case, before running the code, we turn on the VM file sandbox via the SecurityPlugin. This ensures that the image can only access files in a sandbox directory but not outside. But it only works if the FilePlugin is the only way to access files - meaning FFI and OSProcess etc. must be disabled, and there must not be another way to create file handles.</div></div></div></div></blockquote><div><br></div><div>Thank's Bert. It is clear but I wonder how it can really work. Because if you are able turn on/off VM file sandbox during image runtime then how system prevents arbitrary code to turn off this security back to perform bad actions?</div></div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​It cannot be turned off once the sandbox is enabled. You will have to restart the image.​</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>And if it is static setting for whole image session then why it is really useful? OS security solves all these issues.</div></div></div></div></blockquote><div><br></div><div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">​10 years ago OS security was really bad. ​Sandboxing applications from each other only just started to become mainstream back then - the OLPC's Sugar OS with Ivan Krstić's "bitfrost" was one of the first, Apple iOS and Android followed, then Mac OS X and Windows. But our VMs still do not use the OS security capabilities - they usually run with the same privileges as the user that is logged in, meaning they can read or even delete all the user's files.</font></div></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">It would be good to make the VM use these modern security features, but I don't know of any plan to do so (maybe apart from the iOS and Android VMs, where the system won't even allow to run an old app).</font></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif"><br></font></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I ask because I have no idea about SecurityPlugin. So maybe you will point me to some doc.</div></div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​I don't know of any docs beyond the SecurityManager class, which has some comments in its methods. I guess it could use a nice class comment. But in essence it is very simple - some VM capabilities (namely file access, socket access, and image write) can be disabled, and there is no way of re-enabling them.</div></div><div><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small;color:rgb(0,0,0)">​- Bert -​</div></div><br></div></div>