From 95c7106c6c20ff7687316d0689d9c8e8329bee92 Mon Sep 17 00:00:00 2001 From: Jochen Schalanda Date: Thu, 1 Sep 2022 20:02:21 +0200 Subject: [PATCH] GitHub Workflows security hardening (#2812) This commit adds explicit permissions section to workflows. This is a security best practice because by default workflows run with extended set of permissions (except from on: pull_request from external forks). By specifying any permission explicitly all others are set to none. By using the principle of least privilege the damage a compromised workflow can do (because of an injection or compromised third party tool or action) is restricted. It is recommended to have most strict permissions on the top level and grant write permissions on job level case by case. Refs #2810 Co-authored-by: Alex <93376818+sashashura@users.noreply.github.com> --- .github/workflows/maven.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 5475d431c4..e5e64fa6a0 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -6,6 +6,8 @@ on: push: branches: - release/* +permissions: + contents: read jobs: build: runs-on: ${{ matrix.os }}