Use minimum system permissions necessary
See original GitHub issueI noticed that the default dev script invokes itself with full permissions over the entire system. Ideally, Lume should function fine if invoked with the following minimum permissions.
$ deno run --allow-net=localhost:3000 --allow-read=./ --allow-write=./_site lume/task.ts
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Implementing Least-Privilege Administrative Models
The principle states that all users should log on with a user account that has the absolute minimum permissions necessary to complete the ......
Read more >Principle of least privilege - Wikipedia
In information security, computer science, and other fields, the principle of least privilege (PoLP), also known as the principle of minimal privilege (PoMP) ......
Read more >What Is Least Privilege & Why Do You Need It? - BeyondTrust
When applied to people, the principle of least privilege (POLP), means enforcing the minimal level of user rights, or lowest clearance level, ...
Read more >What is the Principle of Least Privilege (POLP)? - TechTarget
Users are granted permission to read, write or execute only the files or resources necessary to do their jobs. This principle is also...
Read more >What is the Principle of Least Privilege (POLP)? A Best ...
The principle of least privilege is the idea that at any user, program, or process should have only the bare minimum privileges necessary...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
task.ts
andci.ts
works as wrappers to execute the real CLI script (cli.ts
). This wrapper fixes different issues. So, restricting permissions to these files has no effect tocli.ts
(AFAIK, permissions are not propagated between childprocesses: a file with only--allow-run
could run a script passing the--allow-all
argument).The use cases are so variable that this is the reason I’ve decided to run
cli.ts
with--allow-all
, for example:allow-net
orallow-net=api-url
.ENV=dev
) needs--allow-env
.--allow-run
--allow-ffi
.--allow-read
to read the WebAssembly file.Restricting the permissions right now can break many sites. I think it’s better to let the users configure the permisisions once Deno team implements permission configuration in the deno.json file. In Lume 2.0 I’m planning to remove these wrapper files and depend only on deno.json that will be mandatory (unlike now, that both deno.json and import_map.json files are optional).
If you’re concerned about that, the correct way to apply permissions is by running the
cli.ts
file directly. You can create a task like this:This conversation makes me think that a Permissions section in the documentation website would be really useful for users that want to restrict these permissions.
Permissions are explained here: https://lume.land/docs/advanced/permissions/ Closing this.