Intro
CI/CD Fundamentals
git-vars package
Role Based Access Control
Protected Branches and Tags
Security Templates
Artifact Management
5. Masked variables
You can mask a project, group, or instance CI/CD variable so the value of the variable does not display in job logs. The method used to mask variables limits what can be included in a masked variable. The value of the variable must:
- Be a single line.
- Be 8 characters or longer.
- Not matching the name of an existing predefined or custom CI/CD variable.ci_beginner_course
To mask a variable:
- Navigate to your project in GitLab.
- Go to
Settings
>CI/CD
. - Expand the
Variables
section. - Click on
Add variable
. - Enter the
Key
andValue
for the variable.- We will create a variable for this example:
- Key:
MASKED_VAR
- Value:
ThisIsMaskedValue
- Key:
- We will create a variable for this example:
- Set the scope of the variable (Project-Level or Group-Level).
- Mark the variable as
Masked
. - **Click
Add variable
to save the masked variable.