Skip to content

security: adopt supply chain security defaults - #153

Merged
felickz merged 3 commits into
mainfrom
felickz-special-robot
Jul 6, 2026
Merged

security: adopt supply chain security defaults#153
felickz merged 3 commits into
mainfrom
felickz-special-robot

Conversation

@felickz

@felickz felickz commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
  • dependabot.yml: add 7-day cooldown (cooldown.default-days: 3) to the github-actions updates entry; all other config preserved unchanged.
  • ci.yml: add explicit least-privilege GITHUB_TOKEN permissions (workflow default contents: read, with pull-requests: write/read overrides only where gh pr comment / gh pr view are used).
  • update-release.yml: add explicit contents: read permissions (PR creation already uses a scoped GitHub App token, not GITHUB_TOKEN).
  • hotspots.yml: add TODO comment flagging the unpinned, non-hash-checked pip install for human review.

No Ruby/Go/npm application dependency manifests exist in this repo (only CodeQL qlpack.yml packs and Go/CodeQL test fixtures), so npm ci/bundler frozen mode/go -mod=readonly/.npmrc min-release-age/uv exclude-newer changes do not apply. No pull_request_target usage found. All third-party Actions are already pinned to full commit SHAs.

- dependabot.yml: add 7-day cooldown (cooldown.default-days: 3) to the
  github-actions updates entry; all other config preserved unchanged.
- ci.yml: add explicit least-privilege GITHUB_TOKEN permissions
  (workflow default contents: read, with pull-requests: write/read
  overrides only where gh pr comment / gh pr view are used).
- update-release.yml: add explicit contents: read permissions (PR
  creation already uses a scoped GitHub App token, not GITHUB_TOKEN).
- hotspots.yml: add TODO comment flagging the unpinned, non-hash-checked
  pip install for human review.

No Ruby/Go/npm application dependency manifests exist in this repo (only
CodeQL qlpack.yml packs and Go/CodeQL test fixtures), so npm ci/bundler
frozen mode/go -mod=readonly/.npmrc min-release-age/uv exclude-newer
changes do not apply. No pull_request_target usage found. All third-party
Actions are already pinned to full commit SHAs.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 6, 2026 15:47
@felickz

felickz commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix this todo ... this is a general plan to resolve:

run something like pip install pip-tools && pip-compile --generate-hashes ql/hotspots/requirements.txt (or uv pip compile --generate-hashes) to produce a fully pinned, hashed lockfile.

Update the workflow step to pip install -r ql/hotspots/requirements.txt --require-hashes (or better, pip install --require-hashes -r ), dropping the ad hoc pip install pandas.

Add pyyaml explicitly to that install path (fixing the latent gap) and confirm the job still succeeds end-to-end (a real workflow_dispatch run, since there's no test harness for this path).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens supply-chain/security defaults for the repository’s GitHub automation by explicitly scoping GITHUB_TOKEN permissions, throttling Dependabot update PRs, and flagging a non-deterministic Python dependency install for follow-up.

Changes:

  • Add explicit least-privilege permissions: blocks to workflows (workflow-level defaults plus job overrides where PR interactions are needed).
  • Add a Dependabot cooldown setting for GitHub Actions updates.
  • Add a TODO note in the hotspots workflow calling out an unpinned/non-hash-checked pip install.
Show a summary per file
File Description
.github/workflows/ci.yml Sets workflow/job GITHUB_TOKEN permissions defaults and PR-specific overrides.
.github/workflows/update-release.yml Adds explicit contents: read permissions for the release-update workflow.
.github/workflows/hotspots.yml Adds a TODO comment documenting supply-chain risk around unpinned pip install.
.github/dependabot.yml Adds a cooldown setting for Dependabot GitHub Actions updates.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 3
  • Review effort level: Low

Comment thread .github/workflows/ci.yml
Comment thread .github/dependabot.yml Outdated
Comment thread .github/workflows/ci.yml
…in workflow

- Add ql/hotspots/requirements.in (abstract, unpinned deps)
- Generate ql/hotspots/requirements.txt with pip-compile --generate-hashes
  (fully pinned versions + SHA-256 hashes for all transitive deps)
- Update hotspots.yml: replace unpinned `pip install pandas` with
  `pip install --require-hashes -r ql/hotspots/requirements.txt`

Copilot AI commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@copilot fix this todo ... this is a general plan to resolve:

run something like pip install pip-tools && pip-compile --generate-hashes ql/hotspots/requirements.txt (or uv pip compile --generate-h...

Done. Changes in commit b0b13d7:

  • Added ql/hotspots/requirements.in with the original abstract (unpinned) dependencies for human editing.
  • Generated ql/hotspots/requirements.txt via pip-compile --generate-hashes requirements.in, producing fully pinned versions with SHA-256 hashes for all transitive deps (594 lines).
  • Updated hotspots.yml: replaced pip install pandas with pip install --require-hashes -r ql/hotspots/requirements.txt.

To update deps in the future, edit requirements.in and re-run pip-compile --generate-hashes --no-strip-extras --output-file=requirements.txt requirements.in from ql/hotspots/.

@felickz felickz left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

:octocat: 👍

@felickz
felickz merged commit 6fcde17 into main Jul 6, 2026
22 checks passed
@felickz
felickz deleted the felickz-special-robot branch July 6, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants