Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,17 @@ permissions:
jobs:
sdlc:
name: sdlc ci
runs-on: ubuntu-latest
# 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: >-

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

${{ 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')
|| github.event_name != 'pull_request'
&& (vars.UNCACHED_RUNNER_LABEL || 'ubuntu-latest')
|| 'ubuntu-latest' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down
Loading