Skip to content

A global permission is required to view a specific repository #2415

Closed as not planned

Description

@johnnyaug

The fs:ReadConfig permission on the resource "*" is required when viewing a specific repository from the UI.

Activity

  1. added
    bug
    area/auth
    good first issue
    on Aug 27, 2021
  2. codeaucafe commented on Aug 30, 2021

    @codeaucafe
    Contributor

    Not sure if this issue is planned for anyone, but I'd be happy to assist in fixing this bug if no one is tasked with this Issue yet.

  3. johnnyaug commented on Aug 31, 2021

    @johnnyaug
    ContributorAuthor

    Hey @DataDavD, thank you, it would be great! I'm assigning you.

  4. codeaucafe commented on Sep 1, 2021

    @codeaucafe
    Contributor

    Thanks @johnnyaug. FYI, I will be out of town this weekend, so I will most likely start really working on this issue (as well as Issue #2316) when I return Monday next week (hopefully that isn't an issue).

    Thanks again for the help and letting me contribute to lakeFS.

    best,
    dd

  5. codeaucafe commented on Sep 21, 2021

    @codeaucafe
    Contributor

    Hey @johnnyaug just wanted to provide a little update. I'm starting to look at this more thoroughly tonight. Currently I'm trying to follow some of the implementation and declaration paths so I know what function/method should be checking for this specific perms.

    I will probably have more detailed questions tomorrow or Wednesday. Do you happen to know which function/methods I should focus on making sure they check fs:ReadConfig? In mean time I will reach out to lakeFS slack channel if I need any other help.

    Thank you!

  6. itaiad200 commented on Sep 27, 2021

    @itaiad200
    Contributor

    Hey @johnnyaug, not sure I understand what's wrong here. The ReadConfig allows one to read a config which is not unique to any repository. The returned struct is:

    	StorageConfig{
    		BlockstoreType
    		BlockstoreNamespaceValidityRegex
    		BlockstoreNamespaceExample
    	}

    The last 2 are lakeFS values and has nothing to do with the installation, the first one is the installation blockstore type. Why do you think that we need per-repo permissions here? Or do you think that we need to simply add the fs:ReadConfig:* to the default FSReadWriteAll policy as well?

  7. arielshaqed commented on Sep 27, 2021

    @arielshaqed
    Contributor

    @itaiad200 I think the issue resides elsewhere. The function GetStorageConfig requires permissions for all repositories. That sort-of makes sense (its semantics are not tied to a specific repository).

    But in practice the GUI uses this function on the RepositoriesObjectPage, to get ObjectsBrowser configuration. So if you don't have fs:ReadConfig on all repositories, I guess you cannot view objects in any repository.

    Perhaps we need another, better-named, API endpoint in Swagger (GetRepositoryStorageConfig?). It will fetch the required properties for the repository, and will be able to apply more fine-grained permissions.

    @DataDavD: The first step is to map what the objects page (see above) reads from the configuration. With that information you should be able to propose what information we really want to return. Does this make sense?

  8. johnnyaug commented on Sep 27, 2021

    @johnnyaug
    ContributorAuthor

    I basically agree with @arielshaqed.

    Simply put, as a lakeFS admin if I want to give my user permissions only for repo A, I have to give them this permission, which looks weird. It is implied by the name of this permission that it may allow access to installation-wide information. As a developer, I may be tempted to use this permission for other, more sensitive endpoints.

    If we go with @arielshaqed's suggestion - we can remove this permission and protect the proposed endpoint with the existing fs:ReadRepository permission.

  9. itaiad200 commented on Sep 27, 2021

    @itaiad200
    Contributor

    Thanks @arielshaqed & @johnnyaug for the clarifications. I agree with your suggestions.
    @DataDavD is the path forward clearer now?

  10. codeaucafe commented on Sep 29, 2021

    @codeaucafe
    Contributor

    hey @itaiad200 and @arielshaqed sorry for the delayed response (been busy with work/life - the normal 😄 ).

    Thank you very much for the detailed explanations. I believe I have a much better starting point now, if I have any questions later on I'll be sure to ask them. I will also provide a bit more updates once I'm in the thick of the code changes (which I intend to start regularly working on this this week).

    Thanks again for all y'all's assistance.

    Best,
    David

  11. codeaucafe commented on Oct 8, 2021

    @codeaucafe
    Contributor

    Update: I got sidetracked working on Issue #2316 but working on it helped my understanding of how the front end/react components use the backend Go code of lakeFS, so I'll be starting up work on this this weekend and should have something more concrete next week that we can discuss to make sure I'm moving in the right direction.

    If there are any issues current progress please let me know.

    Best,
    David

  12. codeaucafe commented on Oct 14, 2021

    @codeaucafe
    Contributor

    Another update: I got even more sidetrack working on React specific for Issue #2316 (I'm a backend engineer so my frontend skills are little weak 🤣 , but its good practice 📚 ).

    So, I probably won't be able to get to fully working on this issue until next week since I'll be out of town this weekend and am trying to finish Issue #2316 If that is an issue please let me know @johnnyaug @itaiad200. I'll update you again next week once I start working on this Issue again and if I have any other questions/concerns.

    Thanks again!

    Best,
    David

  13. 4 remaining items

  14. codeaucafe commented on Mar 25, 2022

    @codeaucafe
    Contributor

    hey friends sorry for the very late update. I've been extremely bogged down with work and life stuff (trying to buy a house and move states/cities, all while wrapping up a couple big projects at work), so I haven't really gotten to touch this. If someone else wants to have a go feel free. If not then I will probably start looking at this in my free time over the next two weeks as I get more of it. sorry and thank you for understanding

    cc @itaiad200 @johnnyaug

  15. itaiad200 commented on Mar 27, 2022

    @itaiad200
    Contributor

    No worries @DataDavD , many thanks for your contributions so far!
    I'm unassigning you so others can pick this up. If you made any progress on this and wish to share it, open a PR and link it here.

  16. added
    good first issue
    team/versioning-engine
    and removed
    good first issue
    team/cloud-native
    on Mar 27, 2022
  17. codeaucafe commented on Mar 27, 2022

    @codeaucafe
    Contributor

    Sounds good. Thank you @itaiad200. I may get to take another look this week, if I do I'll share anything helpful.

  18. codeaucafe commented on Apr 2, 2022

    @codeaucafe
    Contributor

    hey @arielshaqed so I took a look at this again based on your original suggestions and so far this is what I have determined.

    config.getStorageConfig() is called in 2 places:

    1. CreateRepositoryModal where the configs are used to determine things like which storage type you can use, etc. I believe the original GetStorageConfig() controller method can be used here.
    2. RepositoryObjectsPage by which ObjectsBrowser uses the config. This is what you called you originally.
    • From my knowledge the config here is only utilized for the UploadButton by which, from my knowledge, UploadButton only uses the warnings from the config (via config.blockstore_type) to provide a warning when trying to upload that local and mem types.

    So, if my understanding of GetStorageConfig's usage in RepositoryObjectsPage, then I would possible want to still use config.blockstore_type for the warnings, AND I would probably need to add some repository specific info to ensure that a user has access to the repository in question to upload anything, correct? But, for this particular action (Upload repo object), should we be requesting the UploadObject response?

    Maybe I'm missing something, but I figure maybe for this particular use case, we should be using UploadObject response given that particular use case of the storage config in this instance is during repo object upload and its just checking for warnings.

    Any thoughts? Help with something I'm missing?

    cc @itaiad200 @johnnyaug

    thanks in advance!

    happy coding,
    david

  19. codeaucafe commented on Apr 2, 2022

    @codeaucafe
    Contributor

    Also, FYI I think I'll have time and motivation to tackle this issue now, so happy to get reassigned if no one else is taking this issue on yet.

  20. codeaucafe commented on Apr 7, 2022

    @codeaucafe
    Contributor

    @arielshaqed sorry to bother you, but bumping the above to get some input before I proceed this weekend/next week on working on this

  21. github-actions commented on Nov 1, 2023

    @github-actions

    This issue is now marked as stale after 90 days of inactivity, and will be closed soon. To keep it, mark it with the "no stale" label.

  22. github-actions commented on Nov 12, 2023

    @github-actions

    Closing this issue because it has been stale for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/authbugcontributorgood first issuestaleteam/versioning-engine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions