- Configure your Vault server
- Use Vault secrets in a CI job
- Configure Vault server roles
- Using a self-signed Vault server
Using external secrets in CI
Secrets represent sensitive information your CI job needs to complete work. This sensitive information can be items like API tokens, database credentials, or private keys. Secrets are sourced from your secrets provider.
Unlike CI/CD variables, which are always presented to a job, secrets must be explicitly required by a job. Read GitLab CI/CD pipeline configuration reference for more information about the syntax.
GitLab has selected
as the first supported secrets engine.
GitLab authenticates using Vault’s
CI_JOB_JWT)
introduced in GitLab 12.10.
You must configure your Vault server before you
can use use Vault secrets in a CI job.
The flow for using GitLab with HashiCorp Vault
is summarized by this diagram:
To configure your Vault server:
Enable the authentication method by running these commands. They provide your Vault
server the
Configure your Vault server
$ vault auth enable jwt
$ vault write auth/jwt/config \
jwks_url="https://gitlab.example.com/-/jwks" \
bound_issuer="gitlab.example.com"