Give each workflow's token only the permissions it needs
Los mantenedores suelen responder en 2 días
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 274
- Forks
- 160
- Merge medio
- 3 d 5 h
- PR fusionados (30 d)
- 79
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dapr/python-sdk
-
Add the OpenSSF Scorecard GitHub Action and publish the resultsPosiblemente ocupada @AdepuSriCharan la tomó hace 3 días. Abiertogood first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
dapr/python-sdk#1332 ·
Los mantenedores suelen responder en 2 días
-
SDK Alignment of Workflow ExamplesQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertodapr-ext-workflow good first issue kind/enhancement P2
Dificultad 2/5 1-2 días Aptitud para principiantes 72/100
dapr/python-sdk#853 · 4 comentarios ·
Los mantenedores suelen responder en 2 días
-
Add PyPI keywords and project links to the dapr packagePosiblemente ocupada @SpinachDigital la tomó hace 4 días. Abiertogood first issue help wanted kind/enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 20/100
dapr/python-sdk#1335 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
ci/release-failure release
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
dapr/python-sdk#1320 ·
Los mantenedores suelen responder en 2 días
-
ci/release-failure release
Dificultad 2/5 1-3 horas Aptitud para principiantes 49/100
dapr/python-sdk#1311 ·
Los mantenedores suelen responder en 2 días
Todos los issues de dapr/python-sdk
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
NVIDIA/flare-local-inference#90 ·
Los mantenedores suelen responder en 1 día
-
area/streaming comp/gateway P2 platform/telegram type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NousResearch/hermes-agent#144897 ·
Los mantenedores suelen responder en 1 día
-
request-theme
Dificultad 1/5 Menos de una hora Aptitud para principiantes 66/100
LizardByte/ThemerrDB#9575 ·
Los mantenedores suelen responder en 1 día
-
Author Page: noshin-nawalAbiertoauthor-page correction
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
acl-org/acl-anthology#10599 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
zilliztech/memsearch#818 ·
Los mantenedores suelen responder en 1 día