From 879de20edff8957403513c97934d2fa97e12a026 Mon Sep 17 00:00:00 2001 From: Naveen <172697+naveensrinivasan@users.noreply.github.com> Date: Mon, 11 Apr 2022 04:45:59 -0500 Subject: [PATCH] Set permissions for GitHub actions (#14693) 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-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. https://www.legitsecurity.com/blog/github-privilege-escalation-vulnerability Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com> --- .github/workflows/go-healing.yml | 3 +++ .github/workflows/go-lint.yml | 3 +++ .github/workflows/go.yml | 3 +++ .github/workflows/iam-integrations.yaml | 3 +++ .github/workflows/markdown-lint.yaml | 3 +++ .github/workflows/replication.yaml | 3 +++ .github/workflows/upgrade-ci-cd.yaml | 3 +++ 7 files changed, 21 insertions(+) diff --git a/.github/workflows/go-healing.yml b/.github/workflows/go-healing.yml index c57e221c3..7bfccacdc 100644 --- a/.github/workflows/go-healing.yml +++ b/.github/workflows/go-healing.yml @@ -11,6 +11,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true +permissions: + contents: read + jobs: build: name: Go ${{ matrix.go-version }} on ${{ matrix.os }} diff --git a/.github/workflows/go-lint.yml b/.github/workflows/go-lint.yml index b6442052a..4c9da0ce0 100644 --- a/.github/workflows/go-lint.yml +++ b/.github/workflows/go-lint.yml @@ -11,6 +11,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true +permissions: + contents: read + jobs: build: name: Go ${{ matrix.go-version }} on ${{ matrix.os }} diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 1845987dc..3aa0158bc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -11,6 +11,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true +permissions: + contents: read + jobs: build: name: Go ${{ matrix.go-version }} on ${{ matrix.os }} - healing diff --git a/.github/workflows/iam-integrations.yaml b/.github/workflows/iam-integrations.yaml index 089bbf4ab..a618a0230 100644 --- a/.github/workflows/iam-integrations.yaml +++ b/.github/workflows/iam-integrations.yaml @@ -11,6 +11,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true +permissions: + contents: read + jobs: iam-matrix-test: name: "[Go=${{ matrix.go-version }}|ldap=${{ matrix.ldap }}|etcd=${{ matrix.etcd }}|openid=${{ matrix.openid }}]" diff --git a/.github/workflows/markdown-lint.yaml b/.github/workflows/markdown-lint.yaml index a68e515ea..e8d836031 100644 --- a/.github/workflows/markdown-lint.yaml +++ b/.github/workflows/markdown-lint.yaml @@ -11,6 +11,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true +permissions: + contents: read + jobs: lint: name: Lint all docs diff --git a/.github/workflows/replication.yaml b/.github/workflows/replication.yaml index 4cd35fc29..6a1f435d0 100644 --- a/.github/workflows/replication.yaml +++ b/.github/workflows/replication.yaml @@ -11,6 +11,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true +permissions: + contents: read + jobs: replication-test: name: Replication Tests with Go ${{ matrix.go-version }} diff --git a/.github/workflows/upgrade-ci-cd.yaml b/.github/workflows/upgrade-ci-cd.yaml index 837ae5484..048a417a9 100644 --- a/.github/workflows/upgrade-ci-cd.yaml +++ b/.github/workflows/upgrade-ci-cd.yaml @@ -11,6 +11,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} cancel-in-progress: true +permissions: + contents: read + jobs: build: name: Go ${{ matrix.go-version }} on ${{ matrix.os }}