ci: add OpenSSF Scorecard workflow

Runs the OpenSSF Scorecard action on:
- weekly schedule (Mon 06:00 UTC)
- branch protection rule changes
- pushes to main
- manual dispatch

Publishes results to:
- the public OpenSSF Scorecard API (scorecard.dev) for transparency
- the GitHub code-scanning dashboard (Security tab) for triage

No README badge is added yet — the badge will be introduced in a
follow-up PR once the first scans have run and any quick-win
improvements (token permissions, dependency pinning) have landed.

Aligns with the project's CNCF Incubation readiness work and the
security self-assessment in progress.

Signed-off-by: Timur Tukaev <timur.tukaev@aenix.io>
This commit is contained in:
Timur Tukaev committed 2026-05-23 09:12:06 +05:00
1 parent b689613151
commit 2396d08ee5
1 file changed
+55
+55
View File
@@ -0,0 +1,55 @@
name: OpenSSF Scorecard
on:
branch_protection_rule:
schedule:
# Run weekly on Mondays at 06:00 UTC.
- cron: '0 6 * * 1'
push:
branches: [main]
workflow_dispatch:
# Declare default permissions as read-only.
permissions: read-all
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to the GitHub code-scanning dashboard.
security-events: write
# Needed to publish results to the public scorecard.dev API
# (OIDC token allows publish without storing long-lived credentials).
id-token: write
# Needed to read repository contents.
contents: read
# Needed to read workflow definitions for the Dangerous-Workflow check.
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Run analysis
uses: ossf/scorecard-action@v2
with:
results_file: results.sarif
results_format: sarif
# Publish the results to the OpenSSF Scorecard public API so the
# project appears at https://scorecard.dev/viewer/?uri=github.com/cozystack/cozystack
publish_results: true
- name: Upload SARIF as artifact
uses: actions/upload-artifact@v4
with:
name: scorecard-sarif
path: results.sarif
retention-days: 5
- name: Upload SARIF to code-scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif