Project secrets¶
A project can keep its own secret values: a database connection string only its tests use, a token for a feed only it pulls from. They sit in the same encrypted store as the installation's secrets. Only that project's runs and commands see them.
Where a value lives¶
A secret lives with the thing that uses it. Things every project shares, such as trackers, connections, agents, webhook and Slack secrets, design sources and PoC targets, keep using the installation's secrets. Things that belong to one project can use that project's own values:
- the token of a private package feed (
registries[].token: "${NAME}") - the
authof the project's machine identity - a variable a command gets through
sandbox.secrets(env.<VAR>: "${NAME}"orrepo_env.<repo>.<VAR>: "${NAME}")
At these three places, the project's own value of NAME wins. If the project has none, the installation's value applies, the way a repository secret wins over an organization secret. If the project's value exists but can't be opened (for example after the master key changed), nothing applies, never the installation's value. A shared thing never sees a project value.
Names follow the environment-variable rule: upper-case letters, digits and _, not starting with a digit. A value must be at least 6 characters long, the shortest value the masker hides.
Who may set one¶
The secrets tab in Config studio → Projects → edit a project lists every name the project references or stores. For each name it shows where the value comes from (project, installation, unreadable or missing) and whether the project's value overrides an installation value. Set, Replace, Delete and Add a secret take effect immediately, as a project-secrets run on the project. They don't wait for the dialog's Save. A value is never shown again. An installation value is changed on the installation's secrets page, which the row links to.
Setting a project's values needs secrets.write in that project, reading the names needs secrets.read. Either can come from a global role or from a project binding whose role carries them; the built-in admin role does. The tab itself is in the Config studio, which needs global config.read. Someone who holds secrets.write only through a binding can use the API (GET and PUT /api/projects/{name}/secrets) instead.
A value inside a command¶
projects:
billing:
sandbox:
secrets:
env:
DISPOSABLE_SQLSERVER_CONNECTION_STRING: "${DISPOSABLE_SQLSERVER_CONNECTION_STRING}"
The server puts the value into the environment of each command the run sends to the sandbox, the way a repository's git token travels. This works on every sandbox backend, not only Kubernetes. A value set while a run is waiting reaches that run's next command. A reference that resolves to nothing leaves the variable unset, and the run's preflight names it as a warning.
A value is masked as *** in everything a run records: its trace, its model calls, the live sandbox drawer and a failed command's last lines. One project's values are never masked in, and never block a file write in, another project's runs.
When a run asks for a value¶
A run that needs a value the project lacks can ask for it by name, and so can a series' master. The question shows a password field, Store as project secret NAME, in place of the answer box. Storing the value saves it as a project secret and then answers the question. The run only receives the sentence "NAME is set as a project secret of PROJECT (by PERSON)". It never receives the value itself. Whatever else is sent as an answer is replaced by that sentence. Until the value is stored, such a question can't be answered at all: no deadline default, no ticket comment, no Slack or Teams reply, no message.
A run that asked for a value gets it in its commands' environment under that name, with no sandbox.secrets declaration needed. The same goes for every run of a series whose master asked. Storing the value needs secrets.write in the project. Without it the card names who can store it.
A value typed into a chat message or a ticket comment stays in that conversation or on the tracker. Only the card's field keeps it out.
Delete, rename, archive¶
Deleting a project deletes its secret values with it. A project created again under the same name starts with none. A data archive carries the values encrypted as they are stored; the target needs the same master key to open them.