Skip to content

Scorecard supply-chain security #143

Scorecard supply-chain security

Scorecard supply-chain security #143

name: Scorecard supply-chain security
on:
branch_protection_rule:
schedule:
- cron: '00 7 1 * *'
push:
branches: [ "main" ]
pull_request:
types: [opened, synchronize, edited]
paths:
- '.github/workflows/security-ossf-scorecard.yml'
workflow_call:
inputs:
harden_runner:
description: "Harden the runner"
required: false
default: true
type: boolean
secrets:
scorecard_token:
description: "Token for the scorecard action"
required: true
permissions: {}
concurrency:
group: ossf-scorecard-${{ github.repository }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
id-token: write
steps:
- name: Harden the runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
if: ${{ inputs.harden_runner != false }}
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
api.osv.dev:443
api.scorecard.dev:443
api.securityscorecards.dev:443
bestpractices.coreinfrastructure.org:443
fulcio.sigstore.dev:443
github.com:443
mcr.microsoft.com:443
oss-fuzz-build-logs.storage.googleapis.com:443
rekor.sigstore.dev:443
sigstore-tuf-root.storage.googleapis.com:443
tuf-repo-cdn.sigstore.dev:443
www.bestpractices.dev:443
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
persist-credentials: false
- name: Run analysis
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
with:
results_file: ossf-scorecard.sarif
results_format: sarif
repo_token: ${{ secrets.SCORECARD_TOKEN || secrets.scorecard_token }}
publish_results: true
- name: Upload artifact
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: SARIF file
path: ossf-scorecard.sarif
retention-days: 5
- name: Upload results to code-scanning
uses: github/codeql-action/upload-sarif@2d790406f505036ef40ecba973cc774a50395aac # v3.25.13
with:
sarif_file: ossf-scorecard.sarif