Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap: add --sandbox bootstrap argument #153

Open
yorkie opened this issue Jun 21, 2018 · 2 comments
Open

bootstrap: add --sandbox bootstrap argument #153

yorkie opened this issue Jun 21, 2018 · 2 comments

Comments

@yorkie
Copy link
Member

yorkie commented Jun 21, 2018

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:

  • --allow-fs the script can use file system.
  • --allow-net the script can use networking API.
  • --allow-tls the script can use TLS API.
  • --allow-fork the script can use Child Process API to fork/exec sub-processes.
  • --allow-global-module the script can load global modules.
  • native module (.node) are always disabled.

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
Copy link
Contributor

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

@yorkie
Copy link
Member Author

yorkie commented Jun 21, 2018

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

@yorkie yorkie added this to the v0.9.x milestone Jul 3, 2018
@yorkie yorkie removed this from the v0.9.x milestone Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants