Hi minoki
what i want to do is have vhost like environment in openresty where each request is executed in standalone mode with restricted (filesystem, OS, ngx) access to resources. Openresty does good job of isolating requests, its about restricting the access to resources.
What i figured out so far:
- on lua side
setfenv ... restrict access to io., os. etc. (there is a whole list of safe/unsafe Lua calls on the web)
- SML side ... tweak LunarML compiler and basis to restrict access to TextIO, OS, or Posix etc. (GROK supplied analysis i need to investigate properly)
Now my question ... how hard would be to implement SML part ... tweaks to LunarML needed to support sandboxing. Ideally I would just supply a flag --sandbox to compiler and it all works.
Any pointers regarding implementing this? I would not mind working on this myself.
Regards
Hi minoki
what i want to do is have vhost like environment in openresty where each request is executed in standalone mode with restricted (filesystem, OS, ngx) access to resources. Openresty does good job of isolating requests, its about restricting the access to resources.
What i figured out so far:
setfenv... restrict access to io., os. etc. (there is a whole list of safe/unsafe Lua calls on the web)Now my question ... how hard would be to implement SML part ... tweaks to LunarML needed to support sandboxing. Ideally I would just supply a flag
--sandboxto compiler and it all works.Any pointers regarding implementing this? I would not mind working on this myself.
Regards