Skip to content

Commit aa0817f

Browse files
chore: apply security best practices from step security (#47)
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io> Co-authored-by: stepsecurity-app[bot] <188008098+stepsecurity-app[bot]@users.noreply.github.com>
1 parent 607af3f commit aa0817f

File tree

9 files changed

+45
-26
lines changed

9 files changed

+45
-26
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ on:
88
types: [ 'opened', 'reopened', 'edited', 'synchronize' ]
99
workflow_dispatch:
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
cancel_previous:
1316

17+
permissions:
18+
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
1419
runs-on: ubuntu-latest
1520
steps:
1621
- name: Harden the runner (Audit all outbound calls)
17-
uses: step-security/harden-runner@v2
22+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
1823
with:
1924
egress-policy: audit
2025

@@ -28,18 +33,18 @@ jobs:
2833

2934
steps:
3035
- name: Harden the runner (Audit all outbound calls)
31-
uses: step-security/harden-runner@v2
36+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
3237
with:
3338
egress-policy: audit
3439

3540
- name: Checkout source branch
36-
uses: actions/checkout@v4
41+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
3742

3843
- name: Grant execute permission for gradlew
3944
run: chmod +x gradlew
4045

4146
- name: cache gradle dependencies
42-
uses: actions/cache@v4
47+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
4348
with:
4449
path: |
4550
~/.gradle/caches

.github/workflows/check_pr_title.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Harden the runner (Audit all outbound calls)
13-
uses: step-security/harden-runner@v2
13+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
1414
with:
1515
egress-policy: audit
1616

1717
- name: Checkout source branch
18-
uses: actions/checkout@v4
18+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1919

2020
- name: Check PR title
21-
uses: rudderlabs/github-action-check-pr-title@v1.0.11
21+
uses: rudderlabs/github-action-check-pr-title@0a83071336f7d6417249629f67a64530fcecda2e # v1.0.11

.github/workflows/draft_new_release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,29 @@ name: Draft new release
33
on:
44
workflow_dispatch
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
draft-new-release:
11+
permissions:
12+
contents: write # for Git to git push
813
name: Draft a new release
914
runs-on: ubuntu-latest
1015
if: startsWith(github.ref, 'refs/heads/feat/') || startsWith(github.ref, 'refs/heads/fix/')
1116
steps:
1217
- name: Harden the runner (Audit all outbound calls)
13-
uses: step-security/harden-runner@v2
18+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
1419
with:
1520
egress-policy: audit
1621

1722
- name: Checkout source branch
18-
uses: actions/checkout@v4
23+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1924
with:
2025
fetch-depth: 0
2126

2227
- name: Set Node 16
23-
uses: actions/setup-node@v4
28+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2429
with:
2530
node-version: 16
2631

.github/workflows/manage-github-issue-for-outdated-dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ jobs:
1111
name: Check outdated dependencies and create issue if it doesn't exist
1212
steps:
1313
- name: Harden the runner (Audit all outbound calls)
14-
uses: step-security/harden-runner@v2
14+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
1515
with:
1616
egress-policy: audit
1717

18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1919

2020
- name: Check outdated dependencies and create issue
2121
id: check-outdated-dependencies-and-create-issue

.github/workflows/notion_pr_sync.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
runs-on: ubuntu-latest
4949
steps:
5050
- name: Harden the runner (Audit all outbound calls)
51-
uses: step-security/harden-runner@v2
51+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
5252
with:
5353
egress-policy: audit
5454

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
if: startsWith(github.event.pull_request.head.ref, 'release/') && github.event.pull_request.merged == true # only merged pull requests must trigger this job
1515
steps:
1616
- name: Harden the runner (Audit all outbound calls)
17-
uses: step-security/harden-runner@v2
17+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
1818
with:
1919
egress-policy: audit
2020

@@ -27,12 +27,12 @@ jobs:
2727
2828
echo "release_version=$VERSION" >> $GITHUB_OUTPUT
2929
- name: Checkout
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
3131
with:
3232
fetch-depth: 0
3333

3434
- name: Setup Node
35-
uses: actions/setup-node@v4
35+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3636
with:
3737
node-version: 16
3838
# In order to make a commit, we need to initialize a user.
@@ -53,7 +53,7 @@ jobs:
5353
DEBUG=conventional-github-releaser npx conventional-github-releaser -p angular
5454
5555
- name: Delete release branch
56-
uses: koj-co/delete-merged-action@master
56+
uses: koj-co/delete-merged-action@63a03c35810a8a7d4840d18793c0f68ff8b59450 # master
5757
if: startsWith(github.event.pull_request.head.ref, 'release/')
5858
with:
5959
branches: 'release/*'

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,27 @@ on:
44
workflow_dispatch:
55
release:
66
types: [ created ]
7+
permissions:
8+
contents: read
9+
710
jobs:
811
release:
912
runs-on: ubuntu-latest
1013
environment: deployment
1114
steps:
1215
- name: Harden the runner (Audit all outbound calls)
13-
uses: step-security/harden-runner@v2
16+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
1417
with:
1518
egress-policy: audit
1619

1720
- name: Checkout source branch
18-
uses: actions/checkout@v4
21+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
1922

2023
- name: Grant execute permission for gradlew
2124
run: chmod +x gradlew
2225

2326
- name: cache gradle dependencies
24-
uses: actions/cache@v4
27+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
2528
with:
2629
path: |
2730
~/.gradle/caches

.github/workflows/slack-notify.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,22 @@ on:
44
release:
55
types: [ created ]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
deploy-tag:
912
name: Notify Slack
1013
runs-on: ubuntu-latest
1114
steps:
1215
- name: Harden the runner (Audit all outbound calls)
13-
uses: step-security/harden-runner@v2
16+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
1417
with:
1518
egress-policy: audit
1619

1720
- name: Send message to Slack channel
1821
id: slack
19-
uses: slackapi/slack-github-action@v1.23.0
22+
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
2023
env:
2124
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
2225
PROJECT_NAME: rudder-integration-braze-android

.github/workflows/snapshot_release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,23 @@ on:
55
branches: [ 'master' ]
66
types: [ 'opened', 'reopened', 'edited', 'synchronize' ]
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
snapshot:
1013
runs-on: ubuntu-latest
1114
environment: deployment
1215
steps:
1316
- name: Harden the runner (Audit all outbound calls)
14-
uses: step-security/harden-runner@v2
17+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
1518
with:
1619
egress-policy: audit
1720

1821
- name: Checkout source branch
19-
uses: actions/checkout@v4
22+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
2023

21-
- uses: actions/setup-java@v4
24+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
2225
with:
2326
distribution: 'temurin'
2427
java-version: '17'
@@ -27,7 +30,7 @@ jobs:
2730
run: chmod +x gradlew
2831

2932
- name: cache gradle dependencies
30-
uses: actions/cache@v4
33+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
3134
with:
3235
path: |
3336
~/.gradle/caches

0 commit comments

Comments
 (0)