From 701ce8ad47cba6a63002d5c339349abba4cd952f Mon Sep 17 00:00:00 2001 From: nathannaveen <42319948+nathannaveen@users.noreply.github.com> Date: Mon, 30 May 2022 00:58:20 +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: nathannaveen <42319948+nathannaveen@users.noreply.github.com> --- .github/workflows/automated-tests.yml | 3 +++ .github/workflows/codecov-test-suites.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/automated-tests.yml b/.github/workflows/automated-tests.yml index ce359589..23cad502 100644 --- a/.github/workflows/automated-tests.yml +++ b/.github/workflows/automated-tests.yml @@ -9,6 +9,9 @@ on: pull_request: branches: [master, develop] +permissions: + contents: read + jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/codecov-test-suites.yml b/.github/workflows/codecov-test-suites.yml index d080a18b..b3276f27 100644 --- a/.github/workflows/codecov-test-suites.yml +++ b/.github/workflows/codecov-test-suites.yml @@ -8,6 +8,9 @@ on: pull_request: branches: [master, develop] +permissions: + contents: read + jobs: run-and-upload-coverage-report: runs-on: ubuntu-latest