From 13439b16e296530eeb60f51acdf43c214aa0f645 Mon Sep 17 00:00:00 2001 From: nathannaveen <42319948+nathannaveen@users.noreply.github.com> Date: Tue, 21 Jun 2022 00:58:52 +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/main.yml | 3 +++ .github/workflows/node.yml | 3 +++ .github/workflows/orm-check.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 34bc51fb252d..9c5d9e465b4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,9 @@ on: branches-ignore: - master +permissions: + contents: read + jobs: cartodb-news: runs-on: ubuntu-18.04 diff --git a/.github/workflows/node.yml b/.github/workflows/node.yml index 08f79fc7d78f..7f252cb66b33 100644 --- a/.github/workflows/node.yml +++ b/.github/workflows/node.yml @@ -2,6 +2,9 @@ name: Node.js Tests on: [pull_request] +permissions: + contents: read + jobs: build: diff --git a/.github/workflows/orm-check.yml b/.github/workflows/orm-check.yml index b97b62eb1dad..4c752b9726bb 100644 --- a/.github/workflows/orm-check.yml +++ b/.github/workflows/orm-check.yml @@ -3,6 +3,9 @@ on: push: branches-ignore: - master +permissions: + contents: read + jobs: orm-check: runs-on: ubuntu-latest