ci: restrict GitHub Actions token permissions across workflows
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
Start by inventorying the workflow files under .github/workflows and reviewing the four workflows added by PR #1906; also check where the repository's default workflow permissions are configured. Verify which jobs need token access and review third-party action references before changing permissions or pins. Done means every workflow has explicit least-privilege permissions, required write access is documented and narrowly scoped, and build, test, cache, and artifact-upload behavior remains green.
索引モデルが issue の本文から書いたものです。
説明
Problem
The repository currently has default_workflow_permissions set to write. None of the eight existing workflows declares an explicit permissions: block, so jobs inherit that write-enabled GITHUB_TOKEN on master pushes and other non-fork executions even though the workflows only build, test, and upload artifacts.
Six existing workflows also invoke non-actions/* actions from mutable references (google/oss-fuzz/...@master, emscripten-core/setup-emsdk@v16, msys2/setup-msys2@v2, and microsoft/setup-msbuild@v3). An action can access github.token even when the token is not explicitly passed, so the current default grants more repository access than these jobs require.
PR #1906 adds four VM-based workflows with the same repository-wide baseline. That PR is intended to merge as-is; this issue tracks the security hardening separately and consistently across both the existing workflows and the workflows added there.
Proposed hardening
- Change the repository's default workflow permission to read-only, if there is no administrative dependency on the write-enabled default.
- Add an explicit top-level
permissions: contents: readdeclaration to every build/test workflow, including the four workflows added by #1906, so least privilege remains visible and enforced in version control. - Review third-party action references and pin them to verified full commit SHAs where practical; full SHAs are immutable, unlike major-version tags and branches.
- If a future job genuinely needs write access, grant only the required permission at that job level rather than restoring a workflow-wide or repository-wide write default.
Acceptance criteria
- Every GitHub Actions workflow has explicit least-privilege token permissions.
- Ordinary build, test, cache, and artifact-upload behavior remains green with
contents: read. - Any necessary write permission is documented and scoped to the specific job.
- Third-party action references have been reviewed and either pinned to full SHAs or consciously documented as mutable.
Related to #1906. This is follow-up work and is not intended to block that PR or be closed by its merge.
Generated by Codex (GPT-5.6 Sol).
- 主要言語
- C
- スター
- 6.2k
- フォーク
- 2.1k
- 平均マージ
- 28日 9時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libusb/libusb のほかの issue
-
build_ci
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
メンテナーはふだん 4 日以内に返信
-
android core
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 4 日以内に返信
-
Windows version of libusb-master (MSVC build) can't be built when git installed w/o bash対応中かも @Youw が 22 日前に担当しました。 オープンwindows
libusb/libusb#1962 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 4 日以内に返信
-
windows
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
libusb/libusb#1949 · コメント 8 件 ·
メンテナーはふだん 4 日以内に返信
-
core enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 4 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
libsdl-org/SDL#16530 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
FriendsofECCE/ECCE#336 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
fw876/helloworld#2067 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
immortalwrt/immortalwrt#2501 ·
-
dnsmasq版本低オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
coolsnowwolf/lede#14222 ·