Skip to content

chore: Set permissions for GitHub actions#2051

Merged
lpinca merged 7 commits intowebsockets:masterfrom
turrisxyz:Pinned-Dependencies-GitHub
Jun 4, 2022
Merged

chore: Set permissions for GitHub actions#2051
lpinca merged 7 commits intowebsockets:masterfrom
turrisxyz:Pinned-Dependencies-GitHub

Conversation

@neilnaveen
Copy link
Contributor

 Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
@lpinca
Copy link
Member

lpinca commented May 31, 2022

I don't think this is needed. We are not using pull_request_target. We are using the standard pull_request trigger and by default it prevents write permissions and secrets access to the target repository.

test:
permissions:
checks: write # for coverallsapp/github-action to create new checks
contents: read # for actions/checkout to fetch code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this inherited from the same permission defined at the root level? If so, can you please remove it?

@lpinca lpinca merged commit a6dbd1c into websockets:master Jun 4, 2022
@lpinca
Copy link
Member

lpinca commented Jun 4, 2022

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants