From cb1ded8d9f6a7ae870bc90cb390151adad180dd9 Mon Sep 17 00:00:00 2001 From: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com> Date: Sat, 16 Apr 2022 18:56:39 -0500 Subject: [PATCH] chore: Set permissions for GitHub actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com> --- .github/workflows/check-licenses.yml | 3 +++ .github/workflows/main.yml | 3 +++ .github/workflows/wiki.yml | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/.github/workflows/check-licenses.yml b/.github/workflows/check-licenses.yml index d9aa35630..f577d0940 100644 --- a/.github/workflows/check-licenses.yml +++ b/.github/workflows/check-licenses.yml @@ -6,6 +6,9 @@ on: pull_request: paths: - 'vendor' +permissions: + contents: read + jobs: build: name: Build diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a08dc76ed..47f59961b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,9 @@ on: paths-ignore: - 'docs/**' - '**.md' +permissions: + contents: read + jobs: build: name: Build diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml index 05f2fd02b..2c8686d6a 100644 --- a/.github/workflows/wiki.yml +++ b/.github/workflows/wiki.yml @@ -5,8 +5,13 @@ on: - 'docs/*' branches: - master +permissions: + contents: read + jobs: build: + permissions: + contents: write # for Git to git push runs-on: ubuntu-latest steps: - uses: actions/checkout@master