Repository navigation
ci: run CI on self-hosted runners - #36
Conversation
Same-repo pull requests run on the cached self-hosted runner and pushes on the uncached one; forks and Dependabot stay on GitHub's machines, and an empty runner variable falls back to ubuntu-latest. The expression is crunchtools/trentina's security.yml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7Y1jeWKZVB8rtVJ3TZsRc
| # Same-repo PRs run on our cached runner, pushes and schedules on the uncached | ||
| # one; forks and Dependabot stay on GitHub's. An empty variable falls back to | ||
| # ubuntu-latest (crunchtools/trentina security.yml). | ||
| runs-on: >- |
There was a problem hiding this comment.
HIGH (Security Scan): Same-repository pull requests from non-Dependabot users are routed to the cached runner. PR code can execute during CI, so a malicious or compromised contributor can target the runner’s cached state and any credentials or other resources available to that runner. The previous configuration used GitHub-hosted runners.
Suggestion: Run pull-request code on an isolated, ephemeral GitHub-hosted runner, or ensure the cached runner is ephemeral and isolated from credentials and other jobs. Restrict cached-runner use to trusted code if that isolation cannot be guaranteed.
Evidence:
runs-on: >-
${{ github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository
&& github.event.pull_request.user.login != 'dependabot[bot]'
&& (vars.CACHED_RUNNER_LABEL || 'ubuntu-latest')
There was a problem hiding this comment.
Not a bug: only same-repo PRs reach the cached runner, and opening one needs write access to this repo, which is the same trust an org member already has to merge. Fork and Dependabot PRs stay on GitHub-hosted runners. The cached runner holds no registry or App secrets and nothing it builds is published: pushes and publishes run on the uncached, tmpfs-backed runner. This is the accepted design from crunchtools/trentina security.yml (fleet sweep a275).
Moves this repo's own CI gate jobs (sdlc ci and friends) from
ubuntu-latestto the self-hosted runners, with the expression from crunchtools/trentina'ssecurity.yml:vars.CACHED_RUNNER_LABELvars.UNCACHED_RUNNER_LABELubuntu-latestubuntu-latest(the kill switch)Only
runs-onchanges. Untouched:pull_request_targetjobs, agent workflows (ashigaru, code, fix, router), release/publish jobs that hold secrets, dependabot-automerge. Fleet sweep a275; squash auto-merge on.🤖 Generated with Claude Code
https://claude.ai/code/session_01R7Y1jeWKZVB8rtVJ3TZsRc