Gregory
Gregory

Reputation: 493

Is it safe to use GitLab CI «protected» variables for secrets?

I haven't found any way to pass secret variables in GitLab CI pipelines except with so-called «protected» variables. Any other variables can be revealed by any committer as every commit/branch goes throw a pipeline and the code can be modified.

I don't like protected variables because they are too complicated. I need to grant access to some variable to certain people like I do in SQL-databases or Linux filesystems. Instead, I have to make a protected variable, a protected branch, a protected environment (premium feature). And I have to add the maintainer permission level to some users. And then (maybe) they will the only people to access my secret variables.

Also, I have no idea how are those variables stored. Usually, I use Hashicorp Vault and now GitLab is the weakest security point.

Is it safe enough? Are there more reliable methods to keep secrets in CI pipelines?

Upvotes: 9

Views: 5768

Answers (2)

VonC
VonC

Reputation: 1323773

issue 13784 refers to an encryption at REST, so the security is not... optimal

There is an epic opened to improve that, and you can setup an Vault integration, but there is not one by default.
Issue 61053 is about solving that: "Vault integration for key/value secrets MVC"

More and more teams are starting to store their secrets in Vault.
We should provide a secure way to fetch short-lived tokens from Vault that can be used at runtime by a job in a CI/CD pipeline.

This is for GitLab 12.3, Sept. 2019.

Upvotes: 4

Ivan
Ivan

Reputation: 9675

Just to add to the answer of @VonC, here is the general vision expressed by GitLab with regards to Secrets Management and various scenarios of integrating with Vault, including fully embedding it inside: https://about.gitlab.com/direction/release/secrets_management/

Upvotes: 1

Related Questions