Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Give each workflow's token only the permissions it needs

Abierto
#1,333 1 comentario 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 2 días

@AlphaNen ya está trabajando en esto.

Desde el 21/10/2026.

  • #1334 de @AlphaNen — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
Python
Estrellas
274
Forks
160
Merge medio
3 d 5 h
PR fusionados (30 d)
79

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de dapr/python-sdk

Todos los issues de dapr/python-sdk

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.