Skip to content

Enabling GitHub attestations results in overly broad permissions #2133

@samypr100

Description

@samypr100

Currently, when github-attestations = true, release.yml ends up having a permission structure like shown below

name: Release

permissions:
  "attestations": "write"
  "contents": "write"
  "id-token": "write"

...

jobs:

...

In practice, having attestations and id-token write at the workflow level is considered bad practice per zizmor.

Ideally, these permissions should be set at the corresponding job that generates attestations instead. For example,

...
build-local-artifacts:
...
    permissions:
      "attestations": "write"
      "contents": "read"
      "id-token": "write"
    steps:
...

or

host:
...
    permissions:
      "attestations": "write"
      "contents": "write"
      "id-token": "write"
    steps:
...

Since these are builtin jobs, I believe these permissions would not need to be exposed to the end-user for configurability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions