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

[Projects] Cannot access prebuild logs if not project owner #5344

Closed
AlexTugarev opened this issue Aug 24, 2021 · 3 comments · Fixed by #5433
Closed

[Projects] Cannot access prebuild logs if not project owner #5344

AlexTugarev opened this issue Aug 24, 2021 · 3 comments · Fixed by #5433
Assignees
Labels
component: dashboard type: bug Something isn't working

Comments

@AlexTugarev
Copy link
Member

AlexTugarev commented Aug 24, 2021

Bug description

When trying to access prebuild logs of a project where I'm not the installation owner, I see the following error missing get permissions on workspace. The error does not appear on projects which I installed.

Screen Shot 2021-08-24 at 10 24 21

The API operations we are using in PrebuildLog.tsx are getWorkspace, watchWorkspaceImageBuildLogs, and getHeadlessLog(instanceId), all of which compare the workspace owner with the current user and block on mismatch.

Proposed solution

PrebuildLog.tsx would call a dedicated getPrebuildLog(prebuildId) which would map from prebuildId to the underlying instance and also check for team permissions. This way, we would only relax the access guard within a team, and only for the necessary operation.

@AlexTugarev AlexTugarev added the type: bug Something isn't working label Aug 24, 2021
@gtsiolis
Copy link
Contributor

Could not easily reproduce but sounds something we need to fix before shipping Teams & Projects. Adding this to the crew proejct board for now. Thanks @AlexTugarev!

@svenefftinge
Copy link
Member

I think we need to be more fine_grained with our accesscontrol and allow team members read access (get) to workspace and instance and workspacelogs (do we need that or is this data that belongs to the instance?) if a workspace is a team's workspace (i.e. a prebuild associated with a project under a team).

@svenefftinge svenefftinge self-assigned this Aug 30, 2021
@geropl
Copy link
Member

geropl commented Aug 30, 2021

@svenefftinge @AlexTugarev FYI: WorkspaceLogs already has a RessourceAccessGuard which allows everyone with "read" permission to repo to access the logs. Maybe we can re-use that for other stuff as well.

But I wonder if we should lift the permissions for getWorkspace in general. Maybe it'd be better to ask why we need it on the PrebuildLogs.tsx and replace it with (guarded) substitutes.

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

Successfully merging a pull request may close this issue.

4 participants