yodaos-project / ShadowNode

Use Node.js in your end devices(QQ: 796448809)
https://yodaos-project.github.io/ShadowNode/
Other
588 stars 46 forks source link

bootstrap: add --sandbox bootstrap argument #153

Open yorkie opened 6 years ago

yorkie commented 6 years ago

What's the sandbox?

ShadowNode should be able to run a script in sandbox mode, which means the modules the script can access should be restricted. Within this feature, every defined application could run in a safe environment for the host.

Permissions

A sandbox should own the following permissions:

By default, if it starts with iotjs --sandbox, the above permissions are not enabled. To enable one or more of them, you should append the params before the script like the below:

$ iotjs --sandbox --allow-fs ./fs-script.js

/cc @legendecas @algebrait @lolBig

algebrait commented 6 years ago

If consider native code through NAPI, libc or even system call should be customized.

yorkie commented 6 years ago

Customized libc/syscall are such heavy works, so let's always disable loading from .node.