Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Olivekl new install instructions #46

Merged
merged 31 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f882d3d
Update README.md
olivekl Jan 6, 2022
8e377ad
Update README.md
olivekl Jan 6, 2022
69239b3
Update README.md
olivekl Jan 6, 2022
fd9b17a
Update README.md
olivekl Jan 6, 2022
c95b86a
Update README.md
olivekl Jan 6, 2022
f8e12d0
Update README.md
olivekl Jan 6, 2022
a20b676
Update README.md
olivekl Jan 6, 2022
bdbbd11
Update README.md
olivekl Jan 6, 2022
62d250c
Update README.md
olivekl Jan 7, 2022
4e1227b
Merge branch 'ossf:main' into olivekl-new-install-instructions
olivekl Jan 7, 2022
cfc46b0
Create images folder
olivekl Jan 10, 2022
56bd872
Add files via upload
olivekl Jan 10, 2022
e2c6eaf
Delete placeholder.md
olivekl Jan 10, 2022
8fa6f4f
Update README.md
olivekl Jan 10, 2022
1b19463
Update README.md
olivekl Jan 10, 2022
8b0957b
Add files via upload
olivekl Jan 10, 2022
4683413
Update README.md
olivekl Jan 10, 2022
761151d
Update README.md
olivekl Jan 11, 2022
82d3661
Update README.md
olivekl Jan 11, 2022
a564f59
Add files via upload
olivekl Jan 11, 2022
70338db
Update README.md
olivekl Jan 11, 2022
da9bc05
Update README.md
olivekl Jan 11, 2022
3963a8a
Delete remediaton.png
olivekl Jan 11, 2022
9229ce3
Delete actionconfim.png
olivekl Jan 11, 2022
5a5de2f
Add files via upload
olivekl Jan 11, 2022
17286b4
Update README.md
olivekl Jan 11, 2022
5478ffa
Delete actionconfim.png
olivekl Jan 11, 2022
9c5808e
Add files via upload
olivekl Jan 11, 2022
b62c93e
Update README.md
olivekl Jan 11, 2022
b23d1fe
Update README.md
olivekl Jan 11, 2022
ca090ea
Merge branch 'main' into olivekl-new-install-instructions
laurentsimon Jan 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 75 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,92 @@
[![CodeQL](https://github.com/ossf/scorecard-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/ossf/scorecard-action/actions/workflows/codeql-analysis.yml)
> Official GitHub Action for [OSSF scorecard](https://github.com/ossf/scorecard).

## Installation
The simplest and quickest way to install Scorecards's GitHub action is from the [GitHub's marketplace](https://github.com/marketplace/actions/ossf-scorecard-action).
**WARNING**: the action does *not* support private repositories.
The Scorecards GitHub Action is free for all public repositories. Private repositories are supported if they have [GitHub Advanced Security](https://docs.github.com/en/get-started/learning-about-github/about-github-advanced-security). Private repositories without GitHub Advanced Security can run Scorecards from the command line by following the [standard installation instructions](https://github.com/ossf/scorecard#installation).

### Inputs
## Installation
To install the Scorecards GitHub Action, you need to:

| Name | Required | Description |
| ----- | -------- | ----------- |
| `result_file` | yes | The file that contains the results. |
| `result_format` | yes | The format in which to store the results [json \| sarif]. For GitHub's scanning dashboard, select `sarif`. |
| `repo_token` | yes | PAT token with read-only access. Follow [these steps](#pat-token-creation) to create it. |
| `publish_results` | recommended | This will allow you to display a badge on your repository to show off your hard work (release scheduled for Q2'22). See details [here](#publishing-results).|
1) Create a Personal Access Token (PAT) for authentication and save the token value as a repository secret;

(Note: If you have already installed Scorecards on your repository from the command line, you can reuse your existing PAT for the repository secret. If you no longer have access to the PAT, though, simply create a new one.)

3) Set up the workflow via the GitHub UI

### PAT token creation
1. Create a PAT token [here](https://github.com/settings/tokens/new) with the following read permissions:
- Note: `Read-only token for OSSF Scorecard Action`
### Authentication
1. [Create a Personal Access Token](https://github.com/settings/tokens/new) with the following read permissions:
- Note: `Read-only token for OSSF Scorecard Action - myorg/myrepo` (Note: replace `myorg/myrepo` with the names of your organization and repository so you can keep track of your tokens.)
- Expiration: `No expiration`
- Scopes:
* `repo > public_repo`
* `admin:org > read:org`
* `admin:repo_hook > read:repo_hook`
* `write:discussion > read:discussion`
- Create and copy the token.

2. Create a new repository secret at `https://github.com/<org>/<repo>/settings/secrets/actions/new` with the following settings:
- Name: `SCORECARD_TOKEN`
![image](/images/tokenscopes.png)
laurentsimon marked this conversation as resolved.
Show resolved Hide resolved

2. Copy the token value.

3. [Create a new repository secret](https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository) with the following settings:
- Name: `SCORECARD_READ_TOKEN`
- Value: the value of the token created in step 1 above.

### Workflow Setup
1) From your GitHub project's main page, click “Security” in the top ribbon.

![image](/images/install01.png)

2) Click “Set up Code Scanning.”

![image](/images/install02.png)

Note: if you have aleady configured other code scanning tools, your UI will look different than shown above. Instead, click "Code Scanning Alerts" on the left side of the page.

![image](/images/installb1.png)

Then click "Add More Scanning Tools."

![image](/images/installb2.png)

3) Choose the "OSSF Scorecards supply-chain security analysis" from the list of workflows, and then click “set up this workflow.”
laurentsimon marked this conversation as resolved.
Show resolved Hide resolved

![image](/images/install03.png)

4) Commit the changes.

![image](/images/install04.png)

## Verify Runs and View Results
The workflow is preconfigured to run on every repository contribution.

To verify that the Action is running successfully, click the repository's Actions tab to see the status of all recent workflow runs.
olivekl marked this conversation as resolved.
Show resolved Hide resolved

![image](/images/actionconfirm.png)

To view a list of results from each Scorecards Action run, go to the Security tab and click "Code Scanning Alerts." Click on the individual alerts for more information, including remediation instructions. You will need to click "Show more" to expand the full remediation instructions.

![image](/images/remediation.png)


olivekl marked this conversation as resolved.
Show resolved Hide resolved
## Manual Action Set Up

If you prefer to manually set up the Scorecards GitHub Action, use the following values.

### Inputs

| Name | Required | Description |
| ----- | -------- | ----------- |
| `result_file` | yes | The file that contains the results. |
| `result_format` | yes | The format in which to store the results [json \| sarif]. For GitHub's scanning dashboard, select `sarif`. |
| `repo_token` | yes | PAT token with read-only access. Follow [these steps](#pat-token-creation) to create it. |
| `publish_results` | recommended | This will allow you to display a badge on your repository to show off your hard work (release scheduled for Q2'22). See details [here](#publishing-results).|

### Publishing results
The Scorecard team runs a weekly scan of public GitHub repositories in order to track
the overall security health of the open source ecosystem. The results of the scans are publicly
available as described [here](https://github.com/ossf/scorecard#public-data).
Setting `publish_results: true` replaces the results of the team's weelky scans,
the overall security health of the open source ecosystem. The results of the scans are [publicly
available](https://github.com/ossf/scorecard#public-data).
Setting `publish_results: true` replaces the results of the team's weekly scans with your own scan results,
helping us scale by cutting down on repeated workflows and GitHub API requests.
This option is needed to enable badges on the repository (release scheduled for Q2'22).
This option is also needed to enable badges on the repository (release scheduled for Q2'22).

### Full example

Expand Down Expand Up @@ -76,8 +127,10 @@ jobs:
# Read-only PAT token. To create it,
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
repo_token: ${{ secrets.SCORECARD_TOKEN }}
# Publish the results to enable scorecard badges. For more details, see
# https://github.com/ossf/scorecard-action#publishing-results.
# Publish the results for public repositories to enable scorecard badges. For more details, see
# https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories, `publish_results` will automatically be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional).
Expand Down
Binary file added images/actionconfirm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/install01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/install02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/install03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/install04.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/installb1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/installb2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/remediation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/tokenscopes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.