Give each workflow's token only the permissions it needs
メンテナーはふだん 2 日以内に返信
評価
この issue はまだ評価されていません。
説明
Problem
When a workflow doesn't declare permissions:, its GITHUB_TOKEN gets the repository's default permissions, which can include write access to contents, pull requests, issues and more. If a step or third-party action is ever compromised, it can use that token. The OpenSSF Scorecard Token-Permissions check asks for a read-only token at the top level of every workflow, with any write permission granted only on the job that needs it.
In python-sdk, only automerge-queue.yaml sets a top-level permissions: today ({}). These workflows have none:
build.yamlandbuild-tag.yaml(their codecov jobs setcontents: readandid-token: writeat job level, but the other jobs inherit the default)release-tag.yaml(job-levelcontents: readonly)run-tests.yamlfossa.yamldapr-bot.ymlbackport.yamlanddapr-bot-schedule.yml(these call reusable workflows in dapr/.github)
Proposed change
For each workflow:
- Add a top-level
permissions: contents: read(orpermissions: {}where no job reads the repo). - Grant write scopes only on the job that needs them, keeping the existing job-level blocks (for example codecov's
id-token: write). - Several workflows do their writes with
DAPR_BOT_TOKENor a PyPI secret, notGITHUB_TOKEN(dapr-bot.yml,release-tag.yaml,build-tag.yaml's upload,backport.yaml,dapr-bot-schedule.yml). Those jobs shouldn't need write scopes onGITHUB_TOKEN. - For jobs that call reusable workflows (
uses: dapr/.github/.github/workflows/...), the caller's permissions cap what the called workflow gets, so check what each reusable workflow needs before restricting it.build-tag.yamlalready does this foropen-issue-on-failure.yml.
Acceptance criteria
- Every workflow in
.github/workflows/has a top-levelpermissions:block that is read-only (contents: read,read-allor{}). - Write scopes appear only at job level, on the jobs that need them.
- CI on the PR is green, and the release, bot and scheduled workflows are checked by reading through what they call (or by a test run on a fork).
How to test
actionlintpasses on the changed workflows.- The PR's CI runs (
build.yaml,run-tests.yaml) pass. - To exercise scheduled and comment-triggered workflows, run them on your fork via
workflow_dispatchor the triggering event. - Optionally, run the scorecard CLI with
--checks=Token-Permissionsagainst your fork and confirm no findings.
- 主要言語
- Python
- スター
- 274
- フォーク
- 160
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 71
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dapr/python-sdk のほかの issue
-
Add the OpenSSF Scorecard GitHub Action and publish the results対応中かも @AdepuSriCharan が 5 日前に担当しました。 オープンgood first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dapr/python-sdk#1332 ·
メンテナーはふだん 2 日以内に返信
-
SDK Alignment of Workflow Examples再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンdapr-ext-workflow good first issue kind/enhancement P2
難易度 2/5 1〜2日 初心者へのやさしさ 72/100
dapr/python-sdk#853 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 47/100
dapr/python-sdk#1346 ·
メンテナーはふだん 2 日以内に返信
-
Add PyPI keywords and project links to the dapr package対応中かも @SpinachDigital が 6 日前に担当しました。 オープンgood first issue help wanted kind/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 20/100
dapr/python-sdk#1335 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
ci/release-failure release
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
dapr/python-sdk#1320 ·
メンテナーはふだん 2 日以内に返信
dapr/python-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
btclib-org/btclib-wallet#587 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Judgment-Pack/judgment-pack-spec#275 ·
メンテナーはふだん 1 日以内に返信
-
ai-generated
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
documentation good first issue priority: low size: XS
難易度 1/5 1〜3時間 初心者へのやさしさ 92/100
yeongseon/azure-functions-doctor-python#651 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
Changaco/python-libarchive-c#146 ·