fleetlint Policy for a fleet of repositories
v0.11 (latest)
Getting started

ci/actions-pinned

Actions and CI includes are pinned

Severitywarning
Tiers1
Stacksany
Scoperoot
Kindexpr
Sourcelibrary v0.8.0
Selected byfleetlint-recommended@v0.8.0

Requirement

Every uses: reference in a GitHub, Gitea or Forgejo workflow is pinned to a full 40-character commit SHA with a version comment; a docker:// image is pinned by @sha256: digest; local actions (./path) are exempt. In GitLab CI, a project include has a commit SHA as ref:, a component a commit SHA as its version, and a remote include an integrity: hash; local and template includes are exempt.

Why

A tag or branch can be moved; a SHA cannot. Pinning is what makes a pipeline reproducible and tamper-evident.

Applies when

workflows().size() > 0

Check

For each item in:

grep(".github/workflows/*.y*ml", r'^\s*-?\s*uses:\s*["\x27]?([^\s"\x27#]+)') + grep(".gitea/workflows/*.y*ml", r'^\s*-?\s*uses:\s*["\x27]?([^\s"\x27#]+)') + grep(".forgejo/workflows/*.y*ml", r'^\s*-?\s*uses:\s*["\x27]?([^\s"\x27#]+)') + workflows().filter(w, ci_kind(w) == "gitlab").map(w,
    includes(w).filter(i, i.type in ["project", "component", "remote"]).map(i, {
      "path": w,
      "name": i.type + " " + i.target + (i.ref != "" ? "@" + i.ref : ""),
      "kind": i.type, "target": i.target, "ref": i.ref
    })).flatten()
"kind" in item
  ? (item.kind == "remote"
      ? [dyn(yaml(item.path)["include"])].exists(inc, (type(inc) == list ? inc : [inc]).exists(e,
          type(e) == map && "remote" in e && e.remote == item.target && "integrity" in e))
      : item.ref.matches("^[0-9a-f]{40}$"))
  : (item.match.startsWith("./")
      || (item.match.startsWith("docker://") ? item.match.contains("@sha256:") : item.match.matches("@[0-9a-f]{40}$")))

Fix

Run pinact run for Actions workflows; pin GitLab includes to commit SHAs. Let Renovate keep the pins current.

Agent instruction: Run pinact run to pin all uses: references to SHAs with version comments, pin docker:// images by digest, and set GitLab project includes and components to commit SHAs (remote includes get integrity:); do not change anything else.

Sources


Generated by fleetlint docs from catalog v0.8.0.