Skip to content

Scope wildcards in user environment variables not working #13474

Closed
@szab100

Description

@szab100

Bug description

It seems that using wildcards (*) in the scopes of user env variables are not working, env vars are only visible in workspaces if the scope is either / or fully qualified (entirely matching the workspace context's owner/repository).

Steps to reproduce

(Self-Hosted: 2022.08.0)

  1. Create an environment variable using * in the repository name, eg "myproject*", which should match "myproject-X", "myprojectXY", etc.
  2. Verify that the newly added env var is NOT accessible from workspaces where the context repo url does match the given pattern.
  3. Verify that the newly added env var is accessible, if you change the scope to the fully qualified owner/repository scope, without wildcards in the repository name (wildcards in the git-org / owner part seems to be working fine).

Workspace affected

No response

Expected behavior

  1. The wildcard matching in repository names should be fixed.

Example repository

No response

Anything else?

  1. The current scope pattern does not seem to take the git provider into account, so the scope of git-org-name/repo-name is matching both the repository github.mycompany.com/git-org-name/repo-name and github.com/git-org-name/repo-name. This is a potentially exploitable security vulnerability, so supporting an optional (backward compatible) additional provider prefix would be preferred, eg all of the following should be valid scopes:

    github.mycompany.com/git-org-name/repo-name ==> should match only github.mycompany.com provider
    git-org-name/repo-name ==> should match any provider
    github.com/git-org-name/repo-name ==> should match only github.com provider

  2. Env variables do not seem to readable by IDE processes. There are several IDE extensions that support taking secrets & other values from OS environment variables, so Gitpod should set the project- and user-specific env variables before spawning the IDE processes.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In Validation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions