Skip to content

Commit 3b16a40

Browse files
chore: apply security best practices from step security (#59)
## Summary This pull request has been generated by [StepSecurity](https://app.stepsecurity.io/github/rudderlabs/actions/dashboard) as part of your enterprise subscription to ensure compliance with recommended security best practices. Please review and merge the pull request to apply these security enhancements. ## Security Fixes ### Least Privileged GitHub Actions Token Permissions The GITHUB_TOKEN is an automatically generated secret to make authenticated calls to the GitHub API. GitHub recommends setting minimum token permissions for the GITHUB_TOKEN. - [GitHub Security Guide](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow) - [The Open Source Security Foundation (OpenSSF) Security Guide](https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions) ### Pinned Dependencies Pinning GitHub Actions to specific versions or commit SHAs ensures that your workflows remain consistent and secure. Unpinned actions can lead to unexpected changes or vulnerabilities caused by upstream updates. - [GitHub Security Guide](https://docs.github.com/en/actions/security-for-github-actions/security-guides/security-hardening-for-github-actions#using-third-party-actions) - [The Open Source Security Foundation (OpenSSF) Security Guide](https://github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies) ## Feedback For bug reports, feature requests, and general feedback; please create an issue in [step-security/secure-repo](https://github.com/step-security/secure-repo) or contact us via [our website](https://www.stepsecurity.io/). Signed-off-by: StepSecurity Bot <bot@stepsecurity.io> Co-authored-by: stepsecurity-app[bot] <188008098+stepsecurity-app[bot]@users.noreply.github.com>
1 parent 8873515 commit 3b16a40

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
branches: ['master']
55
types: ['opened', 'reopened', 'synchronize']
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
build:
912
runs-on: ubuntu-latest
@@ -18,10 +21,10 @@ jobs:
1821
egress-policy: audit
1922

2023
- name: Checkout
21-
uses: actions/checkout@v4
24+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
2225

2326
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v5
27+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
2528
with:
2629
python-version: ${{ matrix.python-version }}
2730

.github/workflows/check_pr_title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
egress-policy: audit
1717

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

.github/workflows/housekeeping.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
egress-policy: audit
2121

22-
- uses: actions/stale@v9
22+
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
2323
with:
2424
repo-token: ${{ secrets.GITHUB_TOKEN }}
2525
operations-per-run: 200
@@ -38,10 +38,10 @@ jobs:
3838
egress-policy: audit
3939

4040
- name: Checkout repository
41-
uses: actions/checkout@v4
41+
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
4242

4343
- name: Run delete-old-branches-action
44-
uses: beatlabs/delete-old-branches-action@v0.0.10
44+
uses: beatlabs/delete-old-branches-action@6e94df089372a619c01ae2c2f666bf474f890911 # v0.0.10
4545
with:
4646
repo_token: ${{ secrets.GITHUB_TOKEN }}
4747
date: '2 months ago'

.github/workflows/slack-notify.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [created]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
deploy-tag:
912
name: Notify Slack
@@ -16,7 +19,7 @@ jobs:
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: 'Python SDK'

0 commit comments

Comments
 (0)