Skip to content

Commit d22baec

Browse files
authored
Restrict token permissions (#7072)
1 parent 41c51a0 commit d22baec

10 files changed

+51
-2
lines changed

.github/workflows/backport.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ on:
66
description: "The pull request # to backport"
77
required: true
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
backport:
14+
permissions:
15+
contents: write # for git push to PR branch
1116
runs-on: ubuntu-latest
1217
steps:
1318
- run: |

.github/workflows/benchmark-tags.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ name: Benchmark Tags
33
on:
44
workflow_dispatch:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
sdk-benchmark:
11+
permissions:
12+
contents: write # for git push to benchmarks branch
813
name: Benchmark SDK
914
runs-on: self-hosted
1015
timeout-minutes: 10

.github/workflows/benchmark.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ on:
55
branches: [ main ]
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
sdk-benchmark:
13+
permissions:
14+
contents: write # for git push to benchmarks branch
1015
name: Benchmark SDK
1116
runs-on: self-hosted
1217
timeout-minutes: 10

.github/workflows/build-tracecontext-testsuite.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,14 @@ on:
99
- main
1010
workflow_dispatch:
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
publish:
17+
permissions:
18+
contents: read
19+
packages: write
1420
runs-on: ubuntu-latest
1521
steps:
1622
- uses: actions/checkout@v4

.github/workflows/docker-test-containers-daily.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ on:
55
- cron: "23 3 * * *"
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
copy-images:
13+
permissions:
14+
contents: read
15+
packages: write
1016
strategy:
1117
matrix:
1218
include:

.github/workflows/issue-management-feedback-label.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ on:
44
issue_comment:
55
types: [created]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
issue_comment:
12+
permissions:
13+
contents: read
14+
issues: write
915
if: >
1016
contains(github.event.issue.labels.*.name, 'needs author feedback') &&
1117
github.event.comment.user.login == github.event.issue.user.login

.github/workflows/issue-management-stale-action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@ on:
55
# hourly at minute 23
66
- cron: "23 * * * *"
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
stale:
13+
permissions:
14+
contents: read
15+
issues: write # for actions/stale to close stale issues
16+
pull-requests: write # for actions/stale to close stale PRs
1017
runs-on: ubuntu-latest
1118
steps:
1219
- uses: actions/stale@v9

.github/workflows/owasp-dependency-check-daily.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ name: OWASP dependency check (daily)
44

55
on:
66
schedule:
7-
- cron: '30 1 * * *'
7+
- cron: "30 1 * * *" # daily at 1:30 UTC
88
workflow_dispatch:
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
analyze:
1215
runs-on: ubuntu-latest
13-
1416
steps:
1517
- uses: actions/checkout@v4
1618

@@ -21,6 +23,7 @@ jobs:
2123

2224
- name: Set up gradle
2325
uses: gradle/actions/setup-gradle@v4
26+
2427
- name: Check dependencies
2528
run: ./gradlew dependencyCheckAnalyze
2629

.github/workflows/reusable-markdown-link-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Reusable - Markdown link check
33
on:
44
workflow_call:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
markdown-link-check:
811
runs-on: ubuntu-latest

.github/workflows/reusable-misspell-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Reusable - Misspell check
33
on:
44
workflow_call:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
misspell-check:
811
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)