2 ms·
Lua, in its vanilla form, is not a language supporting proper multi-tenancy. It works okay if only one (trusted) user writes the scripts, but it's not the good
by majke 10y ago
Lua, in its vanilla form, is not a language supporting proper multi-tenancy. It works okay if only one (trusted) user writes the scripts, but it's not the good choice for running truly untrusted code from the internet. What will just happen when you do "string.rep" in redis?
A better design would be to run one Lua VM per tenant, but then we are at totally different set of problems (preemptive multi-tasking between VM's?)
- willvarfar 10y agoIn Lua its the host that does the actual allocs (lua_setallocf()), and its routine for the host to intercept those mallocs and do accounting. Now even with a 'locked down' Lua VM there is a lot of trust in executing 3rd-party scripts and there might be various attacks. But as I said, I really could imagine some next-gen CDN allowing paying customers to put Lua scripts in the edge to rewrite requests and responses. If I were tackling it I would want all the script instances for any given customer to be isolated at a hardware level from other customers too.