scorecard/README.md

125 lines
5.0 KiB
Markdown
Raw Normal View History

# Security Scorecards
2020-10-09 17:47:59 +03:00
2020-10-16 18:08:43 +03:00
## Motivation
A short motivational video clip to inspire us: https://youtu.be/rDMMYT3vkTk "You passed! All D's ... and an A!"
2020-10-16 18:08:43 +03:00
## Goals
1. Automate analysis and trust decisions on the security posture of open source projects.
1. Use this data to proactively improve the security posture of the critical projects the world depends on.
2020-10-09 17:47:59 +03:00
## Usage
The program only requires one argument to run, the name of the repo:
```shell
2020-10-16 17:54:29 +03:00
$ go build
$ ./scorecard --repo=github.com/kubernetes/kubernetes
2020-10-19 18:09:10 +03:00
Starting [Active]
2020-10-17 09:48:25 +03:00
Starting [CI-Tests]
2020-10-16 17:54:29 +03:00
Starting [CII-Best-Practices]
Starting [Code-Review]
Starting [Contributors]
Starting [Frozen-Deps]
Starting [Fuzzing]
Starting [Pull-Requests]
2020-10-19 19:58:51 +03:00
Starting [SAST]
2020-10-16 17:54:29 +03:00
Starting [Security-Policy]
2020-10-17 09:48:25 +03:00
Starting [Signed-Releases]
2020-10-16 17:54:29 +03:00
Starting [Signed-Tags]
Finished [Fuzzing]
2020-10-19 18:09:10 +03:00
Finished [CII-Best-Practices]
2020-10-19 19:58:51 +03:00
Finished [Frozen-Deps]
2020-10-16 17:54:29 +03:00
Finished [Security-Policy]
Finished [Contributors]
2020-10-17 09:48:25 +03:00
Finished [Signed-Releases]
Finished [Signed-Tags]
2020-10-16 17:54:29 +03:00
Finished [CI-Tests]
2020-10-19 19:58:51 +03:00
Finished [SAST]
2020-10-16 17:54:29 +03:00
Finished [Code-Review]
Finished [Pull-Requests]
2020-10-19 19:58:51 +03:00
Finished [Active]
2020-10-09 18:26:43 +03:00
RESULTS
-------
2020-10-19 18:09:10 +03:00
Active: Pass 10
CI-Tests: Pass 10
CII-Best-Practices: Pass 10
Code-Review: Pass 10
Contributors: Pass 10
Frozen-Deps: Pass 10
Fuzzing: Pass 10
Pull-Requests: Pass 10
2020-10-19 19:58:51 +03:00
SAST: Fail 0
2020-10-19 18:09:10 +03:00
Security-Policy: Pass 10
Signed-Releases: Fail 10
Signed-Tags: Fail 5
2020-10-09 17:47:59 +03:00
```
2020-10-16 17:54:29 +03:00
It is recommended to use an OAuth token to avoid rate limits.
You can create one by the following the instructions
[here](https://docs.github.com/en/free-pro-team@latest/developers/apps/about-apps#personal-access-tokens).
2020-10-17 09:48:25 +03:00
Set the access token as an environment variable:
2020-10-09 17:47:59 +03:00
```shell
2020-10-16 17:54:29 +03:00
export GITHUB_AUTH_TOKEN=<your access token>
2020-10-09 17:47:59 +03:00
```
## Checks
The following checks are all run against the target project:
| Name | Description |
|---|---|
| Security-MD | Does the project contain security policies? |
| Contributors | Does the project have contributors from at least two different organizations? |
| Frozen-Deps | Does the project declare and freeze dependencies? |
| Signed-Tags | Does the project cryptographically sign release tags? |
| Signed-Releases | Does the project cryptographically sign releases? |
| CI-Tests | Does the project run tests in CI? |
| Code-Review | Does the project require code review before code is merged? |
2020-10-14 19:25:16 +03:00
| CII-Best-Practices | Does the project have a CII Best Practices Badge? |
| Pull-Requests | Does the project use Pull Requests for all changes? |
2020-10-19 19:58:51 +03:00
| Fuzzing | Does the project use OSS-Fuzz? |
| SAST | Does the project use static code analysis tools, e.g. CodeQL? |
| Active | Did the project get any commits and releases in last 90 days? |
2020-10-09 17:47:59 +03:00
To see detailed information on how each check works, see the [check-specific documentation page](checks.md).
2020-10-16 17:54:29 +03:00
To use a particular check, add the `--checks` argument with a list of check
names (for example `--checks=CI-Tests,Code-Review`).
2020-10-09 17:47:59 +03:00
If you'd like to add a check, make sure it is something that meets the following criteria:
* automate-able
* objective
* actionable
and then create a new GitHub Issue.
2020-10-27 22:35:05 +03:00
## Contributing
If you want to get involved or have ideas you'd like to chat about, we discuss this project in the [OSSF Best Practices Working Group](https://github.com/ossf/wg-best-practices-os-developers) meetings.
See the [Community Calendar](https://calendar.google.com/calendar?cid=czYzdm9lZmhwNWk5cGZsdGI1cTY3bmdwZXNAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ) for the schedule and meeting invitations.
See the [Contributing](CONTRIBUTING.md) documentation for guidance on how to contribute.
2020-10-09 17:47:59 +03:00
## Results
2020-10-19 18:09:10 +03:00
Each check returns a Pass/Fail decision, as well as a confidence score between 0 and 10.
2020-10-09 17:47:59 +03:00
A confidence of 0 should indicate the check was unable to achieve any real signal, and the result
should be ignored.
A confidence of 10 indicates the check is completely sure of the result.
Many of the checks are based on heuristics, contributions are welcome to improve the detection!
2020-10-13 17:32:38 +03:00
### Requirements
* The scorecard must only be composed of automate-able, objective data. For example, a project having 10 contributors doesnt necessarily mean its more secure than a project with say 50 contributors. But, having two maintainers might be preferable to only having one - the larger bus factor and ability to provide code reviews is objectively better.
* The scorecard criteria can be as specific as possible and not limited general recommendations. For example, for Go, we can recommend/require specific linters and analyzers to be run on the codebase.
* The scorecard can be populated for any open source project without any work or interaction from maintainers.
* Maintainers must be provided with a mechanism to correct any automated scorecard findings they feel were made in error, provide "hints" for anything we can't detect automatically, and even dispute the applicability of a given scorecard finding for that repository.
* Any criteria in the scorecard must be actionable. It should be possible, with help, for any project to "check all the boxes".
* Any solution to compile a scorecard should be usable by the greater open source community to monitor upstream security.