OpenSSF Scorecard - Security health metrics for Open Source
Go to file
dependabot[bot] 090ae4f0bb
🌱 Bump actions/stale from 4.0.0 to 4.1.0 (#1384)
Bumps [actions/stale](https://github.com/actions/stale) from 4.0.0 to 4.1.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](cdf15f641a...7fb802b307)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
2021-12-17 17:53:20 +00:00
.github 🌱 Bump actions/stale from 4.0.0 to 4.1.0 (#1384) 2021-12-17 17:53:20 +00:00
artwork adding logo (#44) 2020-11-06 11:36:23 -06:00
checker [RAW] Branch Protection support (#1396) 2021-12-16 21:42:05 +00:00
checks 🐛 Fix score calculation for multiple files (#1401) 2021-12-16 23:16:02 +00:00
clients CI-Tests: look for test-related strings in target urls as well (#1374) 2021-12-08 17:34:28 +00:00
cloudbuild Fix syntax bug in CloudBuild YAML (#947) 2021-09-01 14:35:25 +00:00
cmd Refactor to improve readability (#1394) 2021-12-15 15:01:34 -08:00
cron Enable dangerous workflow in release test (#1402) 2021-12-16 18:49:49 +00:00
docs [DRAFT: RAW]: Security policy support (#1372) 2021-12-14 23:51:42 +00:00
e2e [RAW]: dependency update tool (#1391) 2021-12-15 17:02:31 +00:00
errors 🌱 Add counting of shell parsing errors (#1026) 2021-09-22 14:46:29 +00:00
pkg [RAW] Branch Protection support (#1396) 2021-12-16 21:42:05 +00:00
policy 🌱 Move from io/ioutil to io and os packages (#1250) 2021-11-12 19:34:46 +00:00
scripts 🌱 add google/ko support for building/pusing container image (#1127) 2021-10-26 17:22:22 +00:00
stats Remove Repo CPU runtime stat logging (#1186) 2021-10-29 04:37:44 +00:00
tools 🌱 Fixed the opencontainer image-spec vuln 2021-12-01 11:23:15 -06:00
utests Reduce false positives in Token-Permissions for contents permission (#1253) 2021-11-16 03:03:54 +00:00
.codecov.yml Feature - Report codecoverage to codecov.io 2021-01-26 17:49:11 -05:00
.gitignore Add a validation step for goreleaser 2021-11-23 13:08:26 -06:00
.golangci.yml Using library to parse github workflows 2021-11-08 17:00:40 -06:00
.goreleaser.yml Add a validation step for goreleaser 2021-11-23 13:08:26 -06:00
.ko.yaml 🐛 Fix ko build workflows in Makefile (#1392) 2021-12-15 10:35:07 -06:00
CODE_OF_CONDUCT.md updating code of conduct to match ossfs (#42) 2020-11-05 14:13:16 -06:00
codeql.js 🌱 Included codeql check for GitHub Actions (#988) 2021-09-09 23:02:11 +00:00
CONTRIBUTING.md 📖 Minor fixes to markdown links (#1141) 2021-10-19 12:14:11 -07:00
Dockerfile 🌱 Bump distroless/base from 56d73a6 to 46d4514 (#1176) 2021-10-29 05:06:21 +00:00
go.mod 🌱 Bump github.com/rhysd/actionlint from 1.6.7 to 1.6.8 (#1267) 2021-12-17 17:24:32 +00:00
go.sum 🌱 Bump github.com/rhysd/actionlint from 1.6.7 to 1.6.8 (#1267) 2021-12-17 17:24:32 +00:00
LICENSE Add license header and code of conduct files. (#34) 2020-10-26 15:22:13 -05:00
main.go 🌱 v3 upgrade changes (#1118) 2021-10-07 18:16:01 -05:00
Makefile 🐛 Fix ko build workflows in Makefile (#1392) 2021-12-15 10:35:07 -06:00
README.md Update README.md (#1388) 2021-12-13 20:50:43 +00:00
SECURITY.md Add SECURITY.md 2021-02-13 14:53:06 -05:00

Security Scorecards

build CodeQL

Overview

Using Scorecards

Checks

Contribute



Overview

What is Scorecards?

We created Scorecards to give consumers of open-source projects an easy way to judge whether their dependencies are safe.

Scorecards is an automated tool that assesses a number of important heuristics ("checks") associated with software security and assigns each check a score of 0-10. You can use these scores to understand specific areas to improve in order to strengthen the security posture of your project. You can also assess the risks that dependencies introduce, and make informed decisions about accepting these risks, evaluating alternative solutions, or working with the maintainers to make improvements.

The inspiration for Scorecards logo: "You passed! All D's ... and an A!"

Project Goals

  1. Automate analysis and trust decisions on the security posture of open source projects.

  2. Use this data to proactively improve the security posture of the critical projects the world depends on.

Prominent Scorecards Users

Scorecards has been run on thousands of projects to monitor and track security metrics. Prominent projects that use Scorecards include:

Using Scorecards

Prerequisites

Platforms: Currently, Scorecards supports OSX and Linux platforms. If you are using a Windows OS you may experience issues. Contributions towards supporting Windows are welcome.

Language: You must have GoLang installed to run Scorecards (https://golang.org/doc/install)

Installation

Standalone

To install Scorecards as a standalone:

  1. Visit our latest release page and download the correct binary for your operating system
  2. Extract the binary file
  3. Add the binary to your GOPATH/bin directory (use go env GOPATH to identify your directory if necessary)

Using Homebrew

You can use Homebrew (on macOS or Linux) to install Scorecards.

brew install scorecard

Using Linux package managers

Package Manager Linux Distribution Command
Nix NixOS nix-env -iA nixpkgs.scorecard
AUR helper Arch Linux Use your AUR helper to install scorecard

Authentication

GitHub imposes api rate limits on unauthenticated requests. To avoid these limits, you must authenticate your requests before running Scorecard. There are two ways to authenticate your requests: either create a GitHub personal access token, or create a GitHub App Installation.

  • Create a GitHub personal access token. When creating the personal access token, we suggest you choose the public_repo scope. Set the token in an environment variable called GITHUB_AUTH_TOKEN, GITHUB_TOKEN, GH_AUTH_TOKEN or GH_TOKEN using the commands below according to your platform.
# For posix platforms, e.g. linux, mac:
export GITHUB_AUTH_TOKEN=<your access token>
# Multiple tokens can be provided separated by comma to be utilized
# in a round robin fashion.
export GITHUB_AUTH_TOKEN=<your access token1>,<your access token2>

# For windows:
set GITHUB_AUTH_TOKEN=<your access token>
set GITHUB_AUTH_TOKEN=<your access token1>,<your access token2>

OR

  • Create a GitHub App Installation for higher rate-limit quotas. If you have an installed GitHub App and key file, you can use the three environment variables below, following the commands (set or export) shown above for your platform.
GITHUB_APP_KEY_PATH=<path to the key file on disk>
GITHUB_APP_INSTALLATION_ID=<installation id>
GITHUB_APP_ID=<app id>

These variables can be obtained from the GitHub developer settings page.

Basic Usage

Docker

scorecard is available as a Docker container:

The GITHUB_AUTH_TOKEN has to be set to a valid token

docker run -e GITHUB_AUTH_TOKEN=token gcr.io/openssf/scorecard:stable --show-details --repo=https://github.com/ossf/scorecard

Using repository URL

Scorecards can run using just one argument, the URL of the target repo:

$ scorecard --repo=github.com/ossf-tests/scorecard-check-branch-protection-e2e
Starting [CII-Best-Practices]
Starting [Fuzzing]
Starting [Pinned-Dependencies]
Starting [CI-Tests]
Starting [Maintained]
Starting [Packaging]
Starting [SAST]
Starting [Dependency-Update-Tool]
Starting [Token-Permissions]
Starting [Security-Policy]
Starting [Signed-Releases]
Starting [Binary-Artifacts]
Starting [Branch-Protection]
Starting [Code-Review]
Starting [Contributors]
Starting [Vulnerabilities]
Finished [CI-Tests]
Finished [Maintained]
Finished [Packaging]
Finished [SAST]
Finished [Signed-Releases]
Finished [Binary-Artifacts]
Finished [Branch-Protection]
Finished [Code-Review]
Finished [Contributors]
Finished [Dependency-Update-Tool]
Finished [Token-Permissions]
Finished [Security-Policy]
Finished [Vulnerabilities]
Finished [CII-Best-Practices]
Finished [Fuzzing]
Finished [Pinned-Dependencies]

RESULTS
-------
Aggregate score: 7.9 / 10

Check scores:
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
|  SCORE  |          NAME          |             REASON             |                         DOCUMENTATION/REMEDIATION                         |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 10 / 10 | Binary-Artifacts       | no binaries found in the repo  | github.com/ossf/scorecard/blob/main/docs/checks.md#binary-artifacts       |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 9 / 10  | Branch-Protection      | branch protection is not       | github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection      |
|         |                        | maximal on development and all |                                                                           |
|         |                        | release branches               |                                                                           |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| ?       | CI-Tests               | no pull request found          | github.com/ossf/scorecard/blob/main/docs/checks.md#ci-tests               |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 0 / 10  | CII-Best-Practices     | no badge found                 | github.com/ossf/scorecard/blob/main/docs/checks.md#cii-best-practices     |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 10 / 10 | Code-Review            | branch protection for default  | github.com/ossf/scorecard/blob/main/docs/checks.md#code-review            |
|         |                        | branch is enabled              |                                                                           |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 0 / 10  | Contributors           | 0 different companies found -- | github.com/ossf/scorecard/blob/main/docs/checks.md#contributors           |
|         |                        | score normalized to 0          |                                                                           |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 0 / 10  | Dependency-Update-Tool | no update tool detected        | github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 0 / 10  | Fuzzing                | project is not fuzzed in       | github.com/ossf/scorecard/blob/main/docs/checks.md#fuzzing                |
|         |                        | OSS-Fuzz                       |                                                                           |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 1 / 10  | Maintained             | 2 commit(s) found in the last  | github.com/ossf/scorecard/blob/main/docs/checks.md#maintained             |
|         |                        | 90 days -- score normalized to |                                                                           |
|         |                        | 1                              |                                                                           |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| ?       | Packaging              | no published package detected  | github.com/ossf/scorecard/blob/main/docs/checks.md#packaging              |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 8 / 10  | Pinned-Dependencies    | unpinned dependencies detected | github.com/ossf/scorecard/blob/main/docs/checks.md#pinned-dependencies    |
|         |                        | -- score normalized to 8       |                                                                           |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 0 / 10  | SAST                   | no SAST tool detected          | github.com/ossf/scorecard/blob/main/docs/checks.md#sast                   |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 0 / 10  | Security-Policy        | security policy file not       | github.com/ossf/scorecard/blob/main/docs/checks.md#security-policy        |
|         |                        | detected                       |                                                                           |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| ?       | Signed-Releases        | no releases found              | github.com/ossf/scorecard/blob/main/docs/checks.md#signed-releases        |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 10 / 10 | Token-Permissions      | tokens are read-only in GitHub | github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions      |
|         |                        | workflows                      |                                                                           |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|
| 10 / 10 | Vulnerabilities        | no vulnerabilities detected    | github.com/ossf/scorecard/blob/main/docs/checks.md#vulnerabilities        |
|---------|------------------------|--------------------------------|---------------------------------------------------------------------------|

Scoring

Each individual check returns a score of 0 to 10, with 10 representing the best possible score. Scorecards also produces an aggregate score, which is a weight-based average of the individual checks weighted by risk.

  • “Critical” risk checks are weighted at 10
  • “High” risk checks are weighted at 7.5
  • “Medium” risk checks are weighted at 5
  • “Low” risk checks are weighted at 2.5

Tests that are rated as “Critical” risk are:

  • Dangerous-Workflow

Tests that are rated as “High” risk are:

  • Maintained
  • Dependency-Update-Tool
  • Binary-Artifacts
  • Branch-Protection
  • Code-Review
  • Signed-Releases
  • Token-Permissions
  • Vulnerabilities

Tests that are rated as “Medium” risk are:

  • Fuzzing
  • Packaging
  • Pinned-Dependencies
  • SAST
  • Security-Policy

Tests that are rated as “Low” risk are:

  • CI-Tests
  • CII-Best-Practices
  • Contributors
  • License

Showing Detailed Results

For more details about why a check fails, use the --show-details option:

./scorecard --repo=github.com/ossf-tests/scorecard-check-branch-protection-e2e --checks Branch-Protection --show-details
Starting [Pinned-Dependencies]
Finished [Pinned-Dependencies]

RESULTS
-------
|---------|------------------------|--------------------------------|--------------------------------|---------------------------------------------------------------------------|
|  SCORE  |          NAME          |             REASON             |            DETAILS             |                         DOCUMENTATION/REMEDIATION                         |
|---------|------------------------|--------------------------------|--------------------------------|---------------------------------------------------------------------------|
| 9 / 10  | Branch-Protection      | branch protection is not       | Info: 'force pushes' disabled  | github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection      |
|         |                        | maximal on development and all | on branch 'main' Info: 'allow  |                                                                           |
|         |                        | release branches               | deletion' disabled on branch   |                                                                           |
|         |                        |                                | 'main' Info: linear history    |                                                                           |
|         |                        |                                | enabled on branch 'main' Info: |                                                                           |
|         |                        |                                | strict status check enabled    |                                                                           |
|         |                        |                                | on branch 'main' Warn: status  |                                                                           |
|         |                        |                                | checks for merging have no     |                                                                           |
|         |                        |                                | specific status to check on    |                                                                           |
|         |                        |                                | branch 'main' Info: number     |                                                                           |
|         |                        |                                | of required reviewers is 2     |                                                                           |
|         |                        |                                | on branch 'main' Info: Stale   |                                                                           |
|         |                        |                                | review dismissal enabled on    |                                                                           |
|         |                        |                                | branch 'main' Info: Owner      |                                                                           |
|         |                        |                                | review required on branch      |                                                                           |
|         |                        |                                | 'main' Info: 'admininistrator' |                                                                           |
|         |                        |                                | PRs need reviews before being  |                                                                           |
|         |                        |                                | merged on branch 'main'        |                                                                           |
|---------|------------------------|--------------------------------|--------------------------------|---------------------------------------------------------------------------|

Using a Package manager

For projects in the --npm, --pypi, or --rubygems ecosystems, you have the option to run Scorecards using a package manager. Provide the package name to run the checks on the corresponding GitHub source code.

For example, --npm=angular.

Running specific checks

To run only specific check(s), add the --checks argument with a list of check names.

For example, --checks=CI-Tests,Code-Review.

Formatting Results

There are three formats currently: default, json, and csv. Others may be added in the future.

These may be specified with the --format flag. For example, --format=json.

Report Problems

If you have what looks like a bug, please use the Github issue tracking system. Before you file an issue, please search existing issues to see if your issue is already covered.

Public Data

If you're interested in seeing a list of projects with their Scorecard check results, we publish these results in a BigQuery public dataset.

This data is available in the public BigQuery dataset openssf:scorecardcron.scorecard-v2. The latest results are available in the BigQuery view openssf:scorecardcron.scorecard-v2_latest.

You can extract the latest results to Google Cloud storage in JSON format using the bq tool:

# Get the latest PARTITION_ID
bq query --nouse_legacy_sql 'SELECT partition_id FROM
openssf.scorecardcron.INFORMATION_SCHEMA.PARTITIONS WHERE table_name="scorecard-v2"
ORDER BY partition_id DESC
LIMIT 1'

# Extract to GCS
bq extract --destination_format=NEWLINE_DELIMITED_JSON
'openssf:scorecardcron.scorecard-v2$<partition_id>' gs://bucket-name/filename.json

The list of projects that are checked is available in the cron/data/projects.csv file in this repository. If you would like us to track more, please feel free to send a Pull Request with others. Currently, this list is derived from projects hosted on GitHub ONLY. We do plan to expand them in near future to account for projects hosted on other source control systems.

NOTE: The public dataset uses a Pass/Fail scoring system with a confidence score between 0 and 10. A confidence of 0 indicates that the check was unable to achieve any real signal, and that the result should be ignored. A confidence of 10 indicates the check was completely sure of the result.

Checks

Scorecard Checks

The following checks are all run against the target project by default:

Name Description
Binary-Artifacts Is the project free of checked-in binaries?
Branch-Protection Does the project use Branch Protection ?
CI-Tests Does the project run tests in CI, e.g. GitHub Actions, Prow?
CII-Best-Practices Does the project have a CII Best Practices Badge?
Code-Review Does the project require code review before code is merged?
Contributors Does the project have contributors from at least two different organizations?
Dangerous-Workflow Does the project avoid dangerous coding patterns in GitHub Action workflows?
Dependency-Update-Tool Does the project use tools to help update its dependencies?
Fuzzing Does the project use fuzzing tools, e.g. OSS-Fuzz?
License Does the project declare a license?
Maintained Is the project maintained?
Pinned-Dependencies Does the project declare and pin dependencies?
Packaging Does the project build and publish official packages from CI/CD, e.g. GitHub Publishing ?
SAST Does the project use static code analysis tools, e.g. CodeQL, LGTM, SonarCloud?
Security-Policy Does the project contain a security policy?
Signed-Releases Does the project cryptographically sign releases?
Token-Permissions Does the project declare GitHub workflow tokens as read only?
Vulnerabilities Does the project have unfixed vulnerabilities? Uses the OSV service.

Detailed Checks Documentation

To see detailed information about each check, its scoring criteria, and remediation steps, check out the checks documentation page.

Contribute

Code of Conduct

Before contributing, please follow our Code of Conduct.

Contribute to Scorecards

See the Contributing documentation for guidance on how to contribute to the project.

Adding a Scorecard Check

If you'd like to add a check, please see guidance here.

Connect with the Scorecards Community

If you want to get involved in the Scorecards community or have ideas you'd like to chat about, we discuss this project in the OSSF Best Practices Working Group meetings.

Artifact Link
Scorecard Dev Forum ossf-scorecard-dev@
Scorecard Announcements Forum ossf-scorecard-announce@
Community Meeting VC Link to z o o m meeting
Community Meeting Calendar Biweekly mondays, 3:30pm-4:30pm PST
Calendar
Meeting Notes Notes
Slack Channel #security_scorecards
  Facilitators Company Profile
Azeem Shaik Google azeemshaikh38
Laurent Simon Google laurentsimon
Naveen Srinivasan naveensrinivasan
Chris McGehee Datto chrismcgehee

Report a Security Issue

To report a security issue, please follow instructions here.