From 15458caf4a906cee3584bf55fa661a5a3c3e119e Mon Sep 17 00:00:00 2001 From: Shubham Pampattiwar Date: Wed, 9 Sep 2026 12:26:29 -0700 Subject: [PATCH] Add OpenSSF Scorecard workflow and README badge (#10467) Velero has no published OpenSSF Scorecard results, so the Scorecard badge does not resolve and CLOMonitor flags the openssf_scorecard_badge check as missing. Add the ossf/scorecard-action workflow (SHA-pinned, least-privilege permissions, publish_results enabled) running weekly and on push to main. Once it runs post-merge, results publish to the OpenSSF API and the README badge resolves. This also surfaces the project's security posture (currently 6.2/10) to guide further hardening. Part of the CNCF incubation readiness work (#10383). Signed-off-by: Shubham Pampattiwar --- .github/workflows/scorecard.yml | 56 +++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/scorecard.yml diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 000000000..9ba1b8b46 --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,56 @@ +name: Scorecard supply-chain security +on: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '20 7 * * 1' + push: + branches: [ "main" ] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + # Skip on forks; results are only meaningful for the canonical repo. + if: github.repository == 'velero-io/velero' + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + + steps: + - name: "Checkout code" + uses: actions/checkout@v7 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4 + with: + results_file: results.sarif + results_format: sarif + # Publish results to OpenSSF REST API for the Scorecard badge and to + # allow the project to be included in the OpenSSF metrics dashboard. + publish_results: true + + # Upload the results as artifacts (optional). Commenting out will disable + # uploads of run results in SARIF format to the repository Actions tab. + - name: "Upload artifact" + uses: actions/upload-artifact@v7 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@v4.37.9 + with: + sarif_file: results.sarif diff --git a/README.md b/README.md index 328f96467..1fb78d6c8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ ![100] [![Build Status][1]][2] [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3811/badge)](https://bestpractices.coreinfrastructure.org/projects/3811) +[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/velero-io/velero/badge)](https://scorecard.dev/viewer/?uri=github.com/velero-io/velero) [![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/velero-io/velero)](https://github.com/velero-io/velero/releases) [![GitHub stars](https://img.shields.io/github/stars/velero-io/velero)](https://github.com/velero-io/velero/stargazers) [![Docker Pulls](https://img.shields.io/docker/pulls/velero/velero.svg)](https://hub.docker.com/r/velero/velero)