Skip to content

Commit 0a366e6

Browse files
committed
Pin workflow and container dependencies
1 parent 574be69 commit 0a366e6

11 files changed

Lines changed: 44 additions & 30 deletions

File tree

.github/workflows/actionlint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
runs-on: ubuntu-latest
2121
timeout-minutes: 5
2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2424
with:
2525
persist-credentials: false
2626
- name: Check GitHub Actions workflows
27-
uses: docker://rhysd/actionlint:1.7.12
27+
uses: docker://rhysd/actionlint@sha256:b1934ee5f1c509618f2508e6eb47ee0d3520686341fec936f3b79331f9315667 # 1.7.12
2828
with:
2929
args: -color

.github/workflows/ci.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ jobs:
2121
runs-on: ubuntu-latest
2222
timeout-minutes: 10
2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2525
with:
2626
persist-credentials: false
2727
- name: Setup Java
28-
uses: actions/setup-java@v4
28+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
2929
with:
3030
distribution: temurin
3131
java-version: 21
@@ -38,11 +38,11 @@ jobs:
3838
runs-on: ubuntu-latest
3939
timeout-minutes: 10
4040
steps:
41-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
4242
with:
4343
persist-credentials: false
4444
- name: Setup Java
45-
uses: actions/setup-java@v4
45+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
4646
with:
4747
distribution: temurin
4848
java-version: 21
@@ -55,11 +55,11 @@ jobs:
5555
runs-on: ubuntu-latest
5656
timeout-minutes: 10
5757
steps:
58-
- uses: actions/checkout@v4
58+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
5959
with:
6060
persist-credentials: false
6161
- name: Setup Java
62-
uses: actions/setup-java@v4
62+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
6363
with:
6464
distribution: temurin
6565
java-version: 21
@@ -74,11 +74,11 @@ jobs:
7474
runs-on: ubuntu-latest
7575
timeout-minutes: 10
7676
steps:
77-
- uses: actions/checkout@v4
77+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
7878
with:
7979
persist-credentials: false
8080
- name: Setup Java
81-
uses: actions/setup-java@v4
81+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
8282
with:
8383
distribution: temurin
8484
java-version: 21
@@ -91,11 +91,11 @@ jobs:
9191
runs-on: ubuntu-latest
9292
timeout-minutes: 10
9393
steps:
94-
- uses: actions/checkout@v4
94+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
9595
with:
9696
persist-credentials: false
9797
- name: Setup Java
98-
uses: actions/setup-java@v4
98+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
9999
with:
100100
distribution: temurin
101101
java-version: 21
@@ -114,19 +114,19 @@ jobs:
114114
- contract-and-smoke-tests
115115
- architecture-tests
116116
steps:
117-
- uses: actions/checkout@v4
117+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
118118
with:
119119
persist-credentials: false
120120
- name: Setup Java
121-
uses: actions/setup-java@v4
121+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
122122
with:
123123
distribution: temurin
124124
java-version: 21
125125
cache: maven
126126
- name: Build and enforce quality gates
127127
run: bash ./mvnw -q verify
128128
- name: Upload coverage
129-
uses: codecov/codecov-action@v4
129+
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7
130130
with:
131131
files: target/site/jacoco/jacoco.xml
132132
fail_ci_if_error: false
@@ -136,11 +136,11 @@ jobs:
136136
runs-on: ubuntu-latest
137137
timeout-minutes: 15
138138
steps:
139-
- uses: actions/checkout@v4
139+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
140140
with:
141141
persist-credentials: false
142142
- name: Setup Java
143-
uses: actions/setup-java@v4
143+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
144144
with:
145145
distribution: temurin
146146
java-version: 21
@@ -157,7 +157,7 @@ jobs:
157157
fi
158158
- name: Dependency review
159159
if: github.event_name == 'pull_request'
160-
uses: actions/dependency-review-action@v4
160+
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
161161
with:
162162
fail-on-severity: moderate
163163
- name: Dependency analysis

