Give each workflow's token only the permissions it needs
Les mainteneurs répondent en général sous 2 jours
Évaluation
Cette issue n'a pas encore été évaluée.
Description
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.
- Langage dominant
- Python
- Étoiles
- 274
- Forks
- 160
- Merge moyen
- 1 j 23 h
- PR mergées (30 j)
- 70
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de dapr/python-sdk
-
Add the OpenSSF Scorecard GitHub Action and publish the resultsPeut-être pris @AdepuSriCharan l’a pris il y a 4 jours. Ouvertegood first issue help wanted
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
dapr/python-sdk#1332 ·
Les mainteneurs répondent en général sous 2 jours
-
SDK Alignment of Workflow ExamplesPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. Ouvertedapr-ext-workflow good first issue kind/enhancement P2
Difficulté 2/5 1-2 jours Accessibilité débutants 72/100
dapr/python-sdk#853 · 4 commentaires ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 47/100
dapr/python-sdk#1346 ·
Les mainteneurs répondent en général sous 2 jours
-
Add PyPI keywords and project links to the dapr packagePeut-être pris @SpinachDigital l’a pris il y a 5 jours. Ouvertegood first issue help wanted kind/enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 20/100
dapr/python-sdk#1335 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
ci/release-failure release
Difficulté 2/5 1-3 heures Accessibilité débutants 25/100
dapr/python-sdk#1320 ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de dapr/python-sdk
Issues similaires
-
No test checks that scheduled workflows declare minimal permissions, concurrency and a timeoutOuverteci enhancement testing
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
area/config comp/tools P2 platform/telegram type/bug
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
NousResearch/hermes-agent#145412 ·
Les mainteneurs répondent en général sous 1 jour
-
[oblt-aw][autodoc] Update docs for security org scaffolding and Docs AI menu permission changesPeut-être pris @github-actions l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
curriculum documentation quality
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
githubnext/gh-aw-workshop#5039 ·
Les mainteneurs répondent en général sous 1 jour
-
Community project: hosted MOSS-Image studio with a visual JSON layout builder (no ComfyUI needed)Ouverte
Difficulté 1/5 1-3 heures Accessibilité débutants 65/100
OpenMOSS/MOSS-Image#27 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour