GitLab check

Project CI/CD variable is unprotected or unmasked

GL-SEC-007MediumSecurity

Trigger condition

GitLab's GraphQL ciVariables query for this project returns at least one variable whose protected or masked field is a confirmed, literal false. A variable is counted once in the total even when both flags are false; a missing, null, or non-boolean flag is unknown and never counted either way. outbound/inherited/CI-YAML-defined variables are out of scope -- only variables configured directly on this project are evaluated.

Evidence

States the aggregate count of project CI/CD variables with at least one disabled safeguard, broken out into how many are unprotected and how many are unmasked (e.g. '3 project CI/CD variables have at least one disabled safeguard: 2 unprotected, 2 unmasked.').

Impact

Disabling a CI/CD variable's protection removes the restriction that would otherwise limit it to pipelines running on protected branches or protected tags; other pipeline eligibility rules (for example, job/pipeline rules, an environment scope, and merge-request-pipeline access settings for protected variables) still determine whether a given job can actually use it. A variable without masking is not automatically hidden from job logs, which can lead to its value being accidentally exposed there. Some of the affected variables may be ordinary, non-sensitive configuration where neither safeguard matters -- this finding reports only the aggregate count of variables with at least one safeguard disabled, never which specific variables, nor whether any of them actually hold a sensitive value. Inherited (group- or instance-level) variables and variables defined in CI/CD YAML rather than the project's own settings are outside this check's scope. See GitLab's CI/CD variables documentation (https://docs.gitlab.com/ci/variables/).

Recommendation

Review this project's CI/CD variable settings (Settings > CI/CD > Variables) and apply protection and masking to any variable that holds a secret or other sensitive value. Protection limits a variable's availability to pipelines running on protected branches and tags; masking reduces the risk of its value being accidentally exposed in job logs. Leave ordinary, non-sensitive configuration variables as-is.

Important limitations

Covers only variables configured directly on this project via GitLab's GraphQL API (GET /api/graphql) -- inherited group/instance-level variables and CI/CD-YAML-defined variables are never evaluated. Only each variable's protected and masked fields are read -- never its key, value, description, or environment scope. A missing, null, or non-boolean flag is unknown and never counted either way. If the GraphQL query is unavailable or denied, returns a GraphQL-level error, or the pagination cursor is missing or repeated, this check is skipped for the audit run rather than reporting a false clean result. Live verification against a real GitLab instance remains outstanding for this check.

← Back to the check catalogue