Skip to content

Commit 4b9a04e

Browse files
authored
chore: [SEC-7924] pin third-party GitHub Actions to commit SHAs (#429)
## Summary Pin all third-party GitHub Actions to full-length commit SHAs to prevent supply chain attacks. Addresses findings from the [`third-party-action-not-pinned-to-commit-sha`](https://github.com/launchdarkly/semgrep-rules/blob/main/github-actions/third-party-action-not-pinned-to-commit-sha.yml) Semgrep rule. ## Test plan - [ ] Verify CI passes with pinned action SHAs <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low-risk security hardening that only changes workflow `uses:` references, but a bad/obsolete SHA could break CI/publish pipelines at runtime. > > **Overview** > Pins multiple third-party GitHub Actions in CI/release workflows (Android, DevSkim, .NET, Elixir, Go, Java, Python, Ruby, Rust, PHP) from floating tags (e.g. `@v1`/`@v2`/`@v3`) to full commit SHAs. > > This reduces GitHub Actions supply-chain risk without changing build/test logic, but makes workflow execution dependent on the specified action revisions. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2594cdd. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- ld-jira-link --> --- Related Jira issue: [SEC-7924: Unpinned GitHub Actions remediation](https://launchdarkly.atlassian.net/browse/SEC-7924) <!-- end-ld-jira-link -->
1 parent 9808c04 commit 4b9a04e

11 files changed

Lines changed: 24 additions & 24 deletions

File tree

.github/actions/publish-android-sdk/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ runs:
3939
java-version: ${{ inputs.java_version }}
4040

4141
- name: Setup Android SDK
42-
uses: android-actions/setup-android@v3
42+
uses: android-actions/setup-android@9fc6c4e9069bf8d3d10b2204b1fb8f6ef7065407 # v3
4343

4444
- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.2.0
4545
name: Get secrets

.github/workflows/devskim.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
token: ${{ secrets.GITHUB_TOKEN }}
2626

2727
- name: Run DevSkim scanner
28-
uses: microsoft/DevSkim-Action@v1
28+
uses: microsoft/DevSkim-Action@4b5047945a44163b94642a1cecc0d93a3f428cc6 # v1
2929
with:
3030
ignore-globs: '**/otel/samples/**'
3131

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
dotnet-version: 8.x
5757

5858
- name: Setup dotnet
59-
uses: microsoft/setup-msbuild@v2
59+
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2
6060

6161
- name: msbuild restore
6262
run: msbuild -t:Restore

.github/workflows/elixir-sdk.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
token: ${{ secrets.GITHUB_TOKEN }}
2626
- name: Setup Elixir
27-
uses: erlef/setup-beam@v1
27+
uses: erlef/setup-beam@ee09b1e59bb240681c382eb1f0abc6a04af72764 # v1
2828
with:
2929
elixir-version: ${{ env.ELIXIR_VERSION }}
3030
otp-version: ${{ env.OTP_VERSION }}
@@ -41,7 +41,7 @@ jobs:
4141
with:
4242
token: ${{ secrets.GITHUB_TOKEN }}
4343
- name: Setup Elixir
44-
uses: erlef/setup-beam@v1
44+
uses: erlef/setup-beam@ee09b1e59bb240681c382eb1f0abc6a04af72764 # v1
4545
with:
4646
elixir-version: ${{ env.ELIXIR_VERSION }}
4747
otp-version: ${{ env.OTP_VERSION }}
@@ -63,12 +63,12 @@ jobs:
6363
with:
6464
token: ${{ secrets.GITHUB_TOKEN }}
6565
- name: Setup Elixir
66-
uses: erlef/setup-beam@v1
66+
uses: erlef/setup-beam@ee09b1e59bb240681c382eb1f0abc6a04af72764 # v1
6767
with:
6868
elixir-version: ${{ env.ELIXIR_VERSION }}
6969
otp-version: ${{ env.OTP_VERSION }}
7070
- name: Publish to Hex
71-
uses: synchronal/hex-publish-action@v3
71+
uses: synchronal/hex-publish-action@2e73c1e570ae96dcfe548b498df7c8c1942a3100 # v3
7272
with:
7373
name: highlight
7474
key: ${{ secrets.HEX_PM_KEY }}

.github/workflows/go-sdk.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
go-version-file: './sdk/highlight-go/go.mod'
2626
cache-dependency-path: './sdk/highlight-go/go.sum'
2727
- name: Format
28-
uses: Jerome1337/gofmt-action@v1.0.5
28+
uses: Jerome1337/gofmt-action@d5eabd189843f1d568286a54578159978b7c0fb1 # v1.0.5
2929
with:
3030
gofmt-path: './sdk/highlight-go'
3131
gofmt-flags: '-l -d'
@@ -44,7 +44,7 @@ jobs:
4444
go-version-file: './sdk/highlight-go/go.mod'
4545
cache-dependency-path: './sdk/highlight-go/go.sum'
4646
- name: Run linter
47-
uses: golangci/golangci-lint-action@v6.4.1
47+
uses: golangci/golangci-lint-action@818ec4d51a1feacefc42ff1b3ec25d4962690f39 # v6.4.1
4848
with:
4949
args: -v --config ./.golangci.yaml
5050
working-directory: sdk/highlight-go

.github/workflows/java-sdk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152
retention-days: 1
153153

154154
- name: Publish Test Report
155-
uses: mikepenz/action-junit-report@v4
155+
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
156156
with:
157157
commit: ${{github.event.workflow_run.head_sha}}
158158
report_paths: '**/target/surefire-reports/TEST-*.xml'

.github/workflows/python-plugin.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
python-version: '3.10'
3434

3535
- name: Install poetry
36-
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439
36+
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439 # 7b6d33e44b4f08d7021a1dee3c044e9c253d6439
3737

3838
- run: make install
3939
- name: Lint
@@ -42,7 +42,7 @@ jobs:
4242
run: make test
4343
- name: Get Cover
4444
if: github.event_name == 'pull_request'
45-
uses: orgoro/coverage@v3
45+
uses: orgoro/coverage@d77626a5fa35d39123e86d6c62907fabe2491496 # v3
4646
with:
4747
coverageFile: ./sdk/@launchdarkly/observability-python/coverage.xml
4848
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: poetry run pytest --cov=highlight_io --cov-branch --cov-report xml
4141
- name: Get Cover
4242
if: github.event_name == 'pull_request'
43-
uses: orgoro/coverage@v3
43+
uses: orgoro/coverage@d77626a5fa35d39123e86d6c62907fabe2491496 # v3
4444
with:
4545
coverageFile: ./sdk/highlight-py/coverage.xml
4646
token: ${{ secrets.GITHUB_TOKEN }}
@@ -53,7 +53,7 @@ jobs:
5353
python -m piptools compile --upgrade pyproject.toml;
5454
- name: Publish
5555
if: github.ref == 'refs/heads/main'
56-
uses: pypa/gh-action-pypi-publish@release/v1
56+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
5757
with:
5858
packages-dir: ./sdk/highlight-py/dist/
5959
skip-existing: true

.github/workflows/ruby.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ jobs:
2424
- uses: actions/checkout@v4
2525
with:
2626
token: ${{ secrets.GITHUB_TOKEN }}
27-
- uses: dorny/paths-filter@v2
27+
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2
2828
id: filter
2929
with:
3030
filters: |
3131
ruby-changed:
3232
- 'sdk/highlight-ruby/**'
3333
- name: Install Ruby
34-
uses: ruby/setup-ruby@v1
34+
uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1
3535
with:
3636
ruby-version: ${{ matrix.ruby }}
3737
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
@@ -63,7 +63,7 @@ jobs:
6363
with:
6464
token: ${{ secrets.GITHUB_TOKEN }}
6565
- name: Install Ruby
66-
uses: ruby/setup-ruby@v1
66+
uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1
6767
with:
6868
ruby-version: '3.3.4'
6969
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
@@ -84,7 +84,7 @@ jobs:
8484
with:
8585
token: ${{ secrets.GITHUB_TOKEN }}
8686
- name: Install Ruby
87-
uses: ruby/setup-ruby@v1
87+
uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1
8888
with:
8989
ruby-version: '3.3.4'
9090
bundler-cache: true # runs 'bundle install' and caches installed gems automatically

.github/workflows/rust-sdk.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929
token: ${{ secrets.GITHUB_TOKEN }}
3030

3131
- name: Install Rust toolchain
32-
uses: actions-rs/toolchain@v1
32+
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1
3333
with:
3434
toolchain: stable
3535
override: true
3636

3737
- name: Build crates
38-
uses: katyo/publish-crates@v2
38+
uses: katyo/publish-crates@02cc2f1ad653fb25c7d1ff9eb590a8a50d06186b # v2
3939
with:
4040
path: ./sdk/highlight-rust/
4141
dry-run: true
@@ -53,13 +53,13 @@ jobs:
5353
token: ${{ secrets.GITHUB_TOKEN }}
5454

5555
- name: Install Rust toolchain
56-
uses: actions-rs/toolchain@v1
56+
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1
5757
with:
5858
toolchain: stable
5959
override: true
6060

6161
- name: Publish crates
62-
uses: katyo/publish-crates@v2
62+
uses: katyo/publish-crates@02cc2f1ad653fb25c7d1ff9eb590a8a50d06186b # v2
6363
with:
6464
path: ./sdk/highlight-rust/
6565
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 commit comments

Comments
 (0)