Skip to content

Commit f88a7e6

Browse files
lvrachclaude
andcommitted
chore(ci): annotate all permissions with reason and action name [SEC-58]
Add inline comments to every job-level permissions entry explaining why the permission is needed and which action/step requires it. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d2964e1 commit f88a7e6

22 files changed

+62
-62
lines changed

.github/workflows/build-pr-artifacts.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
name: Generate Tag Names
1818
permissions:
19-
contents: read
19+
contents: read # to checkout repository code (actions/checkout)
2020
# Skip for the release pull requests as staging artifacts will be generated
2121
if: startsWith(github.event.pull_request.head.ref, 'release/') != true && startsWith(github.event.pull_request.head.ref, 'hotfix-release/') != true && github.event.pull_request.head.ref != 'main'
2222
outputs:
@@ -48,8 +48,8 @@ jobs:
4848
build-transformer-image:
4949
name: Build Transformer Docker Image - PR
5050
permissions:
51-
id-token: write
52-
contents: read
51+
id-token: write # to pass OIDC token to reusable workflow (build-push-docker-image.yml)
52+
contents: read # to checkout repository code and call reusable workflow (actions/checkout)
5353
# Skip for the release pull requests as staging artifacts will be generated
5454
# Skip main to develop sync pull requests
5555
if: startsWith(github.event.pull_request.head.ref, 'release/') != true && startsWith(github.event.pull_request.head.ref, 'hotfix-release/') != true && github.event.pull_request.head.ref != 'main'
@@ -68,8 +68,8 @@ jobs:
6868
build-user-transformer-image:
6969
name: Build User Transformer Docker Image - PR
7070
permissions:
71-
id-token: write
72-
contents: read
71+
id-token: write # to pass OIDC token to reusable workflow (build-push-docker-image.yml)
72+
contents: read # to checkout repository code and call reusable workflow (actions/checkout)
7373
# Skip for the release pull requests as staging artifacts will be generated
7474
if: startsWith(github.event.pull_request.head.ref, 'release/') != true && startsWith(github.event.pull_request.head.ref, 'hotfix-release/') != true && github.event.pull_request.head.ref != 'main'
7575
needs: [generate-tag-names]
@@ -87,7 +87,7 @@ jobs:
8787
run-ingestion-service-test:
8888
name: Run Ingestion Service Test
8989
permissions:
90-
contents: read
90+
contents: read # to call reusable workflow (ingestion-service-test.yml)
9191
needs: [build-transformer-image, generate-tag-names]
9292
uses: ./.github/workflows/ingestion-service-test.yml
9393
with:

.github/workflows/build-push-docker-image.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
runs-on: ubuntu-latest
4343
name: Check if actor is dependabot
4444
permissions:
45-
contents: read
45+
contents: read # minimum required permission for job execution
4646
outputs:
4747
is_dependabot: ${{ steps.check.outputs.is_dependabot }}
4848
steps:
@@ -66,7 +66,7 @@ jobs:
6666
runs-on: ubuntu-latest
6767
name: Get SHA information
6868
permissions:
69-
contents: read
69+
contents: read # minimum required permission for job execution
7070
outputs:
7171
sha: ${{steps.getSHA.outputs.SHA}}
7272
steps:
@@ -90,7 +90,7 @@ jobs:
9090
runs-on: ubuntu-latest
9191
name: Get Changed files
9292
permissions:
93-
contents: read
93+
contents: read # to checkout repository code and list changed files (actions/checkout, Ana06/get-changed-files)
9494
outputs:
9595
should_execute_tests: ${{ steps.processing.outputs.should_execute_tests }}
9696
steps:
@@ -125,8 +125,8 @@ jobs:
125125
build-images:
126126
name: Build Docker Images
127127
permissions:
128-
id-token: write
129-
contents: read
128+
id-token: write # for AWS OIDC authentication (aws-actions/configure-aws-credentials)
129+
contents: read # to checkout repository code (actions/checkout)
130130
needs: [check_actor, get_sha, get_changed_files]
131131
strategy:
132132
matrix:
@@ -224,8 +224,8 @@ jobs:
224224
name: Create multi-arch manifest for ECR
225225
runs-on: ubuntu-latest
226226
permissions:
227-
id-token: write
228-
contents: read
227+
id-token: write # for AWS OIDC authentication (aws-actions/configure-aws-credentials)
228+
contents: read # minimum required permission for job execution
229229
needs: [build-images, check_actor]
230230
if: ${{ needs.check_actor.outputs.is_dependabot == 'false' }}
231231
steps:
@@ -264,7 +264,7 @@ jobs:
264264
name: Create multi-arch manifest for DockerHub
265265
runs-on: ubuntu-latest
266266
permissions:
267-
contents: read
267+
contents: read # minimum required permission for job execution
268268
needs: [build-images, check_actor]
269269
if: ${{ needs.check_actor.outputs.is_dependabot == 'false' }}
270270
steps:

