From f376b507525a8987f72626819558d834322e6031 Mon Sep 17 00:00:00 2001 From: naveen <172697+naveensrinivasan@users.noreply.github.com> Date: Mon, 6 Jun 2022 00:29:22 +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/ci.yml | 3 +++ .github/workflows/notify.yml | 3 +++ .github/workflows/release.yml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 776e96eaff3..9bf715fada8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,9 @@ env: ERLC_OPTS: "warnings_as_errors" LANG: C.UTF-8 +permissions: + contents: read + jobs: test_linux: name: Linux, ${{ matrix.otp_release }}, Ubuntu 18.04 diff --git a/.github/workflows/notify.yml b/.github/workflows/notify.yml index 489162b6476..99965268dfc 100644 --- a/.github/workflows/notify.yml +++ b/.github/workflows/notify.yml @@ -5,6 +5,9 @@ on: types: - published +permissions: + contents: read + jobs: notify: runs-on: ubuntu-18.04 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 225050e168a..3afe8fa0728 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,8 @@ env: jobs: create_draft_release: + permissions: + contents: none runs-on: ubuntu-18.04 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}