Skip to content

Commit 119b0ff

Browse files
authored
Add Scorecard GitHub Action (kedacore#6365)
Signed-off-by: rickbrouwer <[email protected]>
1 parent faf42ef commit 119b0ff

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed

.github/workflows/scorecards.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Scorecard supply-chain security
2+
on:
3+
# For Branch-Protection check. Only the default branch is supported. See
4+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
5+
branch_protection_rule:
6+
# To guarantee Maintained check is occasionally updated. See
7+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
8+
schedule:
9+
- cron: '38 12 * * 4'
10+
push:
11+
branches: [ "main" ]
12+
13+
# Declare default permissions as read only.
14+
permissions: read-all
15+
16+
jobs:
17+
analysis:
18+
name: Scorecard analysis
19+
runs-on: ubuntu-latest
20+
permissions:
21+
# Needed to upload the results to code-scanning dashboard.
22+
security-events: write
23+
# Needed to publish results and get a badge (see publish_results below).
24+
id-token: write
25+
# Uncomment the permissions below if installing in a private repository.
26+
# contents: read
27+
# actions: read
28+
29+
steps:
30+
- name: "Checkout code"
31+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
32+
with:
33+
persist-credentials: false
34+
35+
- name: "Run analysis"
36+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
37+
with:
38+
results_file: results.sarif
39+
results_format: sarif
40+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
41+
# - you want to enable the Branch-Protection check on a *public* repository, or
42+
# - you are installing Scorecard on a *private* repository
43+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
44+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
45+
46+
# Public repositories:
47+
# - Publish results to OpenSSF REST API for easy access by consumers
48+
# - Allows the repository to include the Scorecard badge.
49+
# - See https://github.com/ossf/scorecard-action#publishing-results.
50+
# For private repositories:
51+
# - `publish_results` will always be set to `false`, regardless
52+
# of the value entered here.
53+
publish_results: true
54+
55+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
56+
# format to the repository Actions tab.
57+
- name: "Upload artifact"
58+
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
59+
with:
60+
name: SARIF file
61+
path: results.sarif
62+
retention-days: 5
63+
64+
# Upload the results to GitHub's code scanning dashboard (optional).
65+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
66+
- name: "Upload to code-scanning"
67+
uses: github/codeql-action/upload-sarif@1b1aada464948af03b950897e5eb522f92603cc2 # v3.24.9
68+
with:
69+
sarif_file: results.sarif

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
5858

5959
### New
6060

61+
- **General**: Enable OpenSSF Scorecard to enhance security practices across the project ([#5913](https://github.com/kedacore/keda/issues/5913))
6162
- **General**: Introduce new NSQ scaler ([#3281](https://github.com/kedacore/keda/issues/3281))
6263

6364
#### Experimental

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<a href="https://github.com/kedacore/keda/actions?query=workflow%3Amain-build"><img src="https://github.com/kedacore/keda/actions/workflows/main-build.yml/badge.svg" alt="main build"></a>
55
<a href="https://github.com/kedacore/keda/actions?query=workflow%3Anightly-e2e-test"><img src="https://github.com/kedacore/keda/actions/workflows/nightly-e2e.yml/badge.svg" alt="nightly e2e"></a>
66
<a href="https://bestpractices.coreinfrastructure.org/projects/3791"><img src="https://bestpractices.coreinfrastructure.org/projects/3791/badge"></a>
7+
<a href="https://scorecard.dev/viewer/?uri=github.com/kedacore/keda"><img src="https://img.shields.io/ossf-scorecard/github.com/kedacore/keda?label=openssf%20scorecard&style=flat"></a>
78
<a href="https://artifacthub.io/packages/helm/kedacore/keda"><img src="https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kedacore"></a>
89
<a href="https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fkedacore%2Fkeda?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fkedacore%2Fkeda.svg?type=shield"/></a>
910
<a href="https://twitter.com/kedaorg"><img src="https://img.shields.io/twitter/follow/kedaorg?style=social" alt="Twitter"></a></p>

SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ We have a few preventive measures in place to detect security vulnerabilities:
1515
- All pull requests (PRs) are using CodeQL to scan our source code for vulnerabilities
1616
- Dependabot will automatically identify vulnerabilities based on GitHub Advisory Database and open PRs with patches
1717
- Automated [secret scanning](https://docs.github.com/en/enterprise-cloud@latest/code-security/secret-scanning/about-secret-scanning#about-secret-scanning-for-partner-patterns) & alerts
18+
- The [Scorecard GitHub Action](https://github.com/ossf/scorecard-action) automates the process by running security checks on the GitHub repository. By integrating this Action into the repository's workflow, we can continuously monitor the project’s security posture. The Scorecard checks cover various security best practices and provide scores for multiple categories. Some checks include Code Reviews, Branch Protection, Signed Releases, etc.
1819

1920
KEDA maintainers are working to improve our prevention by adding additional measures:
2021

0 commit comments

Comments
 (0)