From 2d03d82fd96fb3c96c973bf955b3b8e8ba52b735 Mon Sep 17 00:00:00 2001 From: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com> Date: Fri, 15 Apr 2022 21:17:06 -0500 Subject: [PATCH] Set permissions for GitHub actions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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/) 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. Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com> --- .github/workflows/codespell.yml | 3 +++ .github/workflows/docker-3.1dev.yml | 3 +++ .github/workflows/test.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 6b3b084..1c33479 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -1,6 +1,9 @@ --- name: Codespell on: [push, pull_request] +permissions: + contents: read + jobs: codespell: name: Check for spelling errors diff --git a/.github/workflows/docker-3.1dev.yml b/.github/workflows/docker-3.1dev.yml index c3cb57a..4117aa5 100644 --- a/.github/workflows/docker-3.1dev.yml +++ b/.github/workflows/docker-3.1dev.yml @@ -12,6 +12,9 @@ env: BUILD_VERSION: "3.1dev" DOCKER_CLI_EXPERIMENTAL: enabled +permissions: + contents: read + jobs: deploy: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb40fb3..f3f1ee4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,9 @@ on: - 'LICENSE' - 'Dockerfile' +permissions: + contents: read + jobs: build: runs-on: ${{ matrix.os }}