如何安全地执行C code [英] how to execute c code securely

查看:84
本文介绍了如何安全地执行C code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这种情况下,用户将通过浏览器提交他/她的C code到我的服务器。
然后code将被编译和我的服务器上执行,并输出将被发送给用户。

In this scenario the user will submit his/her C code to my server through a browser. The code will then be compiled and executed on my server and the output will be sent to the user.

由于用户可以提交任何code(包括病毒,或者其他故障code)。我将不得不采取的照顾。

Since the user can submit any code (including Viruses, or other malfunctioning code). I will have to take care of that.

所以我的问题是,我怎么能保护我的服务器从这样code?

So my question is, how can I secure my server from such code?

推荐答案

我不能回答你的Windows - 我可以告诉你的Linux

I cannot answer you for windows -- I can tell you for linux.

这是有着非常复杂的问题。你需要考虑到:

This is an extremly complex problem. You need to think to:


  • 配额限制

  • 过程编译/执行code被拼命地跑作为非特权用户。

  • 请不要允许运行超过N秒的过程

  • 不允许进程分配太多内存

我可以说,这是一个长期的项目,你不能在几周内完成正确

I can say that this is a long-term project that you can not finish correctly in a few weeks.

这篇关于如何安全地执行C code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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