metarhia/impress

Extend sandbox for configuration with `db`, `domain` and maybe `bus` namespaces and limit `process` API access

georgolden opened this issue · 0 comments

Describe the problem

impress/lib/worker.js

Lines 31 to 32 in d31792c

const context = metavm.createContext({ process });
const config = await new Config(cfgPath, { mode: process.env.MODE, context });

We have only process injected into config sandbox

  • we need to limit process API access only to process.env, because we don't really need other process API for config
  • we may need other namespaces to be available for Logger configuration to inject writable destinations from application

Describe the solution

  1. Limit process API access to just env
  2. Extend context within the application sandbox or some particular namespaces

@tshemsedinov please edit

Alternatives

No response

Additional context

No response