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

Having access to the project role does not grant access to storage #815

Open
andriihomiak opened this issue Apr 18, 2022 · 3 comments
Open
Labels
bug Something isn't working

Comments

@andriihomiak
Copy link
Contributor

andriihomiak commented Apr 18, 2022

Having access to the project role does not grant access to storage

Context

If userA shares access to project by granting userB a project role, it is expected that userB will be able to upload data to the project volumes by running neuro-flow upload ALL.

Steps to reproduce

You'll need two user accounts - <userA> and <userB>

  1. Create neuro-flow project from cookiecutter template
cookiecutter gh:neuro-inc/cookiecutter-neuro-project --checkout release

and update .neuro/ configs:

  • set owner in project.yml to <userA>
  • make sure every storage reference in volumes section of live.yml starts with storage:/$[[ project.owner ]]/$[[ flow.project_id ]]/
  1. Login as<userA>
  2. neuro-flow mkvolumes && neuro-flow upload ALL
  3. neuro acl grant role://<userA>/projects/<project-id> <userB> write (<project-id> was specified when using cookiecutter template
  4. Login as <userB>
  5. neuro acl ls | grep <project-id> to confirm necessary permissions exist
  6. neuro-flow -vv upload ALL

Expected behaviour

Upload succeeds

Actual behaviour

Following error is shown:

<TRUNCATED>
neuro_sdk.request: Fetch [POST] https://neu.ro/api/v1/users
neuro_sdk.request: Fetch [POST] https://neu.ro/api/v1/users/<userA>:projects:<project-id>/permissions
ERROR: neuro_flow.cli.main.main: Forbidden
@andriihomiak andriihomiak added the bug Something isn't working label Apr 18, 2022
@YevheniiSemendiak
Copy link
Collaborator

The problem might be in the root volume: https://github.com/neuro-inc/cookiecutter-neuro-project/blob/5c16c0893600fc1fd5159d9dfebce956e2b9b276/%7B%7Bcookiecutter.project_dir%7D%7D/.neuro/live.yml#L132
To overcome this issue, we could either check if the volume exists before trying to create it. Or try to create and if it fails with 403 - assume it already exists.

@johngull
Copy link

I would call it a serious security issue.

@YevheniiSemendiak
Copy link
Collaborator

Yes, the work-around of sharing the parent directory is a security issue.
Ping @romasku, could we tackle this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants