How to disable/block Node from requiring Addons?

84 views Asked by At

I'm using vm2 sandbox to only allow requiring some internal modules but how do you block requiring the Node Addons? The Addons might as well be doing the same things like disallowed modules. Do I strip it in /node/src/ or is there some other way? I can't find any Node arguments nor vm2 options.

My vm2 config is:

  new NodeVM({
    require: {
        external: true,
        builtin: [x,y,z],
        mock: {..},
        context: 'sandbox'
    }..
0

There are 0 answers