Skip to content

Commit d1fc270

Browse files
authored
GitHub Workflows security hardening (#2810)
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.
1 parent cfe161c commit d1fc270

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
push:
77
branches:
88
- release/*
9+
permissions:
10+
contents: read
911
jobs:
1012
build:
1113
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)