How does GitLab handle secrets and external secret managers in jobs?
AdvancedConceptGitLab CI
Answer
Simple secrets come from masked and protected CI variables. For stronger security, use the secrets: keyword to fetch values at job time from HashiCorp Vault, Azure Key Vault, GCP Secret Manager or AWS Secrets Manager, authenticating with the job's ID token (id_tokens: with an OIDC JWT) so no long-lived credential is stored in GitLab.
deploy:
id_tokens:
VAULT_ID_TOKEN:
aud: https://vault.example.com
secrets:
DB_PASSWORD:
vault: prod/db/password@secret
token: $VAULT_ID_TOKEN
More on GitLab CI
How does GitLab CI/CD work at a high level?BeginnerWhat is a GitLab Runner and what executors exist?IntermediateWhat are the types of runners (shared, group, project) and tags?IntermediateHow do `rules:` work and how do they replace `only/except`?IntermediateWhat are workflow rules and how do they prevent duplicate pipelines?AdvancedHow do artifacts and cache differ in GitLab CI?Intermediate