-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Description
I am new to deno, so this is somewhat of a mix between a noob-question and a feature request.
Hopefully an issue is the right way to start.
The security aspects of the deno runtime are particularly attractive to me.
However, so many of the modules I am exploring seem to default to a deno install -Afq ...
It's a bit disappointing to see that the first thing one does is to actually disable the security sandbox.
But then, looking at the current command line required to make this work with fine grained permissions, its clear
this is easier said than done. In general, the finer control one desires, the more unwieldy it becomes.
As a newcomer attracted to the security messaging, I'd like a better UX for
- inspecting the permissions required by a dependency
- auditing changes between versions of a dependency
- reverse attribution of permission to a dependency
- determining if a is permission optional or required for the working of a module (net access for analytics)
All of these look unwieldy if not impossible to accomplish with current tooling.
Wonder if any thought has been given to allowing the developer to register a permission at point of use
and then generate a list of permissions required as an auxiliary artifact - permissions.json or permissions.yml.
This would keep with the single file philosophy of deno but solve the manageability issues raised above.
Something along the lines of:
// within some file in a module that needs permissions,
import { registerPermission } from 'https://deno.land/std@0.99.0/permissions/mod.ts'
const required = true // controls optionality of the permission - allowing limited mode operation or not.
registerPermission('env', ['VAR1', 'VAR2'], required)
// and so on.
And then from the cli
deno permissions
# or
deno install
which would generate a white list required and append it to a permissions.json|yml file at point of use.
The file can then be used to provide the end consumer the UX desired - by the deno CLI or 3rd parties.
It seems deno is doing most of hard work of tracking and validating. Just that the end user has no insight,
resulting in deno install -Afq ...