Skip to content

Commit 043dcd1

Browse files
authored
feat(.github/workflows): stricter GitHub token default permission compliance (DataDog#2849)
1 parent bed7121 commit 043dcd1

13 files changed

+41
-0
lines changed

.github/workflows/appsec.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ concurrency:
4040
# Automatically cancel previous runs if a new one is triggered to conserve resources.
4141
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
4242

43+
permissions:
44+
contents: read
45+
4346
jobs:
4447
# Prepare the cache of Go modules to share it will the other jobs.
4548
# This maximizes cache hits and minimizes the time spent downloading Go modules.

.github/workflows/datadog-static-analysis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ on: [push]
22

33
name: Datadog Static Analysis
44

5+
permissions:
6+
contents: read
7+
pull-requests: write
8+
59
jobs:
610
static-analysis:
711
runs-on: ubuntu-latest

.github/workflows/ecosystems-label-issue copy.yml renamed to .github/workflows/ecosystems-label-issue.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- reopened
66
- opened
77
- edited
8+
permissions:
9+
contents: read
10+
issues: write
811
jobs:
912
label_issues:
1013
if: contains(github.event.issue.title, 'contrib')

.github/workflows/ecosystems-label-pr.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- opened
88
- reopened
99
- edited
10+
permissions:
11+
contents: read
12+
pull-requests: write
1013
jobs:
1114
label_issues:
1215
runs-on: ubuntu-latest

.github/workflows/govulncheck.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
- cron: '00 00 * * *'
1515
workflow_dispatch:
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
govulncheck-tests:
1922
runs-on: ubuntu-latest

.github/workflows/multios-unit-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ on:
2929
env:
3030
DD_APPSEC_WAF_TIMEOUT: 1m # Increase time WAF time budget to reduce CI flakiness
3131

32+
permissions:
33+
contents: read
34+
3235
jobs:
3336
test-multi-os:
3437
runs-on: "${{ inputs.runs-on }}"

.github/workflows/parametric-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
schedule:
2222
- cron: '00 04 * * 2-6'
2323

24+
permissions:
25+
contents: read
26+
2427
jobs:
2528
parametric-tests:
2629
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'DataDog/dd-trace-go')

.github/workflows/smoke-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ on:
2727
env:
2828
TEST_RESULTS: /tmp/test-results # path to where test results will be saved
2929

30+
permissions:
31+
contents: read
32+
3033
jobs:
3134
go-get-u:
3235
# Run go get -u to upgrade dd-trace-go dependencies to their

.github/workflows/stale.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
schedule:
55
- cron: '30 1 * * *'
66

7+
permissions:
8+
contents: read
9+
issues: write
10+
711
jobs:
812
stale:
913
runs-on: ubuntu-latest

.github/workflows/system-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ on:
2727
schedule:
2828
- cron: '00 04 * * 2-6'
2929

30+
permissions:
31+
contents: read
32+
3033
jobs:
3134
system-tests:
3235
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'DataDog/dd-trace-go')

0 commit comments

Comments
 (0)