Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(.github/workflows): stricter GitHub token default permission compliance #2849

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
40030d0
feat(.github/workflows): restrict appsec jobs to content read-only pe…
darccio Sep 9, 2024
74de752
feat(.github/workflows): restrict DataDog Static Analysis jobs to rig…
darccio Sep 9, 2024
6266442
chore: trigger DataDog Static Analysis
darccio Sep 9, 2024
8e52c11
chore: trigger DataDog Static Analysis with fake bearer token
darccio Sep 9, 2024
c2b550f
chore: trigger DataDog Static Analysis with fake bearer token in Go code
darccio Sep 9, 2024
e602ec7
feat: reduce DataDog Static Analysis to content read-only permission
darccio Sep 9, 2024
4d21ee5
feat: reduce ecosystems labels' jobs to right permissions
darccio Sep 9, 2024
817c082
chore: trigger ecosystems labelling
darccio Sep 9, 2024
cc1e82e
feat: reduce govunlcheck jobs to right permissions
darccio Sep 9, 2024
32887a0
feat: reduce main branch, multi OS unit tests, and integration tests'…
darccio Sep 9, 2024
3d2afe0
feat: reduce parametric tests' jobs to right permissions
darccio Sep 9, 2024
5b7dd56
feat: reduce smoke tests' jobs to right permissions
darccio Sep 9, 2024
5398051
feat: reduce stale labelling's jobs to right permissions
darccio Sep 9, 2024
3f11d13
feat: reduce system tests' jobs to right permissions
darccio Sep 9, 2024
8f843c8
feat: reduce test apps' jobs to right permissions
darccio Sep 9, 2024
5f25847
chore: drop current PR branch from smoke-tests
darccio Sep 9, 2024
4a56998
chore: test ecosystems-label-pr job
darccio Sep 9, 2024
a8c9d63
chore: test ecosystems-label-pr job with contents write permission
darccio Sep 9, 2024
289fc74
chore: test ecosystems-label-pr job with permissions at job level
darccio Sep 9, 2024
857051a
chore: test ecosystems-label-pr job with pull-requests permission
darccio Sep 9, 2024
0b2f345
chore: test ecosystems-label-pr job without issues permission
darccio Sep 9, 2024
059968f
chore: restrict ecosystems-label-pr job to specific types for PRs
darccio Sep 9, 2024
4d20359
chore: remove contrib fake edit to trigger labeller
darccio Sep 9, 2024
ac793cf
feat: add pull-requests write permission to DataDog Static Analysis' …
darccio Sep 9, 2024
7968a69
Merge branch 'main' into dario.castane/VULN-8316/insecure-default-wor…
darccio Sep 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/appsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ concurrency:
# Automatically cancel previous runs if a new one is triggered to conserve resources.
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}

permissions:
contents: read

jobs:
# Prepare the cache of Go modules to share it will the other jobs.
# This maximizes cache hits and minimizes the time spent downloading Go modules.
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/datadog-static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ on: [push]

name: Datadog Static Analysis

permissions:
contents: read
pull-requests: write

jobs:
static-analysis:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
- reopened
- opened
- edited
permissions:
contents: read
issues: write
jobs:
label_issues:
if: contains(github.event.issue.title, 'contrib')
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ecosystems-label-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- opened
- reopened
- edited
permissions:
contents: read
pull-requests: write
jobs:
label_issues:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ on:
- cron: '00 00 * * *'
workflow_dispatch:

permissions:
contents: read

jobs:
govulncheck-tests:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/multios-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ on:
env:
DD_APPSEC_WAF_TIMEOUT: 1m # Increase time WAF time budget to reduce CI flakiness

permissions:
contents: read

jobs:
test-multi-os:
runs-on: "${{ inputs.runs-on }}"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/parametric-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ on:
schedule:
- cron: '00 04 * * 2-6'

permissions:
contents: read

jobs:
parametric-tests:
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'DataDog/dd-trace-go')
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ on:
env:
TEST_RESULTS: /tmp/test-results # path to where test results will be saved

permissions:
contents: read

jobs:
go-get-u:
# Run go get -u to upgrade dd-trace-go dependencies to their
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
schedule:
- cron: '30 1 * * *'

permissions:
contents: read
issues: write

jobs:
stale:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ on:
schedule:
- cron: '00 04 * * 2-6'

permissions:
contents: read

jobs:
system-tests:
if: github.event_name != 'pull_request' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'DataDog/dd-trace-go')
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-apps.cue
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ env: {
DD_TAGS: "github_run_id:${{ github.run_id }} github_run_number:${{ github.run_number }} ${{ inputs['arg: tags'] }}",
}

permissions: {
contents: "read",
}

jobs: {
for i, scenario in #scenarios {
for j, env in #envs {
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ name: Test Apps
env:
DD_ENV: github
DD_TAGS: 'github_run_id:${{ github.run_id }} github_run_number:${{ github.run_number }} ${{ inputs[''arg: tags''] }}'
permissions:
contents: read
jobs:
job-0-0:
name: unit-of-work/v1 (prod)
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/unit-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ env:
# without having to download a newer one.
GOTOOLCHAIN: local

permissions:
contents: read

jobs:
copyright:
runs-on: ubuntu-latest
Expand Down
Loading