.github/workflows/check-pr-title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
name: Check PR Title
1818
runs-on: ubuntu-latest
1919
permissions:
20-
pull-requests: read
20+
pull-requests: read # to read PR title for validation (rudderlabs/github-action-check-pr-title)
2121
steps:
2222
- name: Harden the runner (Audit all outbound calls)
2323
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0

.github/workflows/commitlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
commitlint:
1111
runs-on: ubuntu-latest
1212
permissions:
13-
contents: read
13+
contents: read # to checkout repository code with full history (actions/checkout)
1414
steps:
1515
- name: Harden the runner (Audit all outbound calls)
1616
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0

.github/workflows/create-hotfix-branch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
validate-actor:
1212
permissions:
13-
contents: read
13+
contents: read # to call reusable workflow (validate-actor.yml)
1414
uses: ./.github/workflows/validate-actor.yml
1515
with:
1616
team_names: 'integrations,data-management'
@@ -23,7 +23,7 @@ jobs:
2323
needs: validate-actor
2424

2525
permissions:
26-
contents: read
26+
contents: read # to read repo metadata; branch creation uses app token (create-github-app-token)
2727

2828
# Only allow these users to create new hotfix branch from 'main'
2929
if: github.ref == 'refs/heads/main'

.github/workflows/draft-new-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on: workflow_dispatch
55
jobs:
66
validate-actor:
77
permissions:
8-
contents: read
8+
contents: read # to call reusable workflow (validate-actor.yml)
99
uses: ./.github/workflows/validate-actor.yml
1010
with:
1111
team_names: 'integrations,data-management'
@@ -18,7 +18,7 @@ jobs:
1818
needs: validate-actor
1919

2020
permissions:
21-
contents: read
21+
contents: read # to checkout repository code; writes use app token (create-github-app-token)
2222

2323
# Only allow release stakeholders to initiate releases
2424
if: (github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/'))

.github/workflows/dt-test-and-report-code-coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
get_workflow_url:
1616
runs-on: ubuntu-latest
1717
permissions:
18-
contents: read
18+
contents: read # minimum required permission for job execution
1919
steps:
2020
- name: Harden the runner (Audit all outbound calls)
2121
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
@@ -33,7 +33,7 @@ jobs:
3333
name: Code Coverage
3434
runs-on: ubuntu-latest
3535
permissions:
36-
contents: read
36+
contents: read # to checkout repository code with full history (actions/checkout)
3737
needs: [get_workflow_url]
3838
outputs:
3939
tests_run_outcome: ${{steps.run_tests.outcome}}
@@ -100,7 +100,7 @@ jobs:
100100
notify:
101101
name: slack notification on failure
102102
permissions:
103-
contents: read
103+
contents: read # to call reusable workflow (slack-notify.yml)
104104
needs: [get_workflow_url, coverage]
105105
if: needs.coverage.outputs.tests_run_outcome == 'failure' || failure()
106106
uses: ./.github/workflows/slack-notify.yml

.github/workflows/housekeeping.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
permissions:
15-
pull-requests: write
16-
issues: write
15+
pull-requests: write # to label and close stale PRs (actions/stale)
16+
issues: write # to label and close stale issues (actions/stale)
1717

1818
steps:
1919
- name: Harden the runner (Audit all outbound calls)
@@ -39,7 +39,7 @@ jobs:
3939
runs-on: ubuntu-latest
4040

4141
permissions:
42-
contents: write
42+
contents: write # to delete stale branches (beatlabs/delete-old-branches-action)
4343

4444
steps:
4545
- name: Harden the runner (Audit all outbound calls)

.github/workflows/ingestion-service-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
permissions:
21-
contents: read
21+
contents: read # to checkout repository code (actions/checkout)
2222
env:
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
TRANSFORMER_IMAGE_NAME_FOR_TEST: ${{ inputs.build_tag }}

.github/workflows/integrations_version_audit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Run Integration Version Audit
1111
runs-on: ubuntu-latest
1212
permissions:
13-
contents: read
13+
contents: read # to checkout repository code (actions/checkout)
1414

1515
steps:
1616
- name: Harden the runner (Audit all outbound calls)

0 commit comments

Comments
 (0)