From 0e4f74d8f540f3ecf5590d93cafa8c200ec8be17 Mon Sep 17 00:00:00 2001 From: neilnaveen <42328488+neilnaveen@users.noreply.github.com> Date: Thu, 14 Apr 2022 00:08:38 +0000 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: neilnaveen <42328488+neilnaveen@users.noreply.github.com> --- .github/workflows/docker-amd64.yml | 3 +++ .github/workflows/pre-commit.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/docker-amd64.yml b/.github/workflows/docker-amd64.yml index 05010afd..90d7ce2d 100644 --- a/.github/workflows/docker-amd64.yml +++ b/.github/workflows/docker-amd64.yml @@ -48,6 +48,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: build-test-amd64-images: name: Build and test amd64 Docker Images diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index e138699e..b3bdb929 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -8,6 +8,9 @@ on: - master workflow_dispatch: +permissions: + contents: read + jobs: run-hooks: name: Run pre-commit hooks