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: Get rid of OTS (One-Time Secret) #10134

Closed
12 tasks done
csweichel opened this issue May 19, 2022 · 15 comments · Fixed by #11112
Closed
12 tasks done

Epic: Get rid of OTS (One-Time Secret) #10134

csweichel opened this issue May 19, 2022 · 15 comments · Fixed by #11112
Assignees
Labels
priority: high team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team type: epic

Comments

@csweichel
Copy link
Contributor

csweichel commented May 19, 2022

Summary

The one-time secret (OTS) mechanism is used to deliver secrets to the workspace cluster. It's not location-aware which breaks workspace startup across regions.

Context

The one-time secret (OTS) mechanism is used to deliver secrets to the workspace cluster. During workspace startup, server will create up to three OTS:

  • one for the SCM token
  • one for the Gitpod token
  • potentially one for environment variables

A one-time secret is stored in the database and identified by a UUID. Using this UUID it can be downloaded once, after which it's removed from the database. When the OTS is created, server produces a URL from which the OTS can be downloaded. This URL is not location-specific, but uses the load balancer (i.e. gitpod.io/...).

Because the different regions use different databases which are synchronised using db-sync, and because the OTS URL is not region-aware, a workspace created in another region will race db-sync. This can lead to workspace startup failure.

Value

Removing OTS will

Acceptance Criteria

This work is complete when

  • there's a secure way to keep secrets on the workspace side (Kubernetes secrets qualify here)
  • the OTS mechanism is no longer in use for shipping secrets
  • the OTS mechanism has been removed from the code-base

Measurement

We are successful here when there's no loss of functionality, and no more need for the OTS mechansim.

Tasks

@atduarte
Copy link
Contributor

Added to workspace teams' project, even though it's shared work between WebApp and Workspace, to avoid this being forgotten.

@geropl
Copy link
Member

geropl commented Jun 2, 2022

@atduarte Added for Team WebApp as well! Please notify when you have the interface changes (w/o impl, maybe). Happy to jump on the changes on our end.

@atduarte atduarte moved this to In Discovery in 🌌 Workspace Team Jun 14, 2022
@atduarte atduarte added the team: webapp Issue belongs to the WebApp team label Jun 14, 2022
@atduarte atduarte self-assigned this Jun 14, 2022
@atduarte atduarte changed the title Epic: Get rid of OTS Epic: Get rid of OTS (One-Time Secret) Jun 28, 2022
@roboquat roboquat moved this to Done in 🌌 Workspace Team Jul 6, 2022
@roboquat roboquat moved this to Done in 🍎 WebApp Team Jul 6, 2022
@csweichel csweichel reopened this Jul 7, 2022
Repository owner moved this from Done to In Progress in 🍎 WebApp Team Jul 7, 2022
@atduarte atduarte removed the status in 🌌 Workspace Team Jul 11, 2022
@atduarte atduarte moved this to In Progress in 🌌 Workspace Team Jul 11, 2022
@kylos101 kylos101 moved this from In Progress to Scheduled in 🌌 Workspace Team Jul 13, 2022
@kylos101 kylos101 moved this from Scheduled to In Progress in 🌌 Workspace Team Jul 13, 2022
@atduarte atduarte moved this from In Progress to Scheduled in 🌌 Workspace Team Jul 14, 2022
@geropl
Copy link
Member

geropl commented Jul 19, 2022

@kylos101 Should we sync on the current status here? I feel we're pretty close. 👍

@csweichel
Copy link
Contributor Author

csweichel commented Aug 1, 2022

Next step IMHO is to connect the protected_secrets workspace feature flag to ConfigCat and roll this out slowly.

@atduarte
Copy link
Contributor

atduarte commented Aug 1, 2022

@csweichel what about the integration test?

@kylos101
Copy link
Contributor

kylos101 commented Sep 8, 2022

Added: #12554 to the epic

@atduarte atduarte moved this from Scheduled to In Progress in 🌌 Workspace Team Sep 30, 2022
@kylos101
Copy link
Contributor

kylos101 commented Nov 10, 2022

@atduarte this is In-Validation now.

@Furisto I see that the protected_secrets flag still exists in ConfigCat. Can we remove now?

@easyCZ
Copy link
Member

easyCZ commented Nov 10, 2022

There still seem to be OTS implementation on Server, and it's also being called/used - metrics

@Furisto
Copy link
Member

Furisto commented Nov 10, 2022

@easyCZ @kylos101 I believe @geropl wanted to remove it.

@easyCZ
Copy link
Member

easyCZ commented Nov 24, 2022

From an internal conversation it looks like the other client which is generating traffic against the OTS endpoints are Desktop IDEs.

@loujaybee @akosyakov Would you be able to validate if this is indeed the case and the Desktop IDEs use the OTS? What would be the effort to remove OTS from them so that we can remove the endpoints entirely?

@akosyakov
Copy link
Member

akosyakov commented Nov 28, 2022

@kylos101 @csweichel Does it mean we can remove SUPERVISOR_ENVVAR_OTS now?

Also

if tks[i].TokenOTS == "" {
continue
}
resp, err := client.Get(tks[i].TokenOTS)
if err != nil {
return nil, xerrors.Errorf("cannot download token OTS: %w", err)
}
if resp.StatusCode != http.StatusOK {
return nil, xerrors.Errorf("cannot download token OTS: %d (%s)", resp.StatusCode, resp.Status)
}
tkn, err := io.ReadAll(resp.Body)
resp.Body.Close()
if err != nil {
return nil, xerrors.Errorf("cannot download token OTS: %w", err)
}
tks[i].Token = string(tkn)
}
is not used anymore? i.e 34e5648 seems to remove it

@kylos101
Copy link
Contributor

@akosyakov maybe? I added a conversation here, socializing that it would help to get more data about the client.

@kylos101 kylos101 moved this from In Progress to In Validation in 🌌 Workspace Team Nov 28, 2022
@kylos101
Copy link
Contributor

@akosyakov @easyCZ inboxed this epic to IDE and WebApp, as there appears to be some additional cleanup needed to fully remove OTS, and set the status for workspace back to In-Validation.

@geropl
Copy link
Member

geropl commented Feb 15, 2023

@akosyakov @kylos101 @atduarte FYI: I thought we can close this issue, but it turns out here is one thing left: AdditionalContentContext. 😬

@kylos101 Let's sync how we want to go about this one.

@geropl
Copy link
Member

geropl commented Feb 20, 2023

After discussing wiht @kylos101 : Let's close this one and continue the tiny bit left here: #16481.

@geropl geropl closed this as completed Feb 20, 2023
@github-project-automation github-project-automation bot moved this from In Validation to Awaiting Deployment in 🌌 Workspace Team Feb 20, 2023
@github-project-automation github-project-automation bot moved this to In Validation in 🍎 WebApp Team Feb 20, 2023
@geropl geropl moved this from In Validation to Done in 🍎 WebApp Team Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: high team: webapp Issue belongs to the WebApp team team: workspace Issue belongs to the Workspace team type: epic
Projects
Status: Done
Status: Done
Status: Awaiting Deployment
Development

Successfully merging a pull request may close this issue.

7 participants