From: neilnaveen <42328488+neilnaveen@users.noreply.github.com> Date: Wed, 8 Jun 2022 01:08:12 +0000 (+0000) Subject: chore: Set permissions for GitHub actions X-Git-Tag: lxc-5.0.0~8^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4136%2Fhead;p=thirdparty%2Flxc.git chore: Set permissions for GitHub actions 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: neilnaveen <42328488+neilnaveen@users.noreply.github.com> --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 291fa5822..be62af3f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,6 +2,9 @@ name: Simple test build on: - push - pull_request +permissions: + contents: read + jobs: test: strategy: diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 9ea82a350..0fc981726 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -3,6 +3,9 @@ on: push: branches: - master +permissions: + contents: read + jobs: test: runs-on: ubuntu-latest diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 76339e19c..dad5c11d7 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -2,6 +2,9 @@ name: Sanitizers build on: - push - pull_request +permissions: + contents: read + jobs: sanitizers: strategy: diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 0317559ad..4144371e2 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -2,6 +2,9 @@ name: Static analysis on: - push - pull_request +permissions: + contents: read + jobs: test: runs-on: ubuntu-18.04