glsec

glsec is a security linter for .gitlab-ci.yml files. It detects misconfigurations that can lead to supply-chain attacks, secret leakage, and token exfiltration — the same class of issues that zizmor and actionlint catch in GitHub Actions, but for GitLab CI.
Website and rule reference: glsec.github.io
$ glsec .gitlab-ci.yml
error[GL001]: image "node:latest" uses mutable tag "latest" — pin to a specific version or digest
--> .gitlab-ci.yml:8:10 (job: build)
|
8 | image: node:latest
| ^
warn[GL002]: unquoted user-controlled variable $CI_COMMIT_MESSAGE in script — value is written by whoever creates the commit, tag or release; the shell splits it into words and expands globs, so it can add arguments
--> .gitlab-ci.yml:14:7 (job: build)
|
14 | - echo $CI_COMMIT_MESSAGE
| ^
info[GL053]: no top-level workflow:rules — pipelines run for every push, tag, trigger, API call and merge request event, also a fork's merge request that a member runs in this project; gate on $CI_PIPELINE_SOURCE or branch to block untrusted pipeline execution
--> .gitlab-ci.yml:1:1
|
1 | stages:
| ^
Use --format table for a compact one-line-per-finding view when there are many findings.
Quick start
Add glsec to a GitLab pipeline with the CI/CD Catalog component:
include:
- component: gitlab.com/glsec-io/glsec/[email protected]
It adds a glsec job that runs in the test stage (set the stage input to change that) and fails on error findings. For findings in merge requests, Docker, binary or GitHub Actions setups, see CI integration. To run it locally, see Install.
Why glsec?
| Tool | Scope |
|---|
| zizmor | GitHub Actions security |
| actionlint | GitHub Actions syntax + some security |
| gitlab-ci-lint | GitLab CI syntax only (requires API access) |
| glsec | GitLab CI security — works offline, no API key needed |
- 97 rules across the OWASP Top 10 CI/CD Security Risks, each mapped to CWE: mutable images, secrets in variables, script injection, token exfiltration, unrestricted OIDC tokens, untrusted includes and more.
- Findings where you review code: GitLab Code Quality reports in merge requests, JUnit, SARIF for GitHub Code Scanning, JSON.
- Adoptable on existing pipelines: a baseline file and
--new-only report only what a change introduces; suppressions carry a reason and an expiry date.
- Trustworthy releases: signed, with SLSA provenance and reproducible builds (details).
Install
Package managers:
brew install glsec/tap/glsec # Homebrew (macOS and Linux)
aqua g -i glsec/glsec && aqua i # aqua
mise use github:glsec/glsec # mise
pipx install glsec # PyPI (or: uv tool install glsec, uvx glsec)