Skip to content

Instantly share code, notes, and snippets.

@naveensrinivasan
Created February 16, 2023 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naveensrinivasan/3065a4829716907bb135aba989b70119 to your computer and use it in GitHub Desktop.
Save naveensrinivasan/3065a4829716907bb135aba989b70119 to your computer and use it in GitHub Desktop.

Scorecard: The Key to Trusting Your Open Source Dependencies

Naveen Srinivasan https://github.com/naveensrinivasan

Have you ever thought about how to ensure that the open source software you're using is secure? It's easy to spend more time researching restaurant reviews than evaluating the security of a new open source dependency, but the consequences of not doing so can be far more serious. Software supply chain attacks are becoming increasingly common, and attackers are targeting vulnerabilities in dependencies early in the supply chain to amplify the impact of their attacks.

Dependency security is in the spotlight, as evidenced by a 742% average annual increase in software supply chain attacks over the past three years. As a result, consumers of open source software need to be informed about the projects they rely on to safeguard their own projects against the next major supply chain attack. Is it safe to use the dependencies in your project? What is going on beneath the surface of the projects you depend on?

That's where the OpenSSF Scorecard comes in. The OpenSSF's Scorecard project is an automated tool that assesses a software project's security practices and risks. According to a recent report by Sonatype, a Scorecard score was one of the best indicators of whether a project had known vulnerabilities. Adopting Scorecard is a great first step to understanding the security of the software you are using and improving your software supply chain security. Project owners can also use Scorecard to monitor and enhance their project's security practices, building trust and ensuring security.

Scorecard is a set of benchmarks that allows you to quickly assess the risk associated with an open source project based on best security practices. The aggregated project score, which ranges from 0 to 10, provides an indication of how seriously a project takes security. This is critical for identifying vulnerable points in your supply chain. A dependency that does not meet your own internal security standards may be the weakest link in your software.

Examining the individual scores for each of the 19 different Scorecard metrics will tell you whether a project's maintainers follow the practices that are most important to you. Does the project require code review when contributors make changes? Are branches protected against unauthorized deletion or changes? Are dependencies pinned, so that compromised version updates cannot be pushed without review? The Scorecard's granularity in scoring individual best practices is similar to a good restaurant review that answers the question "do I want to eat here?" Moreover, Scorecard provides project maintainers with a to-do list of actionable steps to improve security.

Open Source Index

You can use Scorecard in many ways depending on whether you're evaluating someone else's software or improving your own. You can visit Open Source Insights to see a project's score quickly. You can also use the Scorecard CLI to scan any project not currently covered on OSI.

https://deps.dev/go/github.com%2Fossf%2Fscorecard%2Fv4

Scorecard Action

To use Scorecard with your own project, you can add the GitHub Scorecard Action in less than ten minutes. The Action runs a Scorecard scan after any repository change, so you get immediate feedback if a PR causes a regression in your project's security. The results provide remediation tips and an indication of severity, enabling you to raise your score and secure your project. You can also use the checks that give you the most bang for your buck, such as Code Review, Binary Artifacts, and Pinned Dependencies, according to Sonatype's State of the Software Supply Chain report.

Here is an example report of Scorecard in the Security section of your GitHub repository

Scorecard API

The Scorecard API is a powerful tool that allows you to assess the security of a large number of open source projects quickly and easily. With this API, you can check the scores of over 1.25 million GitHub repositories that are scanned weekly. The API provides a wealth of information about the security practices of each project, allowing you to quickly identify vulnerabilities and take action to protect your software supply chain. This data can also be used to automate the process of judging software, making it easy to ensure that your software is always secure and up to date. Whether you're a project owner or a consumer of open source software, the Scorecard API is an essential tool for ensuring the security and reliability of your code.

When you've made progress in improving your score, don't forget to add a badge to showcase your hard work.

At present, the OpenSSF Scorecard is becoming more widely adopted, and its developers are excited about the future. If you try it out, don't hesitate to contact them through their contact section to share your feedback. In conclusion, the OpenSSF Scorecard is an automated and practical tool that enables you to assess the security of open source software and take steps to improve your software supply chain security. It's an essential tool for ensuring that the software you're using is safe and reliable.

Join the Scorecard crowd

The Scorecard crowd is growing, and many users are already benefiting from the tool. According to Chris Aniszczyk, CTO Cloud Native Computing Foundation, "CNCF uses Scorecards in a variety of its projects to improve security practices across the cloud native ecosystem."

Jussi Kukkonen, Python-TUF maintainer, added, "I recently added the Scorecard badge to python-tuf: 9.3. The Token-Permissions advice was especially useful: I'm quite familiar with GitHub Actions and we pay close attention to those in the project... and the check still found issues worth fixing."

Meanwhile, Mikaël Barbero from the Eclipse Foundation said, "Using Scorecard helps us have a good overview of how well the supply chain security best practices are applied to repositories. The fact that it can be called externally and is not only a GitHub Action to set up on each repository is crucial to help us monitor our projects at scale. It helps us identify areas where projects can improve their security posture and ensure that our resources are being used in the most efficient and effective way."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment