Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

ci: restrict GitHub Actions token permissions across workflows

オープン
#1,908 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 4 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
github-actions
領域
ci-cd, security

調査の方向性

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 の本文から書いたものです。

説明

build_ci

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: read declaration 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 を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

libusb/libusb のほかの issue

libusb/libusb の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。