From 449ba284ce7dbf95bb8f02ea534cafbe14d19945 Mon Sep 17 00:00:00 2001 From: naveen <172697+naveensrinivasan@users.noreply.github.com> Date: Mon, 25 Apr 2022 23:38:27 +0000 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: naveen <172697+naveensrinivasan@users.noreply.github.com> --- .github/workflows/build.yml | 3 +++ .github/workflows/check-readme-in-sync.yml | 3 +++ .github/workflows/e2e | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f9f98248..923bb67bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,9 @@ name: Build on: [push, pull_request] +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/check-readme-in-sync.yml b/.github/workflows/check-readme-in-sync.yml index 28a82a29a..13912e5b9 100644 --- a/.github/workflows/check-readme-in-sync.yml +++ b/.github/workflows/check-readme-in-sync.yml @@ -10,6 +10,9 @@ on: branches: - gh-pages +permissions: + contents: read + jobs: check: runs-on: ubuntu-latest diff --git a/.github/workflows/e2e b/.github/workflows/e2e index f0c498e02..bd7a8f155 100644 --- a/.github/workflows/e2e +++ b/.github/workflows/e2e @@ -2,6 +2,9 @@ name: E2E on: [push, pull_request] +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest