doc/ci/secrets/secrets_manager/_index.md
{{< details >}}
{{< /details >}}
{{< history >}}
secrets_manager and ci_tanukey_ui. Disabled by default.ci_tanukey_ui removed in GitLab 18.4.group_secrets_manager.{{< /history >}}
[!warning] This feature is an experiment and subject to change without notice. Secrets stored in experiment or beta versions will not be kept when the Secrets Manager is released as generally available. This feature is not ready for public testing or production use.
Secrets represent sensitive information your CI/CD jobs need to function. Secrets could be access tokens, database credentials, private keys, or similar.
Unlike CI/CD variables, which are always available to jobs by default, secrets must be explicitly requested by a job.
Use the GitLab Secrets Manager to securely store and manage secrets and credentials for your projects and groups.
Prerequisites:
To enable or disable GitLab Secrets Manager for a project:
In the top bar, select Search or go to and find your project.
Select Settings > General.
Expand Visibility, project features, permissions.
Turn on the Secrets manager toggle and wait for the secrets manager to be provisioned.
[!warning] If you later disable the Secrets Manager for the project, all the project secrets are permanently deleted. These secrets cannot be recovered.
Secrets defined for a project can only be accessed by pipelines from the same project.
Prerequisites:
To enable or disable GitLab Secrets Manager for a group:
In the top bar, select Search or go to and find your group.
Select Settings > General.
Expand Permissions and group features.
Turn on the Secrets manager toggle and wait for the secrets manager to be provisioned.
[!warning] If you later disable the Secrets Manager for the group, all the group secrets are permanently deleted. These secrets cannot be recovered.
Secrets defined for a group can only be accessed by pipelines in a project directly under the group or in its subgroup hierarchy.
You can add secrets to the secrets manager so that it can be used for secure CI/CD pipelines and workflows.
*)* character).After you create a secret, you can use it in the pipeline configuration or in job scripts.
[!warning] The value of a secret is accessible to all CI/CD pipeline jobs running for the specific environment or branch defined when the secret is created or updated. Ensure only users with permission to access the value of these secrets can run jobs for the specified environment or branch.
Prerequisites:
To access secrets defined with the Secret Manager, use the secrets
and gitlab_secrets_manager keywords.
Similar to file type variables, the secret is made available as an environment variable with:
For example:
job:
secrets:
KUBE_CA_PEM:
gitlab_secrets_manager:
name: kube-cert
script:
- kubectl config set-cluster e2e --server="https://example.com" --certificate-authority="$KUBE_CA_PEM"
If a job outputs a secret's value, for example by running cat $KUBE_CA_PEM,
GitLab replaces the value in the job log with [MASKED].
Prerequisites:
To access group secrets:
secrets and gitlab_secrets_manager keywords.source field with the format group/<full-path-to-group>.For example:
job:
secrets:
TEST_SECRET:
gitlab_secrets_manager:
name: foo
source: group/<full-path-to-group>
script:
- cat $TEST_SECRET
Prerequisites:
To update the secrets permissions for a project:
Prerequisites:
To update the secrets permissions for a group:
Users with the Owner role for the group always have permissions to perform all operations in the Secrets Manager.
When you delete a project or delete a group with secrets:
When you transfer a project or transfer a group with secrets:
Users with the Owner role in the project receive an email notification to rotate a secret on the day specified in a secret's configuration.
reading from Vault: api error: status code 403When a CI/CD pipeline job attempts to fetch a secret, it might return this error:
ERROR: Job failed (system failure): resolving secrets: getting secret: get secret data: reading from Vault: api error: status code 403: 1 error occurred: * permission denied
This error happens when a job attempts to fetch a secret that does not exist or has been deleted.
inline auth JWT is requiredWhen a CI/CD pipeline job attempts to fetch a secret, it might return this error:
ERROR: Job failed (system failure): resolving secrets: creating vault client: configuring inline auth: inline auth JWT is required
This error happens when the secrets manager instance has not been provisioned yet for the project or the group that the secret is expected to belong to. The runner cannot configure authentication because no secrets manager role exists yet.
To resolve this error, enable the Secrets Manager for your project or group.
Wait for provisioning to complete and create the secret before re-running the pipeline.