Set read-only workflow tokens (#1958)

Fixes #1957.

This PR ensures all workflows run with minimal permissions, instead of
with `write-all` permissions. This will protect the project from
supply-chain attacks.

The change to codeql.yml is for consistency and future-proofing. Should
another job eventually be added to the workflow, it will run with just
`contents: read`.

Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
This commit is contained in:
Pedro Nacht authored and GitHub committed 2023-09-04 11:21:27 -07:00
1 parent e017de2b77
commit a28aa1b6a4
3 files changed
+10 -1

No files matched your search

+3
View File
@@ -2,6 +2,9 @@ name: CI
on: [push, pull_request]
permissions:
contents: read
jobs:
MacOS:
runs-on: macos-13
+4
View File
@@ -1,5 +1,9 @@
name: CIFuzz
on: [pull_request]
permissions:
contents: read
jobs:
Fuzzing:
runs-on: ubuntu-latest
+3 -1
View File
@@ -1,5 +1,8 @@
name: "CodeQL"
permissions:
contents: read
on:
push:
branches: [ "master", "3.5" ]
@@ -14,7 +17,6 @@ jobs:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy: