Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sandboxing for MFS, Keys, IPNS #10229

Open
hacdias opened this issue Nov 22, 2023 · 1 comment
Open

Sandboxing for MFS, Keys, IPNS #10229

hacdias opened this issue Nov 22, 2023 · 1 comment
Labels
effort/days Estimated to take multiple days, but less than a week exp/expert Having worked on the specific codebase is important P2 Medium: Good to have, but can wait until someone steps up

Comments

@hacdias
Copy link
Member

hacdias commented Nov 22, 2023

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:

  • MFS: each application will have their own MFS that does not collide with others.
  • Keys: each application can only see and access keys that they have created.
  • IPNS: each application can only interact with keys that they own (related to above).

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 brave/brave-browser#34000 as Brave would like to use this for sandboxing access per blessed extension like https://webrecorder.net/

@hacdias hacdias added exp/expert Having worked on the specific codebase is important effort/days Estimated to take multiple days, but less than a week P2 Medium: Good to have, but can wait until someone steps up labels Nov 22, 2023
@lidel lidel moved this to Todo in @lidel's IPFS wishlist Nov 22, 2023
@lidel
Copy link
Member

lidel commented Nov 22, 2023

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:

  • MFS (ipfs files) the / root visible to the sandboxed app is /___/appname/ subdir
  • Keys (ipfs key) only shows keys prefixed with ___/appname/; by default app has no keys and when it generates one, the name is prefixed with ___/appname/
  • IPNS (ipfs name publish --key keyname) only accepts keys visible via ipfs key list, errors when there is no ___/appname/keyname

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

@hacdias hacdias self-assigned this Nov 23, 2023
@hacdias hacdias moved this to 🥞 Todo in IPFS Shipyard Team Nov 23, 2023
@hacdias hacdias removed their assignment May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/days Estimated to take multiple days, but less than a week exp/expert Having worked on the specific codebase is important P2 Medium: Good to have, but can wait until someone steps up
Projects
No open projects
Status: 🥞 Todo
Development

No branches or pull requests

2 participants