harden-gitlab-ci

harden-gitlab-ci is a skill for Claude Code from jrjsmrtn/project-orchestration-skills. It costs 143 tokens per session (4,344 once invoked), scanned A, original, MIT.

A GitLab-specific guide for securing CI/CD pipelines, the automated jobs that build, test, and deploy software. It covers pinned dependencies, restricted job-token access, protected variables, image digests, and OIDC identity tokens.

In plain words
What is it for?
Adding or auditing `.gitlab-ci.yml`, securing GitLab variables and includes, restricting `CI_JOB_TOKEN`, pinning job images, and replacing persistent secrets with OIDC tokens.
Why use it?
It reduces supply-chain risks from untrusted pipeline code, overly broad access, mutable build images, and long-lived secrets.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the project-orchestration-skills plugin — 13 skills shipped together

Good fit Adding or auditing .gitlab-ci.yml, securing GitLab variables and includes, restricting CI_JOB_TOKEN, pinning job images, and replacing persistent secrets with OIDC tokens.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jrjsmrtn/project-orchestration-skills/harden-gitlab-ci
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jrjsmrtn/project-orchestration-skills --skill harden-gitlab-ci
Clone the repo
git clone --depth 1 https://github.com/jrjsmrtn/project-orchestration-skills

Made for: Claude Code.

Or install project-orchestration-skills, the plugin that ships this one along with the rest of its 13 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for harden-gitlab-ci

README.md
[![agentmods](https://agentmods.dev/badge/skills/jrjsmrtn/project-orchestration-skills/harden-gitlab-ci/github.svg)](https://agentmods.dev/skills/jrjsmrtn/project-orchestration-skills/harden-gitlab-ci)
Your own site
<a href="https://agentmods.dev/skills/jrjsmrtn/project-orchestration-skills/harden-gitlab-ci"><img src="https://agentmods.dev/badge/skills/jrjsmrtn/project-orchestration-skills/harden-gitlab-ci/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for harden-gitlab-ci

Your own site · 80×15
<a href="https://agentmods.dev/skills/jrjsmrtn/project-orchestration-skills/harden-gitlab-ci"><img src="https://agentmods.dev/badge/skills/jrjsmrtn/project-orchestration-skills/harden-gitlab-ci.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 143 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,344 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Tool Misuse · line 255
    Code deploys a privileged Kubernetes workload (privileged container, hostPath mount, or host namespaces). This grants root on the node and is a node/cluster takeover vector.
    Fix: Remove privileged, hostPath, and host-namespace settings from workloads. Use a least-privilege securityContext, drop capabilities, and avoid mounting the host filesystem.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00143 $0.04344
Opus 5 $0.00072 $0.02172
Sonnet 5 $0.00029 $0.00869
Haiku 4.5 $0.00014 $0.00434

Measured 11d ago against content hash 4c388d5a4f46, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

harden-gitlab-ci scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/harden-gitlab-ci/SKILL.md · 307 lines

How it starts

The opening of the file, as written. The whole thing — 307 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Harden GitLab CI

Harden GitLab CI/CD pipelines against supply-chain attack: pin what runs, minimise what it can reach, and stop long-lived secrets from existing at all.

GitLab-specific by design. Like harden-github-actions, this skill is deliberately bound to one forge. The controls are properties of the GitLab CI execution model — include: resolution, the CI_JOB_TOKEN allowlist, project/group variable scoping, id_tokens — not portable concepts in GitLab syntax. It is a sibling of harden-github-actions, not a translation of it: the two forges differ in what the risks are, not merely in how they are spelled.

When to Use

  • When adding a .gitlab-ci.yml to a project (after setup-git-hooks)
  • When auditing an existing pipeline before making a GitLab project public
  • When a supply-chain review (or the supply-chain skill) flags CI hardening gaps
  • When standardising pipeline hardening across GitLab projects

Not for: GitHub Actions (use harden-github-actions) or Forgejo/Gitea Actions. The controls do not carry over — say so rather than approximating.

Required Inputs

  1. Repository — a GitLab project (auto-detected from git remotes). Self-hosted GitLab is a first-class target, not an exception: authenticate once and every control below is identical.
  2. Project visibility — public/internal or private. Phases 3 and 4 branch on it: public and internal projects expose pipeline artifacts to unauthenticated users, and fork merge requests are the main variable-exfiltration route.
  3. Scope — what to run:
    • audit — report findings against the checklist below; no writes (default)
    • fix — apply the mechanical fixes (pin includes/components/images), leave judgment calls to the maintainer
    • fullaudit, then fix after confirmation

The GitLab Threat Model — What Actually Differs

Where the risk sits differs from GitHub Actions; the controls are not one-for-one equivalents:

Concern GitHub Actions GitLab CI
Third-party code execution uses: actions/x@ref from the Marketplace include: + CI/CD Catalog components — same class of risk, different keyword
Ambient credential GITHUB_TOKEN with repo-wide default scopes CI_JOB_TOKEN — defaults to own project only; risk is a widened allowlist
Secret exfiltration surface workflow can read all repo secrets variable scoping — protected/masked/environment-scoped, plus fork-MR exposure
Provenance / keyless auth OIDC via id-token: write id_tokens: with an aud claim
Runner trust GitHub-hosted vs self-hosted shared vs group/project runners, privileged Docker, shell executor

Read the full file on GitHub · 307 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 307 lines · 143 tokens per session scan A 4c388d5a4f46

Subscribe to this mod's changes

harden-gitlab-ci is a skill published in the GitHub repository jrjsmrtn/project-orchestration-skills (15 stars, last pushed 7d ago), licensed MIT. It adds 143 tokens to every session and 4,344 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories