Skip to content

adopt OpenSSF Scorecard (https://scorecard.dev/)#24792

Merged
krrish-berri-2 merged 1 commit intomainfrom
ossf-scorecord
Mar 30, 2026
Merged

adopt OpenSSF Scorecard (https://scorecard.dev/)#24792
krrish-berri-2 merged 1 commit intomainfrom
ossf-scorecord

Conversation

@krrish-berri-2
Copy link
Copy Markdown
Contributor

Allows us to monitor and harden our repo to ensure no future impact

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq bot commented Mar 30, 2026

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing ossf-scorecord (05134fc) with main (5812053)

Open in CodSpeed

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 30, 2026

Greptile Summary

This PR adds a new GitHub Actions workflow (.github/workflows/scorecard.yml) to integrate the OpenSSF Scorecard supply-chain security scanner, which periodically evaluates the repository's security posture and uploads results to GitHub Code Scanning (SARIF).

Positive aspects:

  • All third-party actions are pinned to full SHA hashes — excellent supply-chain hygiene.
  • persist-credentials: false is correctly set on checkout.
  • Follows the branch_protection_rule + schedule + push-to-default-branch trigger pattern recommended by OpenSSF.

Issues found:

  • The job-level permissions block omits contents: read and actions: read. When job-level permissions are specified explicitly, all unspecified scopes are set to none, overriding the top-level read-all. The ossf/scorecard-action needs contents: read to run most checks, and github/codeql-action/upload-sarif needs actions: read to upload results. The comment labelling these as "private repo only" is incorrect per the official template.

Confidence Score: 3/5

The workflow will likely run with degraded or no results due to missing required permissions; needs a one-line fix before it works correctly.

There is a clear P1 defect: the job-level permissions override read-all and drop contents: read and actions: read, which are required by the scorecard action and SARIF upload step for all repository types. The fix is straightforward, but the workflow as written will not produce complete scorecard results.

.github/workflows/scorecard.yml — job-level permissions block needs contents: read and actions: read added.

Important Files Changed

Filename Overview
.github/workflows/scorecard.yml New OpenSSF Scorecard workflow with properly pinned actions and persist-credentials: false, but job-level permissions omit contents: read and actions: read which are required even for public repos when explicit permissions override the top-level read-all.

Sequence Diagram

sequenceDiagram
    participant GH as GitHub Events
    participant Runner as ubuntu-latest Runner
    participant Checkout as actions/checkout
    participant Scorecard as ossf/scorecard-action
    participant Artifact as actions/upload-artifact
    participant CodeScanning as github/codeql-action/upload-sarif

    GH->>Runner: Trigger workflow
    Runner->>Checkout: Checkout code (persist-credentials: false)
    Checkout-->>Runner: Repository contents
    Runner->>Scorecard: Run scorecard analysis
    Scorecard-->>Runner: results.sarif
    Runner->>Artifact: Upload results.sarif (retention: 5 days)
    Runner->>CodeScanning: Upload results.sarif to Code Scanning
Loading

Reviews (1): Last reviewed commit: "Create scorecard.yml" | Re-trigger Greptile

Comment on lines +17 to +22
permissions:
security-events: write
id-token: write
# Uncomment for private repos if needed:
# contents: read
# actions: read
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing contents: read and actions: read permissions

The job-level permissions block fully overrides the top-level permissions: read-all for this job. When job-level permissions are explicitly set, every unspecified scope is set to none. This means contents and actions are both none for this job.

  • contents: read is required even for public repositories because the ossf/scorecard-action must read repository contents to evaluate checks like Branch-Protection, Pinned-Dependencies, and others.
  • actions: read is required by github/codeql-action/upload-sarif to upload SARIF results to Code Scanning.

The comment # Uncomment for private repos if needed is misleading — the official ossf/scorecard-action template includes both contents: read and actions: read for all repositories (public and private). Without them, the scorecard run will either silently skip checks or fail to upload results.

Suggested change
permissions:
security-events: write
id-token: write
# Uncomment for private repos if needed:
# contents: read
# actions: read
permissions:
security-events: write
id-token: write
contents: read
actions: read

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i disagree - the openssf yaml makes it quite clear this is for private repos only

@krrish-berri-2 krrish-berri-2 merged commit c154d56 into main Mar 30, 2026
51 of 59 checks passed
@krrish-berri-2 krrish-berri-2 deleted the ossf-scorecord branch March 30, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants