Runner-specific secure variables
Description
Gitlab CI currently provides global secure variables. I call them global here because they are provided to all runners. Thus if you have runners of varying levels of trust (e.g. some shared and some private), using a global variable will leak the "secure" content to the untrusted runners. (Beyond this, using the current implementation of secure variables at all involves trust of Gitlab's infrastructure, if you use Gitlab.com.)
I'd like to propose runner-specific variables as a way to provide secure variables in the presence of runners with differing levels of trust. Runner-specific variables are simply variables specified in the runner configuration rather than on the Gitlab web instance. Runner-specific variables need not be communicated to Gitlab and can simply be injected directly into the environment of tests run. The user can use tags to direct the right builds to the appropriate runners.
In our case, we have a public project with a number of private users. We'd like to include some of our private users' code in our test infrastructure to help make sure that critical projects continue to work as we make changes. Right now we would have to test those projects on an individual basis, or turn to another testing tool to get this done.
Proposal
This feature could be exposed in one of two ways (or both of them):
-
In the runner configuration file. Presumably you would add a section to the file for variables. This seems relatively straightforward.
-
Via a
gitlab-runner
subcommand. I'm not sure what your standards are for what is allowed to be a subcommand, but you could imagine avariable add
andvariable remove
or similar set of commands.