diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 0000000..2283f62 --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,45 @@ +name: OpenSSF Scorecard + +on: + push: + branches: + - main + schedule: + - cron: '43 5 * * 6' + +permissions: read-all + +jobs: + scorecard: + name: Scorecard + runs-on: ubuntu-latest + timeout-minutes: 15 + permissions: + contents: read + security-events: write + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Run OpenSSF Scorecard + uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4 + with: + results_file: results.sarif + results_format: sarif + publish_results: true + + - name: Upload Scorecard SARIF artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: scorecard-sarif + path: results.sarif + retention-days: 5 + + - name: Upload Scorecard results to code scanning + uses: github/codeql-action/upload-sarif@ff2f1c621b7f889edc0d3c761ac2e6a3f8cdb0dd # v4.37.7 + with: + sarif_file: results.sarif diff --git a/docs/contributing/security-guidelines.md b/docs/contributing/security-guidelines.md index 6b9bb0d..6edc068 100644 --- a/docs/contributing/security-guidelines.md +++ b/docs/contributing/security-guidelines.md @@ -29,6 +29,14 @@ Do not dismiss a CodeQL alert merely because CI passes or exploitation has not b CodeQL complements tests and human review; it does not replace either. +## OpenSSF Scorecard + +`.github/workflows/scorecard.yml` evaluates the public repository's supply-chain and repository-security posture on pushes to `main` and on a weekly schedule. It does not execute on pull requests because publishing Scorecard results requires an OIDC token; privileged result publication is therefore kept away from untrusted PR execution. + +Scorecard results are published to the OpenSSF Scorecard service, uploaded to GitHub code scanning, and retained as a short-lived SARIF workflow artifact for review/debugging. The workflow uses the official Scorecard Action and only approved result-handling actions pinned to reviewed commit SHAs. + +A Scorecard score is a diagnostic signal, not a release gate by itself. Maintainers should review individual checks and remediation guidance, prioritizing findings that align with the project's threat model, dependency policy, workflow permissions, branch/ruleset protections, and release controls. Do not make cosmetic changes solely to raise the aggregate score when they conflict with the project's actual architecture or security model. + ## Vulnerabilities Do not open a public issue for a suspected vulnerability. Follow `SECURITY.md` and GitHub Private Vulnerability Reporting.