.github/workflows/codeql.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ jobs:
1919
contents: read
2020
security-events: write
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2323
with:
2424
persist-credentials: false
2525
- name: Setup Java
26-
uses: actions/setup-java@v4
26+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
2727
with:
2828
distribution: temurin
2929
java-version: 21
3030
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@v3
31+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4
3232
with:
3333
languages: java
3434
- name: Build with Maven Wrapper
3535
run: bash ./mvnw -q -DskipTests package
3636
- name: Perform CodeQL Analysis
37-
uses: github/codeql-action/analyze@v3
37+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
runs-on: ubuntu-latest
2121
timeout-minutes: 25
2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2424
with:
2525
persist-credentials: false
2626
- name: Setup Java
27-
uses: actions/setup-java@v4
27+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
2828
with:
2929
distribution: temurin
3030
java-version: 21
@@ -59,16 +59,16 @@ jobs:
5959
echo "jar=$jar" >> "$GITHUB_OUTPUT"
6060
echo "sbom_json=$sbom_json" >> "$GITHUB_OUTPUT"
6161
- name: Generate provenance attestations
62-
uses: actions/attest@v4
62+
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
6363
with:
6464
subject-checksums: target/checksums.txt
6565
- name: Generate SBOM attestation
66-
uses: actions/attest@v4
66+
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0
6767
with:
6868
subject-path: ${{ steps.artifacts.outputs.jar }}
6969
sbom-path: ${{ steps.artifacts.outputs.sbom_json }}
7070
- name: Upload release artifact
71-
uses: softprops/action-gh-release@v2
71+
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3
7272
with:
7373
files: |
7474
target/javasoundrecorder-*-all.jar

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525
contents: read
2626
id-token: write
2727
steps:
28-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2929
with:
3030
persist-credentials: false
3131
- name: Analyze
32-
uses: ossf/scorecard-action@v2.4.0
32+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
3333
with:
3434
results_file: scorecard-results.sarif
3535
results_format: sarif

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
- Dependabot GitHub Actions update cadence changed to weekly.
2929
- SpotBugs quality gate added to Maven `verify` and CI static-analysis workflow.
3030
- Release workflow shell snippets hardened for actionlint/shellcheck compliance.
31+
- GitHub Actions pinned to immutable commit SHAs and Docker images pinned by digest.
32+
- Repository security settings enabled for Dependabot security updates and secret scanning.
3133

3234
## 1.0.0
3335
### Added

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM eclipse-temurin:21-jre-jammy as runtime
1+
FROM eclipse-temurin:21-jre-jammy@sha256:199aebeb3adcde4910695cdebfe782ada38dadb6cc8013159b58d3724451befd as runtime
22

33
WORKDIR /app
44
COPY target/javasoundrecorder-*-all.jar /app/javasoundrecorder.jar

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ This enforces configured line/branch thresholds in `pom.xml`.
141141
- `.github/workflows/actionlint.yml`: static validation for GitHub Actions workflow files.
142142
- Maven Wrapper: reproducible local and CI builds via Maven 3.9.16.
143143
- GitHub Actions hardening: scoped token permissions, job timeouts, concurrency controls, and non-persistent checkout credentials.
144+
- GitHub Actions are pinned to immutable commit SHAs; Docker images are pinned by digest.
144145
- `.github/workflows/codeql.yml`: static security analysis
145146
- `.github/workflows/scorecard.yml`: OSSF scorecards check for supply-chain posture.
146147
- `.github/workflows/release.yml`: verified tag releases with checksums, CycloneDX SBOM (JSON/XML), and GitHub artifact attestations.
@@ -265,6 +266,7 @@ docker run --rm javasoundrecorder
265266
- `.github/workflows/actionlint.yml` — статическая проверка GitHub Actions workflow-файлов.
266267
- Maven Wrapper — воспроизводимая локальная и CI-сборка на Maven 3.9.16.
267268
- GitHub Actions hardening: ограниченные permissions, timeout для job, concurrency и checkout без сохранения credentials.
269+
- GitHub Actions закреплены по immutable commit SHA; Docker images закреплены по digest.
268270
- `.github/workflows/ci.yml` также запускает `Dependency Review` для pull request.
269271
- `.github/workflows/codeql.yml` — анализ безопасности.
270272
- `.github/workflows/scorecard.yml` — OSSF Scorecards для оценки supply-chain-подхода.

docs/DEPENDENCY_POLICY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ The baseline favors current stable releases over milestones, betas, snapshots, o
3131
- Keep test style in JUnit Jupiter; update tests by behavior, not framework churn.
3232
- Run `./mvnw -q verify` after dependency changes.
3333
- Keep Dependabot enabled for Maven and GitHub Actions.
34+
- Pin GitHub Actions to full commit SHAs and keep the human-readable version in a trailing comment.
35+
- Pin Docker images by digest; refresh the digest together with the reviewed tag.
3436

3537
## Manual update check
3638

docs/QUALITY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- Security checks include dependency analysis and `CodeQL` workflow.
1717
- Pull request dependency policy is enforced by `dependency-review` in CI.
1818
- Workflows use least-privilege permissions, explicit timeouts, concurrency control, and non-persistent checkout credentials.
19+
- Workflow actions are pinned to immutable commit SHAs and container images are pinned by digest.
1920
- Current stable dependency baseline and update rules are documented in `docs/DEPENDENCY_POLICY.md`.
2021
- Supply-chain posture is additionally analyzed by OSSF Scorecards workflow.
2122
- Release automation is in `.github/workflows/release.yml` with full Maven verification, checksums, and artifact attestations.
@@ -43,6 +44,7 @@
4344
- Workflow quality posture is covered by actionlint for GitHub Actions YAML.
4445
- Modernized Maven/JUnit/SLF4J/JaCoCo/Checkstyle/SpotBugs/ArchUnit/CycloneDX baseline.
4546
- CI hardening is visible through scoped workflow permissions, job timeouts, and cancelled superseded runs.
47+
- Immutable workflow dependencies reduce tag-retargeting risk and improve OSSF Scorecards evidence.
4648
- Dependency manifest transparency through release artifacts containing CycloneDX SBOM in JSON and XML.
4749
- Release provenance and SBOM linkage are verifiable through GitHub artifact attestations.
4850

0 commit comments

Comments
 (0)