Skip to content

Commit f29d847

Browse files
committed
workflows: Add Scorecards workflow
This is a modifed version of the workflow from the project itself: * Not using personal access tokens because I believe they are a security issue (this means Branch-Protection check will be incorrect) * Not uploading results to actions cache: Maybe there's a point but I don't see it as the SARIF files are not very human readable This should give us some code scanning alerts in the security tab on Github. This is not really what I'm interested in though so I've enabled the upload to https://api.securityscorecards.dev/. The results json on there is not exactly readable but it is good enough to check what the current results are -- and deps.dev should use those results after some delay I believe. Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
1 parent 650796e commit f29d847

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/scorecards.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Scorecards analysis
2+
on:
3+
branch_protection_rule:
4+
schedule:
5+
- cron: '21 6 * * 1'
6+
push:
7+
branches: [ develop ]
8+
workflow_dispatch:
9+
10+
permissions: {}
11+
12+
jobs:
13+
analysis:
14+
name: Scorecards analysis
15+
runs-on: ubuntu-latest
16+
permissions:
17+
security-events: write # for uploading to code-scanning dashboard
18+
id-token: write # for signing results
19+
actions: read
20+
contents: read
21+
22+
steps:
23+
- name: "Checkout code"
24+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
25+
26+
- name: "Run analysis"
27+
uses: ossf/scorecard-action@99c53751e09b9529366343771cc321ec74e9bd3d
28+
with:
29+
results_file: results.sarif
30+
# sarif format required by upload-sarif action
31+
results_format: sarif
32+
# "repo_token" not set because personal access tokens are dangerous.
33+
# This means Branch-Protection check will not have correct results.
34+
publish_results: true
35+
36+
- name: "Upload to code-scanning dashboard"
37+
uses: github/codeql-action/upload-sarif@8aff97f12c99086bdb92ff62ae06dbbcdf07941b
38+
with:
39+
sarif_file: results.sarif

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![Docs](https://readthedocs.org/projects/theupdateframework/badge/)](https://theupdateframework.readthedocs.io/)
66
[![CII](https://bestpractices.coreinfrastructure.org/projects/1351/badge)](https://bestpractices.coreinfrastructure.org/projects/1351)
77
[![PyPI](https://img.shields.io/pypi/v/tuf)](https://pypi.org/project/tuf/)
8+
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/theupdateframework/python-tuf/badge)](https://api.securityscorecards.dev/projects/github.com/theupdateframework/python-tuf)
89

910
----------------------------
1011
[The Update Framework (TUF)](https://theupdateframework.io/) is a framework for

0 commit comments

Comments
 (0)