sandbox

Can you run GUI applications in a Docker container?

烈酒焚心 提交于 2019-11-26 01:25:04
问题 How can you run GUI applications in a Docker container? Are there any images that set up vncserver or something so that you can - for example - add an extra speedbump sandbox around say Firefox? 回答1: You can simply install a vncserver along with Firefox :) I pushed an image, vnc/firefox, here: docker pull creack/firefox-vnc The image has been made with this Dockerfile: # Firefox over VNC # # VERSION 0.1 # DOCKER-VERSION 0.2 FROM ubuntu:12.04 # Make sure the package repository is up to date

How can I create a secure Lua sandbox?

和自甴很熟 提交于 2019-11-26 00:45:27
So Lua seems ideal for implementing secure "user scripts" inside my application. However, most examples of embedding lua seem to include loading all the standard libraries, including "io" and "package". So I can exclude those libs from my interpreter, but even the base library includes the functions "dofile" and "loadfile" which access the filesystem. How can I remove/block any unsafe functions like these, without just ending up with an interpreter that doesn't even have basic stuff like the "ipairs" function? Karl Voigtland You can set the function environment that you run the untrusted code

Is It Possible to Sandbox JavaScript Running In the Browser?

风流意气都作罢 提交于 2019-11-26 00:24:52
问题 I\'m wondering if it\'s possible to sandbox JavaScript running in the browser to prevent access to features that are normally available to JavaScript code running in an HTML page. For example, let\'s say I want to provide a JavaScript API for end users to let them define event handlers to be run when \"interesting events\" happen, but I don\'t want those users to access the properties and functions of the window object. Am I able to do this? In the simplest case, let\'s say I want to prevent

Reading file contents on the client-side in javascript in various browsers

点点圈 提交于 2019-11-25 23:17:10
问题 I\'m attempting to provide a script-only solution for reading the contents of a file on a client machine through a browser. I have a solution that works with Firefox and Internet Explorer. It\'s not pretty, but I\'m only trying things at the moment: function getFileContents() { var fileForUpload = document.forms[0].fileForUpload; var fileName = fileForUpload.value; if (fileForUpload.files) { var fileContents = fileForUpload.files.item(0).getAsBinary(); document.forms[0].fileContents.innerHTML