Granular flags vs prompt mode for Deno permissions with untrusted imports
0 reputation · 28 Jan 2021, 17:09 UTC
Goal is to run a local Deno script that imports third-party modules while keeping host access limited to the principle of least privilege.
Deno is secure by default and requires explicit permission flags for file, network, and environment access. Granular flags such as --allow-read and --allow-net can restrict to specific paths or domains, but permission grants are process-wide and apply to the entire import tree. The runtime also supports a prompt-based interaction mode where permission requests are presented at execution time.
The unresolved decision is whether to rely on startup granular flags for a predictable permission surface, or to use prompt mode to approve requests interactively and avoid over-granting. Prompt mode may reduce upfront specification but can introduce repeated interactions for modules with many accesses.
Can prompt mode be used without granting a blanket permission to all imports in the process? Does combining startup granular flags with prompt mode create duplicate or conflicting requests? Which approach preserves least privilege when the script’s dependency graph includes untrusted code?