ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
15.9k stars 2.98k forks source link

Sandboxing for MFS, Keys, IPNS #10229

Open hacdias opened 7 months ago

hacdias commented 7 months ago

With the addition of #10187, the next natural step is to allow sandboxing for the different APIs according to the given Authorization keys. At the moment, the following are identified APIs that should be sandboxed:

This will be useful for applications built on top of the new authenticated API.

Easiest solution is to prepend some path to MFS paths and key names.

cc @lidel if you want to add more context

cc https://github.com/brave/brave-browser/issues/34000 as Brave would like to use this for sandboxing access per blessed extension like https://webrecorder.net/

lidel commented 7 months ago

To elaborate a bit more, we want API.Authorizations value to have a Sandbox Flag which ensures the access token will provide a virtual sandbox that ensures out-of-the-box isolation between apps.

Initial design idea

Prefixing is worth exploring, as it saves us from refactoring too much, and works with existing tooling and RPCs.

If API.Authorizations have entry with key value appname:

___ prefix is a placeholder, ideas welcome, but starting with at least one _ ensures sandboxed entries are always listed together when sorted.