From 15fac61591f7e40e362cdcb3ed942a466e75f0ed Mon Sep 17 00:00:00 2001 From: Alexander Rybkin Date: Tue, 28 Jul 2026 20:09:57 -0700 Subject: [PATCH] Add OpenSSF Scorecard workflow and badge Aligns mkl_random with dpctl, dpnp, mkl_umath and mkl_fft, which all run the Scorecard action from the repository itself. Running the analysis in-repo lets Scorecard evaluate checks that the external scan cannot see. The published report for mkl_random currently contains 14 checks, while the other repositories report 18: CI-Tests, Contributors, Dependency-Update-Tool and Vulnerabilities are missing even though .github/dependabot.yml is present. The workflow is copied verbatim from mkl_fft, so all action versions stay pinned by commit hash and consistent across the projects. --- .github/workflows/openssf-scorecard.yml | 74 +++++++++++++++++++++++++ README.md | 1 + 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/openssf-scorecard.yml diff --git a/.github/workflows/openssf-scorecard.yml b/.github/workflows/openssf-scorecard.yml new file mode 100644 index 0000000..8ac5b91 --- /dev/null +++ b/.github/workflows/openssf-scorecard.yml @@ -0,0 +1,74 @@ +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +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: '28 2 * * 1' + - cron: '28 2 * * 4' + push: + branches: [ "master" ] + +# Declare default permissions as read only. +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + timeout-minutes: 30 + 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 + # Uncomment the permissions below if installing in a private repository. + # contents: read + # actions: read + + steps: + - name: "Checkout code" + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4 + with: + results_file: results.sarif + results_format: sarif + # (Optional) "write" PAT token. Uncomment the `repo_token` line below if: + # - you want to enable the Branch-Protection check on a *public* repository, or + # - you are installing Scorecard on a *private* repository + # To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat. + # repo_token: ${{ secrets.SCORECARD_TOKEN }} + + # Public repositories: + # - Publish results to OpenSSF REST API for easy access by consumers + # - Allows the repository to include the Scorecard badge. + # - See https://github.com/ossf/scorecard-action#publishing-results. + # For private repositories: + # - `publish_results` will always be set to `false`, regardless + # of the value entered here. + 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: SARIF file + path: results.sarif + retention-days: 14 + + # Upload the results to GitHub's code scanning dashboard. + - name: "Upload to code-scanning" + uses: github/codeql-action/upload-sarif@e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81 # v4.37.3 + with: + sarif_file: results.sarif diff --git a/README.md b/README.md index b58ae37..b1a1b92 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ ## `mkl_random` -- a NumPy-based Python interface to IntelĀ® oneAPI Math Kernel Library (OneMKL) Random Number Generation functionality [![Conda package using conda-forge](https://github.com/IntelPython/mkl_random/actions/workflows/conda-package-cf.yml/badge.svg)](https://github.com/IntelPython/mkl_random/actions/workflows/conda-package-cf.yml) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/IntelPython/mkl_random/badge)](https://securityscorecards.dev/viewer/?uri=github.com/IntelPython/mkl_random) `mkl_random` started as a part of IntelĀ® Distribution for Python optimizations to NumPy.