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

Introduce OpenSSF Scorecard GitHub action #574

Merged
merged 8 commits into from
Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
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
12 changes: 7 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@ jobs:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
steps:
# We run the build twice for each supported JDK: once against the
# original Error Prone release, using only Error Prone checks available
# on Maven Central, and once against the Picnic Error Prone fork,
# additionally enabling all checks defined in this project and any
# Error Prone checks available only from other artifact repositories.
# We run the build twice for each supported JDK: once against the
# original Error Prone release, using only Error Prone checks available
# on Maven Central, and once against the Picnic Error Prone fork,
# additionally enabling all checks defined in this project and any Error
# Prone checks available only from other artifact repositories.
- name: Check out code
uses: actions/[email protected]
with:
persist-credentials: false
- name: Set up JDK
uses: actions/[email protected]
with:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/deploy-website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ on:
pull_request:
push:
branches: [ master, website ]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
permissions:
contents: read
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/[email protected]
with:
persist-credentials: false
- uses: ruby/[email protected]
with:
working-directory: ./website
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/openssf-scorecard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Analyzes the code base and GitHub project configuration for adherence to
# security best practices for open source software. Identified issues are
# registered with GitHub's code scanning dashboard. When a pull request is
# analyzed, any offending lines are annotated. See
# https://securityscorecards.dev for details.
name: OpenSSF Scorecard update
Fixed Show fixed Hide fixed
on:
pull_request:
push:
branches: [ master ]
schedule:
- cron: '0 4 * * 1'
permissions:
contents: read
jobs:
analyze:
permissions:
contents: read
security-events: write
id-token: write
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/[email protected]
Fixed Show fixed Hide fixed

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 7: GitHub-owned GitHubAction not pinned by hash Click Remediation section below to solve this issue
with:
persist-credentials: false
- name: Run OpenSSF Scorecard analysis
uses: ossf/[email protected]

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 7: third-party GitHubAction not pinned by hash Click Remediation section below to solve this issue
with:
results_file: results.sarif
results_format: sarif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool stuff! This is what was also used by the EP PR for collecting diagnotics.

publish_results: ${{ github.ref == 'refs/heads/master' }}
- name: Update GitHub's code scanning dashboard
uses: github/codeql-action/[email protected]
Fixed Show fixed Hide fixed

Check warning

Code scanning / Scorecard

Pinned-Dependencies

score is 7: GitHub-owned GitHubAction not pinned by hash Click Remediation section below to solve this issue
with:
sarif_file: results.sarif

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One extra line here 👀.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice eye for detail! 😄

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency for the win 😉.

1 change: 1 addition & 0 deletions .github/workflows/pitest-analyze-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
uses: actions/[email protected]
with:
fetch-depth: 2
persist-credentials: false
- name: Set up JDK
uses: actions/[email protected]
with:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/pitest-update-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ on:
- completed
permissions:
actions: read
checks: write
contents: read
pull-requests: write
jobs:
update-pr:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
actions: read
checks: write

Check failure

Code scanning / Scorecard

Token-Permissions

score is 9: jobLevel 'checks' permission set to 'write' Remediation tip: Verify which permissions are needed and consider whether you can reduce them. Click Remediation section below for further remediation help
contents: read
pull-requests: write
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/[email protected]
with:
persist-credentials: false
- name: Set up JDK
uses: actions/[email protected]
with:
Expand Down