diff --git a/.github/workflows/ossf-scorecard.yml b/.github/workflows/ossf-scorecard.yml new file mode 100644 index 00000000..8d56148a --- /dev/null +++ b/.github/workflows/ossf-scorecard.yml @@ -0,0 +1,36 @@ +name: ossf-scorecard + +on: + schedule: + - cron: '30 1 * * 1' + push: + branches: + - develop + - main + +permissions: read-all + +jobs: + analysis: + name: ossf-scorecard + runs-on: ubuntu-latest + permissions: + security-events: write + id-token: write + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 + with: + results_file: results.sarif + results_format: sarif + publish_results: true + - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 + with: + name: ossf-scorecard-results + path: results.sarif + retention-days: 5 + - uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 + with: + sarif_file: results.sarif diff --git a/scripts/checks/verify_supply_chain.py b/scripts/checks/verify_supply_chain.py index 2391a1cc..80d6622e 100644 --- a/scripts/checks/verify_supply_chain.py +++ b/scripts/checks/verify_supply_chain.py @@ -16,6 +16,7 @@ Path(".github/workflows/release.yml"), Path(".github/workflows/secret-scan-gate.yml"), Path(".github/workflows/build-baseline.yml"), + Path(".github/workflows/ossf-scorecard.yml"), Path("docs/security/dependency-policy.md"), Path("docs/security/sbom-policy.md"), Path("docs/security/code-security.md"), @@ -156,6 +157,15 @@ def verify_workflow_coverage() -> list[str]: missing.append( "build workflow should not rely on macos-latest for architecture coverage" ) + scorecard = read_workflow( + Path(".github/workflows/ossf-scorecard.yml"), "ossf scorecard", missing + ) + if scorecard: + missing.extend( + f"ossf scorecard workflow missing token: {token}" + for token in ["develop", "main", "push", "schedule", "ossf-scorecard"] + if token not in scorecard + ) return missing