Skip to content

Commit fb090b4

Browse files
heyvaldemarVladimir Mikhalevclaude
authored
feat(ci): add OpenSSF Scorecard workflow + README badge (#17)
OpenSSF Scorecard scores public OSS repos on supply-chain security posture (pinned dependencies, branch protection, dependency update tooling, SAST, token permissions, etc). Runs weekly, publishes to the scorecard.dev viewer, uploads SARIF to the GitHub Security tab. Closes the 6-PR standards-alignment series. This repo now matches the hardening baseline established in heyvaldemar/aws-kubectl-docker: - PR #12: .env hygiene + credential rotation - PR #13: LICENSE, SECURITY.md, CHANGELOG, Dependabot docker ecosystem, FUNDING.yml removal - PR #14: CI workflow hardening (pinned SHAs, per-job permissions, timeouts, concurrency, weekly rebuild) - PR #15: upstream image digest pinning with Dependabot auto-bumps - PR #16: full README rewrite in evaluator-first structure - PR #17: [this commit] OpenSSF Scorecard workflow + badge Workflow: - .github/workflows/scorecard.yml — matches the shape used on aws-kubectl-docker. All four action pins are commit-SHA based: actions/checkout@de0fac2e... # v6 ossf/scorecard-action@4eaacf05... # v2.4.3 actions/upload-artifact@043fb46d... # v7.0.1 github/codeql-action@95e58e9a... # v4.35.2 The scorecard-action and codeql-action pins are specifically the dereferenced commit SHAs of annotated tags, not the tag-object SHAs that GitHub's /git/refs/tags/v* API returns. Scorecard's own imposter-commit check rejects tag-object SHAs. See aws-kubectl-docker PR #24 for the background. - Triggers: weekly cron (Tuesday 06:00 UTC, one day after the Monday deployment verification run), every push to main, branch protection rule changes, workflow_dispatch. - Permissions: read-all at workflow level (Scorecard needs broad read access); job-level narrows to security-events:write (SARIF upload), id-token:write (OpenSSF API OIDC), contents:read + actions:read. README: - Scorecard badge added between Deployment Verification and License badges. Badge URL points at api.scorecard.dev/projects/<repo>/badge; target URL is the scorecard.dev viewer. CHANGELOG: - [Unreleased] entry documents the workflow + badge addition. Expected initial score: mid-to-high single digits, with penalties for Code-Review 0 (solo maintainer), Fuzzing 0 (not applicable to a deployment template), CII-Best-Practices 0 (not registered). These are honest trade-offs, not oversights. Co-authored-by: Vladimir Mikhalev <ask@sre.gg> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0c522b4 commit fb090b4

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

.github/workflows/scorecard.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: OpenSSF Scorecard
2+
3+
on:
4+
branch_protection_rule:
5+
schedule:
6+
# Weekly on Tuesdays at 06:00 UTC — after the Monday 06:00 UTC deployment
7+
# verification run (deployment-verification.yml). Keeps the Scorecard
8+
# score in sync with any weekly change in pinned-dependency posture.
9+
- cron: "0 6 * * 2"
10+
push:
11+
branches: [main]
12+
workflow_dispatch:
13+
14+
# Scorecard needs broad read access to score the repo; individual jobs
15+
# narrow this further for the steps that need write scopes.
16+
permissions: read-all
17+
18+
jobs:
19+
analysis:
20+
name: Scorecard analysis
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 15
23+
permissions:
24+
# Needed for SARIF upload to the Security tab.
25+
security-events: write
26+
# Needed to publish results to the public OpenSSF API (scorecard.dev).
27+
id-token: write
28+
# Needed to read the repo state and workflow history.
29+
contents: read
30+
actions: read
31+
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
35+
with:
36+
persist-credentials: false
37+
38+
- name: Run Scorecard analysis
39+
# Pinned to the commit SHA of v2.4.3 (not the tag-object SHA returned
40+
# by GitHub's /git/refs/tags endpoint, which Scorecard's own
41+
# imposter-commit check rejects). See aws-kubectl-docker PR #24 for
42+
# the background.
43+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
44+
with:
45+
results_file: results.sarif
46+
results_format: sarif
47+
# Publish results to the public OpenSSF API so the README badge
48+
# populates. No token needed for public repos; the workflow's OIDC
49+
# token authenticates.
50+
publish_results: true
51+
52+
- name: Upload Scorecard results as workflow artifact
53+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
54+
with:
55+
name: SARIF file
56+
path: results.sarif
57+
retention-days: 5
58+
59+
- name: Upload SARIF to GitHub Security tab
60+
uses: github/codeql-action/upload-sarif@95e58e9a2cdfd71adc6e0353d5c52f41a045d225 # v4.35.2
61+
with:
62+
sarif_file: results.sarif

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Added
11+
- `.github/workflows/scorecard.yml` — OpenSSF Scorecard analysis workflow.
12+
Runs weekly on Tuesdays at 06:00 UTC (one day after the Monday deployment
13+
verification run), on every push to `main`, and on branch-protection-rule
14+
changes. Publishes results to the public OpenSSF API (scorecard.dev
15+
viewer) and uploads SARIF to the GitHub Security tab. All action pins
16+
are commit-SHA based, including the dereferenced commit SHA for the
17+
annotated-tag `ossf/scorecard-action@v2.4.3` (plain `@v2.4.3` tag-object
18+
SHA is rejected by Scorecard's imposter-commit verification).
19+
- README badge for OpenSSF Scorecard, placed between the Deployment
20+
Verification and License badges.
1121
- `LICENSE` — canonical MIT license text at repo root, `Copyright (c) 2021-2026 Vladimir Mikhalev (heyvaldemar)`.
1222
- `SECURITY.md` — vulnerability disclosure policy, supported versions, supply-chain trust statement, and a callout for the pre-PR-#12 credential rotation advisory.
1323
- `CHANGELOG.md` — this file, Keep-a-Changelog format.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Keycloak + Traefik + Let's Encrypt — Docker Compose
22

33
[![Deployment Verification](https://github.com/heyvaldemar/keycloak-traefik-letsencrypt-docker-compose/actions/workflows/deployment-verification.yml/badge.svg?branch=main)](https://github.com/heyvaldemar/keycloak-traefik-letsencrypt-docker-compose/actions/workflows/deployment-verification.yml)
4+
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/heyvaldemar/keycloak-traefik-letsencrypt-docker-compose/badge)](https://scorecard.dev/viewer/?uri=github.com/heyvaldemar/keycloak-traefik-letsencrypt-docker-compose)
45
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
56

67
## Contents

0 commit comments

Comments
 (0)