Skip to content

Commit 75d580e

Browse files
coopernetesclaude
andauthored
chore: supply chain hardening (CODEOWNERS, Dependabot, Renovate, Scorecard fixes) (#166)
- Add .github/CODEOWNERS (satisfies OpenSSF Scorecard Code-Review check) - Add .github/dependabot.yml scoped to github-actions only (satisfies Dependency-Update-Tool check) - Add renovate.json covering gradle, gradle-wrapper, npm, and dockerfile managers (no Actions overlap with Dependabot); pinDigests: true for Dockerfile base images - Pin eclipse-temurin:21-jdk and :21-jre to SHA256 manifest list digests (satisfies Pinned-Dependencies check; safe for multi-arch builds) - Add permissions: read-all to codeql.yml workflow level - Split dependency-submission into its own job in ci.yml so build-and-test drops from contents: write to contents: read (both satisfy Token-Permissions check) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9456da7 commit 75d580e

7 files changed

Lines changed: 63 additions & 8 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @coopernetes

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
labels:
9+
- "dependencies"

.github/workflows/ci.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
name: CI / Build & Test
1515
runs-on: ubuntu-latest
1616
permissions:
17-
contents: write
17+
contents: read
1818

1919
steps:
2020
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
@@ -37,10 +37,6 @@ jobs:
3737
- name: Verify coverage thresholds
3838
run: ./gradlew jacocoTestCoverageVerification
3939

40-
- name: Submit dependency graph
41-
if: github.event_name == 'push'
42-
uses: gradle/actions/dependency-submission@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # ratchet:gradle/actions/dependency-submission@v6
43-
4440
- name: Publish test results
4541
if: always()
4642
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # ratchet:actions/upload-artifact@v7
@@ -57,6 +53,25 @@ jobs:
5753
path: "**/build/reports/jacoco/"
5854
retention-days: 14
5955

56+
dependency-submission:
57+
name: CI / Dependency Submission
58+
runs-on: ubuntu-latest
59+
if: github.event_name == 'push'
60+
permissions:
61+
contents: write
62+
63+
steps:
64+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
65+
66+
- uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # ratchet:actions/setup-java@v5
67+
with:
68+
distribution: temurin
69+
java-version: 21
70+
cache: gradle
71+
72+
- name: Submit dependency graph
73+
uses: gradle/actions/dependency-submission@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # ratchet:gradle/actions/dependency-submission@v6
74+
6075
e2e-test:
6176
name: CI / E2E Test
6277
runs-on: ubuntu-latest

.github/workflows/codeql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: "CodeQL"
22

3+
permissions: read-all
4+
35
on:
46
push:
57
branches: ["main"]

.github/workflows/container-scan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
required: true
1212
type: string
1313
schedule:
14-
- cron: '0 6 * * 1' # weekly Monday 06:00 UTC
14+
- cron: '0 6 * * 1' # weekly Monday 06:00 UTC
1515

1616
jobs:
1717
grype:

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22

33
# ── Build stage ──────────────────────────────────────────────────────────────
4-
FROM docker.io/eclipse-temurin:21-jdk AS builder
4+
FROM docker.io/eclipse-temurin:21-jdk@sha256:06a4f4be86d459307036eb97c55a24686bd1312fe88c152723c915b7b2e6a8b4 AS builder
55

66
# Install Node.js directly from the official distribution with SHA256 verification.
77
# To update: download the new tarball, verify against nodejs.org/dist/vX.Y.Z/SHASUMS256.txt,
@@ -47,7 +47,7 @@ RUN sed -i \
4747
git-proxy-java-dashboard/build/install/git-proxy-java-dashboard/bin/git-proxy-java-dashboard
4848

4949
# ── Runtime stage ─────────────────────────────────────────────────────────────
50-
FROM docker.io/eclipse-temurin:21-jre
50+
FROM docker.io/eclipse-temurin:21-jre@sha256:137163a1850fd2088d94ecd8420358d83086bd287d3c4f6f14b7d09786490c4d
5151

5252
WORKDIR /app
5353

renovate.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["config:recommended"],
4+
"enabledManagers": ["dockerfile", "gradle", "gradle-wrapper", "npm"],
5+
"packageRules": [
6+
{
7+
"matchManagers": ["npm"],
8+
"matchFileNames": ["git-proxy-java-dashboard/frontend/package.json"],
9+
"labels": ["dependencies", "frontend"]
10+
},
11+
{
12+
"matchManagers": ["gradle", "gradle-wrapper"],
13+
"labels": ["dependencies", "java"]
14+
},
15+
{
16+
"matchManagers": ["dockerfile"],
17+
"labels": ["dependencies", "docker"],
18+
"pinDigests": true
19+
},
20+
{
21+
"matchDepTypes": ["devDependencies"],
22+
"automerge": true,
23+
"automergeType": "pr",
24+
"matchUpdateTypes": ["patch", "minor"]
25+
}
26+
],
27+
"schedule": ["before 6am on monday"]
28+
}

0 commit comments

Comments
 (0)