release/hosted-builder
Releases build on hosted runners
| Severity | info |
| Tiers | 1 |
| Stacks | any |
| Scope | root |
| Kind | expr |
| Source | library v0.3.1 |
| Selected by | fleetlint-recommended@v0.3.1 |
Requirement
Jobs of a tag-triggered GitHub workflow run on GitHub-hosted runners, not self-hosted ones, so the build platform is isolated and ephemeral (SLSA Build L2 and up). Gitea, Forgejo and GitLab are not checked: their runners are mostly self-hosted by design, and GitLab.com’s hosted runners cannot be told apart from the file.
Why
A persistent self-hosted runner carries state between jobs; anything that compromised one earlier job can tamper with the release.
Applies when
tagged_workflows().exists(w, ci_kind(w) == "github")Check
For each item in:
tagged_workflows().filter(w, ci_kind(w) == "github" && type(yaml(w)) == map && "jobs" in yaml(w) && type(yaml(w).jobs) == map).map(w,
yaml(w).jobs.map(k, {
"path": w,
"name": k,
"ok": !(type(yaml(w).jobs[k]) == map && "runs-on" in yaml(w).jobs[k] && [dyn(yaml(w).jobs[k]["runs-on"])].exists(r,
[dyn(type(r) == map && "labels" in r ? r.labels : r)].exists(l,
type(l) == list ? l.exists(x, x == "self-hosted") : l == "self-hosted")))
})).flatten()item.okFix
Move the release job to a GitHub-hosted runner (ubuntu-latest), or document why it cannot and add an exception.
Agent instruction: Change runs-on of the flagged release jobs to a GitHub-hosted label such as ubuntu-latest; if the build needs special hardware, tell the user instead of changing it.
See: https://fleetlint.org/baseline/#releases
Generated by fleetlint docs from catalog v0.3.1.