Skip to content

Set minimal permissions to Github Workflows #3971

Closed
@joycebrum

Description

@joycebrum

Description

I would like to also suggest another supply-chain security, if I may, which is to use credentials that are minimally scoped.

This is one aspect of supply-chain security checked by the OpenSSF Scorecard and also strongly recommended by the GitHub Security.

Thus, setting top level permissions to contents: read and all write permissions being granted on run level is a simple but important practice regarding GitHub Workflows.

I'll suggest a PR with the permissions changes to be easier to understand them, so let me know if you have any doubts or concerns.

Reproduction steps

None

Expected vs. actual results

Expected:

GITHUB_TOKEN to be initialized with minimal permissions

Actual:
GITHUB_TOKEN has all write permissions

Minimal code example

permissions:
    contents: read

Error messages

No response

Compiler and operating system

None

Library version

None

Validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugsolution: proposed fixa fix for the issue has been proposed and waits for confirmation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions