mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-13 11:34:54 +00:00
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 <spampatt@redhat.com>
57 lines
1.9 KiB
YAML
57 lines
1.9 KiB
YAML
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
|