The practical approach is to shift checks into the merge request and CI pipeline, so developers get immediate feedback before code reaches production. Focus on dependency integrity, credential leaks, license issues, and vulnerable transitive packages. Keep the workflow inline with existing developer tooling, and use automated checks to reduce context switching, rework, and delayed security review.
Why This Matters for Security Teams
GitLab CI is often where supply chain risk becomes operational: dependency integrity checks, secret scanning, license review, and provenance validation all run at the exact point developers want fast feedback. The challenge is not deciding whether to check, but how to keep the pipeline useful enough that engineers do not bypass it. The risk profile is amplified when CI runners handle secrets or publish artifacts, which is why NHIMG research on the State of Secrets Sprawl 2026 shows CI/CD runners were 59% of compromised machines in a major 2025 supply chain attack.
Security teams should treat the pipeline as an enforcement point, not a reporting queue. That means shifting high-signal checks into merge requests, reducing false positives, and making remediation obvious inside the same developer workflow. Current guidance suggests prioritising controls that detect dependency tampering, exposed credentials, and malicious packages before merge, then reserving slower review paths for exceptions and higher-risk releases. The OWASP Non-Human Identity Top 10 is also relevant here because GitLab jobs, runners, and tokens are all non-human identities that can be over-privileged or poorly rotated. In practice, many security teams discover pipeline weaknesses only after a runner token, package credential, or signing key has already been abused.
How It Works in Practice
The least disruptive pattern is to make supply chain checks incremental and event-driven. Run lightweight checks on every merge request, then add deeper verification only when a change touches dependency manifests, CI templates, package publishing steps, or signing workflows. That keeps routine code changes fast while still inspecting the parts of the repo that actually change the attack surface.
In GitLab CI, the practical sequence is usually: scan for secrets, validate dependency locks and package integrity, inspect license policy, and verify artifact provenance or signature expectations. Teams should prefer checks that fail fast and are easy to understand, because developer adoption drops when a pipeline blocks on opaque findings. Where possible, use allowlists for known-good packages, signed releases, and trusted registries rather than broad manual approval gates.
- Keep secret scanning and dependency scanning in the merge request pipeline so feedback arrives before merge.
- Use short-lived tokens and runner-scoped permissions so CI jobs cannot reuse credentials beyond the task.
- Cache safe dependencies and isolate expensive verification to changed paths only.
- Send findings into the same merge request discussion thread so developers do not need a second tool to act.
- Require provenance checks for release branches and package publish jobs, not every routine commit.
This model works best when paired with supply chain hygiene lessons from incidents such as the Reviewdog GitHub Action supply chain attack, which shows how quickly trust can be abused inside CI automation. It also aligns with package-targeted compromise patterns seen in the Shai Hulud npm malware campaign, where malicious code aimed directly at developer workflows and secrets exposure. These controls tend to break down when every job runs as a privileged, long-lived runner with broad network access because one compromise then affects the whole delivery chain.
Common Variations and Edge Cases
Tighter supply chain control often increases build latency and alert volume, so organisations must balance release speed against the cost of false positives and manual review. That tradeoff becomes most visible when monorepos, frequent dependency updates, or generated code cause scans to fire on nearly every merge request.
Best practice is evolving around tiered enforcement. Current guidance suggests warning-only mode for low-risk findings, blocking mode for secrets and critical dependency tampering, and exception handling for legacy build paths. Some teams also separate developer-facing checks from release-gating checks so merge velocity stays high while production promotion remains strict. There is no universal standard for how aggressive license enforcement should be, especially across open source, internal packages, and third-party artifacts.
One practical nuance is that supply chain checks should not only inspect code. CI variables, container build contexts, package registries, and runner configuration can all introduce risk, especially when GitLab runners are shared or self-managed. NHIMG research on The State of Secrets in AppSec reinforces why this matters: leaked secrets can remain exploitable long after detection, so prevention and automated revocation should be treated as a single workflow. For teams that are still maturing, the best path is usually to start with high-confidence detections, tighten only the noisiest controls, and measure developer friction continuously.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-03 | CI tokens and runner credentials are NHI secrets that need rotation and scope control. |
| OWASP Agentic AI Top 10 | A-03 | Automated CI jobs behave like tool-using agents with delegated execution authority. |
| CSA MAESTRO | CTRL-2 | Supply chain validation supports agentic and automated workload trust boundaries. |
| NIST AI RMF | AI RMF applies when automation and generated code affect software supply chain decisions. | |
| NIST CSF 2.0 | PR.DS | Protecting software integrity and data in transit is core to CI supply chain checks. |
Limit GitLab job credentials to short-lived, least-privilege access and rotate runner tokens aggressively.
Related resources from NHI Mgmt Group
- How should security teams implement application security without slowing developers down?
- How should security teams implement CI/CD security without slowing delivery down?
- How should security teams integrate Java source scanning into CI pipelines without slowing developers down?
- How should security teams implement just-in-time secrets for AI-powered development without slowing developers down?