I need to run arbitrary code snippets in Python and Javascript on a server. It cannot be run in the browser.
I'm thinking of sandboxing the code in an AWS Lambda serveless function. However, I'm unsure of the best ways to disable networking (outside of the AWS returning a response over the network) and other potential threats.
How do sites like HackerRank sanitize user submitted code? Is there anything else I should think about?
I've seen answers such as this, but the top rated answers tend to be out of date.