在我的服务器上运行其他人代码(沙箱)的安全方式? [英] Secure way to run other people code (sandbox) on my server?

查看:35
本文介绍了在我的服务器上运行其他人代码(沙箱)的安全方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个在本地运行其他人代码的网络服务.自然地,我想限制他们的代码对某个沙箱"的访问.目录,这样他们就无法连接到我服务器的其他部分(数据库、主网络服务器等)

I want to make a web service that runs other people's code locally. Naturally, I want to limit their code's access to a certain "sandbox" directory, so that they won't be able to connect to other parts of my server (DB, main webserver, etc.)

最好的方法是什么?

运行 VMware/Virtualbox:

  • + 我想它是最安全的.即使有人设法入侵",他们也只会入侵访客机器

  • + I guess it's as secure as it gets. Even if someone manage to "hack", they only hack the guest machine

+ 可以限制 CPU &进程使用的内存

+ Can limit the CPU & memory the processes use

+ 易于设置 - 只需创建 VM

+ Easy to set up - just create the VM

- 更难连接";从host到guest的沙箱目录

- Harder to "connect" the sandbox directory from the host to the guest

- 浪费额外的内存和 CPU 来管理虚拟机

- Wasting extra memory and CPU for managing the VM

运行非特权用户:

  • + 不浪费额外资源

  • + Doesn't waste extra resources

+ Sandbox 目录只是一个普通目录

+ Sandbox directory is just a plain directory

?不能限制CPU和内存?

? Can't limit CPU and memory?

?不知道是否足够安全

还有其他方法吗?

运行 Fedora Core 8 的服务器,其他"服务器用Java编写的代码&C++

Server running Fedora Core 8, the "other" codes written in Java & C++

推荐答案

  1. 在非特权用户下运行仍然允许本地攻击者利用提升权限的漏洞.
  2. 允许在虚拟机中执行代码也是不安全的;攻击者可以访问主机系统,如最近的 VMWare 漏洞报告已显示.

在我看来,从安全的角度来看,首先允许在您的系统上运行本机代码并不是一个好主意.也许您应该重新考虑允许他们运行本机代码,这肯定会降低风险.

In my opinion, allowing running native code on your system in the first place is not a good idea from security point of view. Maybe you should reconsider allowing them to run native code, this will certainly reduce the risk.

这篇关于在我的服务器上运行其他人代码(沙箱)的安全方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