Skip to content

Commit ae70a9f

Browse files
dfa1claude
andcommitted
ci: fix sonar security findings in release-smoke
- script injection: pass inputs.version via env, not run interpolation (S7630) - least-privilege: move permissions to job level (S8264) - curl: enforce --proto =https --tlsv1.2 against redirect downgrade (S6506) - pin setup-jbang to commit SHA v0.1.1 (S7637) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 8aba38f commit ae70a9f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

.github/workflows/release-smoke.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@ on:
1818
# drift against the published release without a manual trigger.
1919
- cron: "0 6 * * 1"
2020

21-
permissions:
22-
contents: read
23-
2421
jobs:
2522
resolve:
2623
name: resolve version
2724
runs-on: ubuntu-latest
25+
permissions: {}
2826
outputs:
2927
version: ${{ steps.pick.outputs.version }}
3028
steps:
3129
- name: Resolve version (input, else latest on Maven Central)
3230
id: pick
3331
shell: bash
32+
env:
33+
INPUT_VERSION: ${{ inputs.version }}
3434
run: |
35-
version="${{ inputs.version }}"
35+
version="$INPUT_VERSION"
3636
if [ -z "$version" ]; then
3737
# <release> in maven-metadata.xml is the latest non-snapshot release.
38-
version=$(curl -fsSL https://repo1.maven.org/maven2/io/github/dfa1/zstd/zstd/maven-metadata.xml \
38+
version=$(curl -fsSL --proto '=https' --tlsv1.2 https://repo1.maven.org/maven2/io/github/dfa1/zstd/zstd/maven-metadata.xml \
3939
| grep -oE '<release>[^<]+</release>' | sed -E 's/<\/?release>//g')
4040
fi
4141
if [ -z "$version" ]; then
@@ -68,6 +68,8 @@ jobs:
6868
- { os: ubuntu-latest, classifier: linux-x86_64, distribution: zulu, container: "amazoncorretto:25-alpine", experimental: true }
6969
- { os: ubuntu-24.04-arm, classifier: linux-aarch64, distribution: zulu, container: "amazoncorretto:25-alpine", experimental: true }
7070
runs-on: ${{ matrix.os }}
71+
permissions:
72+
contents: read
7173
steps:
7274
- name: Checkout (smoke sources only)
7375
uses: actions/checkout@v4
@@ -81,7 +83,7 @@ jobs:
8183
# --- native runner path (glibc / macOS / Windows): run via JBang on the host ---
8284
- name: Set up JBang
8385
if: ${{ !matrix.container }}
84-
uses: jbangdev/setup-jbang@main
86+
uses: jbangdev/setup-jbang@2b1b465a7b75f4222b81426f23a01e013aa7b95c # v0.1.1
8587

8688
- name: Smoke-test ${{ needs.resolve.outputs.version }} on ${{ matrix.classifier }}
8789
if: ${{ !matrix.container }}

0 commit comments

Comments
 (0)