Skip to content

Dagger cloud cannot be configured without caching #7079

Closed

Description

@jedevc

In #6835, we finally removed _EXPERIMENTAL_DAGGER_CLOUD_TOKEN, and replaced it with DAGGER_CLOUD_TOKEN.

However, we were exploiting an undocumented use of this - we could use DAGGER_CLOUD_TOKEN to enable cloud cache + telemetry, while we could use _EXPERIMENTAL_DAGGER_CLOUD_TOKEN to just enable telemetry for security reasons. We want all PRs to use telemetry (so we can get traces), but we don't want all PRs to use caching - since that could introduce potential cache poisoning attacks.

We've hit this on upgrading our runners to use v0.11.1 - the new value is used for both.

Technically this might be doable - the token usage is used in two places:

  • On the engine it's used as the cache service token
  • On the client it's used as the telemetry token
    The two usages appear completely separate to me. But, we'd need to set two different tokens, one to set on a github runners for cache service, and another to set on the client for the cache service. (I'm not sure if/how we do this).

Additionally, this would only work for us because we provision our engine separately - if we were relying on auto-engine provisioning, we wouldn't be able to rely on this.

Activity

  1. jedevc commented on Apr 11, 2024

    @jedevc
    ContributorAuthor
  2. jedevc commented on Apr 11, 2024

    @jedevc
    ContributorAuthor

    Ideally we'd have something like https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect, for running in CI, similar to how Depot does.

    Then we could allow automatically provision short lived tokens into Github, and allow automatic scoping for PR environments.

  3. marcosnils commented on Apr 11, 2024

    @marcosnils
    Contributor

    We want all PRs to use telemetry (so we can get traces), but we don't want all PRs to use caching - since that could introduce potential cache poisoning attacks.

    In a CI environment, given that a token needs to be set up as a secret, PR's from non-contributors shouldn't have access to start the engine with the cache service enabled. Having said that, because our engines are self-hosted and the token is set at the runner level, this currently represents a security issue as you're correctly pointing out.

    Ideally we'd have something like https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect, for running in CI, similar to how Depot does.

    yes, I totally agree. We have an issue for it internally. We need to prioritize it 🙏

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions