From 1479e696c35dcb77f59e34ce76055d8770e36e10 Mon Sep 17 00:00:00 2001 From: neilnaveen <42328488+neilnaveen@users.noreply.github.com> Date: Fri, 8 Apr 2022 08:44:43 -0500 Subject: [PATCH] Added permissions for GitHub actions (#3804) 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/build.yml | 3 +++ .github/workflows/documentation.yml | 3 +++ .github/workflows/publish.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3669bac2f..aa00aa25a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,6 +26,9 @@ on: env: NODE_VERSION: 14.x +permissions: + contents: read + jobs: build: name: Build project diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index c43c69c3e..7a310b0b8 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -27,6 +27,9 @@ on: env: PYTHON_VERSION: 3.x +permissions: + contents: read + jobs: documentation: name: Build documentation diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e8f29c1cc..cafb9cd17 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,6 +27,9 @@ on: env: PYTHON_VERSION: 3.x +permissions: + contents: read + jobs: publish_pypi: name: Build and push Python package