Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

Give each workflow's token only the permissions it needs

Ouverte
#1,333 1 commentaire 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 2 jours

@AlphaNen y travaille déjà.

Depuis le 21/10/2026.

  • #1334 par @AlphaNen — ouverte

Évaluation

Cette issue n'a pas encore été évaluée.

Description

good first issue help wanted

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.yaml and build-tag.yaml (their codecov jobs set contents: read and id-token: write at job level, but the other jobs inherit the default)
  • release-tag.yaml (job-level contents: read only)
  • run-tests.yaml
  • fossa.yaml
  • dapr-bot.yml
  • backport.yaml and dapr-bot-schedule.yml (these call reusable workflows in dapr/.github)

Proposed change

For each workflow:

  1. Add a top-level permissions: contents: read (or permissions: {} where no job reads the repo).
  2. Grant write scopes only on the job that needs them, keeping the existing job-level blocks (for example codecov's id-token: write).
  3. Several workflows do their writes with DAPR_BOT_TOKEN or a PyPI secret, not GITHUB_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 on GITHUB_TOKEN.
  4. 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.yaml already does this for open-issue-on-failure.yml.

Acceptance criteria

  1. Every workflow in .github/workflows/ has a top-level permissions: block that is read-only (contents: read, read-all or {}).
  2. Write scopes appear only at job level, on the jobs that need them.
  3. 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

  1. actionlint passes on the changed workflows.
  2. The PR's CI runs (build.yaml, run-tests.yaml) pass.
  3. To exercise scheduled and comment-triggered workflows, run them on your fork via workflow_dispatch or the triggering event.
  4. Optionally, run the scorecard CLI with --checks=Token-Permissions against your fork and confirm no findings.

Docs: Controlling permissions for GITHUB_TOKEN.

Langage dominant
Python
Étoiles
274
Forks
160
Merge moyen
1 j 23 h
PR mergées (30 j)
70

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de dapr/python-sdk

Toutes les issues de dapr/python-sdk

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.