]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
chore: Set permissions for GitHub actions 4136/head
authorneilnaveen <42328488+neilnaveen@users.noreply.github.com>
Wed, 8 Jun 2022 01:08:12 +0000 (01:08 +0000)
committerneilnaveen <42328488+neilnaveen@users.noreply.github.com>
Wed, 8 Jun 2022 01:08:12 +0000 (01:08 +0000)
 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>
.github/workflows/build.yml
.github/workflows/coverity.yml
.github/workflows/sanitizers.yml
.github/workflows/static-analysis.yml

index 291fa58223a0de7e7b1ae2b84e69ed1c5ad61546..be62af3f212b5b22040becf97393f7d2fa4dd878 100644 (file)
@@ -2,6 +2,9 @@ name: Simple test build
 on:
   - push
   - pull_request
+permissions:
+  contents: read
+
 jobs:
   test:
     strategy:
index 9ea82a3509b4fc3d3e590da5d2c3c7c1f53dc47b..0fc981726eef9e18de3cf5bdb0e0eccc2c506510 100644 (file)
@@ -3,6 +3,9 @@ on:
   push:
     branches:
       - master
+permissions:
+  contents: read
+
 jobs:
   test:
     runs-on: ubuntu-latest
index 76339e19c957664f56008ea9a2d9743c381482fb..dad5c11d77a2d7b1c74e98c3c4a6ddec73b019d1 100644 (file)
@@ -2,6 +2,9 @@ name: Sanitizers build
 on:
   - push
   - pull_request
+permissions:
+  contents: read
+
 jobs:
   sanitizers:
     strategy:
index 0317559ad8621a27c062d637b028e6cafb3db826..4144371e27028d00eb8b6645472bc35fa4aa76c9 100644 (file)
@@ -2,6 +2,9 @@ name: Static analysis
 on:
   - push
   - pull_request
+permissions:
+  contents: read
+
 jobs:
   test:
     runs-on: ubuntu-18.04