- Requirements
- Use cases
- How it works
- Configure a conditional role with OIDC claims
- OIDC authorization with your cloud provider
Connect to cloud services
Version history
-
CI_JOB_JWT
variable for reading secrets from VaultCI_JOB_JWT_V2
variable to support additional OIDC providers
GitLab CI/CD supports Requirements
- Account on GitLab.
- Access to a cloud provider that supports OIDC to configure authorization and create roles.
The original implementation of CI_JOB_JWT
supports HashiCorp Vault integration. The updated implementation of CI_JOB_JWT_V2
supports additional cloud providers with OIDC including AWS, GCP, and Vault.
Configuring OIDC enables JWT token access to the target environments for all pipelines.
When you configure OIDC for a pipeline, you should complete a software supply chain security
review for the pipeline, focusing on the additional access. You can use the
as a starting point, and for more information about supply chain attacks, see
.
The
CI_JOB_JWT_V2
variable is under development (alpha) and is not yet suitable for production use.Use cases
- Removes the need to store secrets in your GitLab group or project. Temporary credentials can be retrieved from your cloud provider through OIDC.
- Provides temporary access to cloud resources with granular GitLab conditionals including a group, project, branch, or tag.
- Enables you to define separation of duties in the CI/CD job with conditional access to environments. Historically, apps may have been deployed with a designated GitLab Runner that had only access to staging or production environments. This led to Runner sprawl as each machine had dedicated permissions.
- Allows shared runners to securely access multiple cloud accounts. The access is determined by the JWT token, which is specific to the user running the pipeline.
- Removes the need to create logic to rotate secrets by retrieving temporary credentials by default.
How it works
Each job has a JSON web token (JWT) provided as a CI/CD predefined variable named CI_JOB_JWT
or CI_JOB_JWT_V2
. This JWT can be used to authenticate with the OIDC-supported cloud provider such as AWS, GCP, or Vault.
The following fields are included in the JWT: