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

Epic: Restrict access to snapshot URLs #8257

Closed
3 tasks done
jldec opened this issue Feb 16, 2022 · 5 comments · Fixed by #8306
Closed
3 tasks done

Epic: Restrict access to snapshot URLs #8257

jldec opened this issue Feb 16, 2022 · 5 comments · Fixed by #8306
Assignees
Labels
team: webapp Issue belongs to the WebApp team type: epic

Comments

@jldec
Copy link
Contributor

jldec commented Feb 16, 2022

Gitpod snapshot URLs, provide a way to share a snapshot of a workspace e.g. for easy reproduction of test environments.

For workspaces of private git repos, these URLs could be used to access sensitive or proprietary files.

  • Run the "Gitpod Share Workspace Snapshot" command in a workspace, to receive a new snapshot URL.
  • Any Gitpod user could use this URL to open a new workspace with the same state.

The proposed fix is to limit access to the workspaces from snapshot URLs to those users who have read access to the repo.

  1. Determine the git remote for the snapshot
  2. Ensure that the user opening the workspace with the snaphot URL has read access to the git remote.
  3. If not, show the error from the git provider, and a suggest requesting access to the repo (see below).

Since this changes the behavior of existing snapshot URLs, the error should also include the following explanation

Snapshot URLs require read access to the underlying repository.
Please request access from the repository owner.

NOTE: Breaking change
This change may break some usage scenerios where private repo workspaces are intentionally shared via snapshots e.g. for interviews.

@jldec jldec added the team: webapp Issue belongs to the WebApp team label Feb 16, 2022
@jldec jldec moved this to Scheduled in 🍎 WebApp Team Feb 16, 2022
@jankeromnes
Copy link
Contributor

Happy to give this a go tomorrow

/assign

@jankeromnes jankeromnes self-assigned this Feb 16, 2022
@gtsiolis
Copy link
Contributor

This could also apply to running workspaces as well as snapshots, see #4841.

See also #4841 (comment).

Also, maybe it could be worth considering to share only with team members by default and allow users to manually switch to share with anyone with a link. 💡

@csweichel
Copy link
Contributor

This could also apply to running workspaces as well as snapshots, see #4841.

Running workspace access is mediated by ws-proxy, who has no notion of the authentication on server side. We'd need to introduce guest tokens (which we conceived of when we introduced the owner token, hence the name).

@jldec jldec moved this from Scheduled to In Progress in 🍎 WebApp Team Feb 21, 2022
Repository owner moved this from In Progress to Done in 🍎 WebApp Team Feb 21, 2022
@jldec jldec changed the title Restrict access to snapshot URLs Epic: Restrict access to snapshot URLs Feb 22, 2022
@chuck-confluent
Copy link

chuck-confluent commented Sep 27, 2022

whoa whoa whoa...a workspace snapshot may have sensitive credentials in files ignored by git. The owner of the workspace should reserve the right to limit access to the snapshot URL or revoke the URL at any time, regardless of what repo permissions people have.

@chuck-confluent
Copy link

If someone accidentally creates a snapshot URL instead of sharing a running workspace, is that snapshot url public and available at all times? You can kill a shared running workspace, but can you manage access or kill a snapshot? I'm looking at https://www.gitpod.io/docs/sharing-and-collaboration#how-to-take-a-snapshot-url and it only describes how to create the snapshot url. It does not mention about revoking or managing access to the snapshot url.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: webapp Issue belongs to the WebApp team type: epic
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants