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: nathannaveen <42319948+nathannaveen@users.noreply.github.com>
This commit is contained in:
nathannaveen
2022-06-13 00:58:13 +00:00
parent 845f12879a
commit cac6194acd
2 changed files with 8 additions and 0 deletions

View File

@@ -1,6 +1,9 @@
name: Docker
on: [pull_request]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest

View File

@@ -7,6 +7,9 @@ on:
branches-ignore:
- i18n_master
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-18.04
@@ -60,6 +63,8 @@ jobs:
name: screenshots
path: tmp/screenshots
coveralls:
permissions:
contents: none
runs-on: ubuntu-18.04
needs: tests
env: