Skip to content

Commit cdd28fe

Browse files
chore(ci): enforce top-level permission to minimum fail-safe permission as per openssf (#2638)
1 parent b2e43b3 commit cdd28fe

20 files changed

+79
-0
lines changed

.github/workflows/build_changelog.yml

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
branches:
1818
- develop
1919

20+
permissions:
21+
contents: read
22+
2023
jobs:
2124
changelog:
2225
permissions:

.github/workflows/codeql-analysis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ on:
1717
branches:
1818
- develop
1919

20+
permissions:
21+
contents: read
22+
2023
jobs:
2124
analyze:
2225
name: Analyze
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Dependency Review Action
2+
#
3+
# This Action will scan dependency manifest files that change as part of a Pull Request,
4+
# surfacing known-vulnerable versions of the packages declared or updated in the PR.
5+
# Once installed, if the workflow run is marked as required,
6+
# PRs introducing known-vulnerable packages will be blocked from merging.
7+
#
8+
# Source repository: https://github.com/actions/dependency-review-action
9+
name: 'Dependency Review'
10+
on: [pull_request]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
dependency-review:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: 'Checkout Repository'
20+
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
21+
- name: 'Dependency Review'
22+
uses: actions/dependency-review-action@0efb1d1d84fc9633afcdaad14c485cbbc90ef46c # v2.5.1

.github/workflows/label_pr_on_title.yml

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
types:
2727
- completed
2828

29+
permissions:
30+
contents: read
31+
2932
jobs:
3033
get_pr_details:
3134
permissions:

.github/workflows/on_closed_issues.yml

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ name: Closed Issue Message
1212
on:
1313
issues:
1414
types: [closed]
15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
auto_comment:
1720
runs-on: ubuntu-latest

.github/workflows/on_label_added.yml

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ on:
2525
types:
2626
- completed
2727

28+
permissions:
29+
contents: read
30+
2831
jobs:
2932
get_pr_details:
3033
permissions:

.github/workflows/on_merged_pr.yml

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
types:
2727
- completed
2828

29+
permissions:
30+
contents: read
31+
2932
jobs:
3033
get_pr_details:
3134
permissions:

.github/workflows/on_opened_pr.yml

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ on:
2626
types:
2727
- completed
2828

29+
permissions:
30+
contents: read
31+
2932
jobs:
3033
get_pr_details:
3134
permissions:

.github/workflows/on_push_docs.yml

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ on:
2020
- "examples/**"
2121
- "CHANGELOG.md"
2222

23+
permissions:
24+
contents: read
25+
2326
jobs:
2427
release-docs:
2528
permissions:

.github/workflows/publish_v2_layer.yml

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ on:
4949
type: boolean
5050
required: false
5151

52+
permissions:
53+
contents: read
54+
5255
jobs:
5356
build-layer:
5457
permissions:

.github/workflows/quality_check.yml

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ on:
3535
branches:
3636
- develop
3737

38+
permissions:
39+
contents: read
40+
3841
jobs:
3942
quality_check:
4043
runs-on: ubuntu-latest

.github/workflows/rebuild_latest_docs.yml

+3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ on:
2323
default: "2.16.3"
2424
required: true
2525

26+
permissions:
27+
contents: read
28+
2629
jobs:
2730
release-docs:
2831
permissions:

.github/workflows/record_pr.yml

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ on:
3737
pull_request:
3838
types: [opened, edited, closed, labeled]
3939

40+
permissions:
41+
contents: read
42+
4043
jobs:
4144
record_pr:
4245
runs-on: ubuntu-latest

.github/workflows/release-drafter.yml

+3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ on:
1818
- develop
1919
workflow_dispatch:
2020

21+
permissions:
22+
contents: read
23+
2124
jobs:
2225
update_release_draft:
2326
runs-on: ubuntu-latest

.github/workflows/release.yml

+3
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ on:
5151
type: boolean
5252
required: false
5353

54+
permissions:
55+
contents: read
56+
5457
jobs:
5558

5659
# This job bumps the package version to the release version

.github/workflows/reusable_deploy_v2_layer_stack.yml

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ on:
4747
required: true
4848
type: string
4949

50+
permissions:
51+
contents: read
52+
5053
jobs:
5154
deploy-cdk-stack:
5255
runs-on: ubuntu-latest

.github/workflows/reusable_export_pr_details.yml

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ on:
5050
description: "Whether PR is merged"
5151
value: ${{ jobs.export_pr_details.outputs.prIsMerged }}
5252

53+
permissions:
54+
contents: read
55+
5356
jobs:
5457
export_pr_details:
5558
permissions:

.github/workflows/reusable_publish_changelog.yml

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ env:
1010
PULL_REQUEST_TITLE: "chore(ci): changelog rebuild"
1111
FILES_TO_COMMIT: "CHANGELOG.md"
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
publish_changelog:
1518
# Force Github action to run only a single job at a time (based on the group name)

.github/workflows/run-e2e-tests.yml

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ env:
3535

3636
concurrency: e2e
3737

38+
permissions:
39+
contents: read
40+
3841
jobs:
3942
run:
4043
runs-on: aws-powertools_ubuntu-latest_8-core

.github/workflows/secure_workflows.yml

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
paths:
2020
- ".github/workflows/**"
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
enforce_pinned_workflows:
2427
name: Harden Security

0 commit comments

Comments
 (0)