All Projects → ossf → scorecard-action

ossf / scorecard-action

Licence: other
Official GitHub Action for OSSF Scorecards.

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Dockerfile
14818 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to scorecard-action

jcefbuild
Binary builds of java-cef
Stars: ✭ 160 (+384.85%)
Mutual labels:  github-actions
action-sync-node-meta
GitHub Action that syncs package.json with the repository metadata.
Stars: ✭ 25 (-24.24%)
Mutual labels:  github-actions
specification
Software Bill of Material (SBOM) standard designed for use in application security contexts and supply chain component analysis
Stars: ✭ 129 (+290.91%)
Mutual labels:  supply-chain
markdown-to-pdf
A GitHub Action to make PDF and HTML files from Markdown
Stars: ✭ 33 (+0%)
Mutual labels:  github-actions
invalidate-cloudfront-action
Invalidate AWS CloudFront distribution paths
Stars: ✭ 84 (+154.55%)
Mutual labels:  github-actions
bridgecrew-action
This Github Action runs Bridgecrew against an Infrastructure-as-Code repository. Bridgecrew performs static security analysis of Terraform & CloudFormation Infrastructure code.
Stars: ✭ 52 (+57.58%)
Mutual labels:  github-actions
sentry
GitHub Actions for interacting with Sentry.io
Stars: ✭ 14 (-57.58%)
Mutual labels:  github-actions
setup-graphviz
▶️ GitHub Action to set up Graphviz cross-platform(Linux, macOS, Windows).
Stars: ✭ 20 (-39.39%)
Mutual labels:  github-actions
vacation-mode-action
Limit interactions to your repository while on vacation using GitHub Actions
Stars: ✭ 73 (+121.21%)
Mutual labels:  github-actions
ci-notice
😱 Notify you when CI fails.
Stars: ✭ 25 (-24.24%)
Mutual labels:  github-actions
actions-setup-perl
Setup Perl environment Action
Stars: ✭ 51 (+54.55%)
Mutual labels:  github-actions
CIAnalyzer
A tool collecting multi CI services build data and export it for creating self-hosting build dashboard.
Stars: ✭ 52 (+57.58%)
Mutual labels:  github-actions
php-skeleton
A skeleton to start new high-quality PHP projects without worrying about bootstrapping everything from scratch.
Stars: ✭ 23 (-30.3%)
Mutual labels:  github-actions
latex-action
GitHub Action to compile LaTeX documents
Stars: ✭ 123 (+272.73%)
Mutual labels:  github-actions
intellij-platform-plugin-verifier-action
GitHub Action for executing the intellij-plugin-verifier
Stars: ✭ 20 (-39.39%)
Mutual labels:  github-actions
qodana-action
⚙️ Scan your Java, Kotlin, PHP, Python, JavaScript, TypeScript projects at GitHub with Qodana
Stars: ✭ 112 (+239.39%)
Mutual labels:  github-actions
sentry-release
GitHub Action for publishing a new release to Sentry.io
Stars: ✭ 13 (-60.61%)
Mutual labels:  github-actions
action-hadolint
Run hadolint with reviewdog 🐶
Stars: ✭ 38 (+15.15%)
Mutual labels:  github-actions
demo-ci
Aula prática sobre servidores de Integração Contínua
Stars: ✭ 15 (-54.55%)
Mutual labels:  github-actions
awesome-address-book
This project shows a basic address book built with ReactJS, Redux Toolkit and Typescript 📖
Stars: ✭ 20 (-39.39%)
Mutual labels:  github-actions

Scorecards' GitHub action

CodeQL

Official GitHub Action for OSSF Scorecards.

The Scorecards GitHub Action is free for all public repositories. Private repositories are supported if they have GitHub Advanced Security. Private repositories without GitHub Advanced Security can run Scorecards from the command line by following the standard installation instructions.


Installation

View Results

Manual Action Setup


Installation

To install the Scorecards GitHub Action, you need to:

  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.)

  2. Set up the workflow via the GitHub UI

Authentication

  1. Create a Personal Access Token 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

image

  1. Copy the token value.

  2. Create a new repository secret with the following settings:

    • Name: SCORECARD_READ_TOKEN
    • Value: the value of the token created in step 1 above.
  3. (Optional) If you install Scorecard on a repository owned by an organization that uses SAML SSO, be sure to enable SSO for your PAT token.

Workflow Setup

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

image

  1. Click “Set up Code Scanning.”

image

Note: if you have already 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

Then click "Add More Scanning Tools."

image

  1. Choose the "OSSF Scorecards supply-chain security analysis" from the list of workflows, and then click “set up this workflow.”

image

  1. Commit the changes.

image

View Results

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

Verify Runs

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.

image

Troubleshooting

If the run has failed, the most likely reason is an authentication failure. Confirm that the Personal Access Token is saved as an encrypted secret within the same repository (see Authentication).

If you install Scorecard on a repository owned by an organization that uses SAML SSO or if you see 403 Resource protected by organization SAML enforcement in the logs, be sure to enable SSO for your PAT token (see Authentication).

If the PAT is saved as an encrypted secret and the run is still failing, confirm that you have not made any changes to the workflow yaml file that affected the syntax. Review the workflow example and reset to the default values if necessary.

Manual Action Setup

If you prefer to manually set up the Scorecards GitHub Action, you will need to set up a workflow file.

First, create a new file in this location: [yourrepo]/.github/workflows/scorecards-analysis.yml. Then use the input values below.

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 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

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. 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 also needed to enable badges on the repository (release scheduled for Q2'22).

Uploading Artifacts

The Scorecards Action uses the artifact uploader action to upload results in SARIF format to the Actions tab. These results are available to anybody for five days after the run to help with debugging. To disable the upload, comment out the Upload Artifact value in the Workflow Example.

Note: if you disable this option, the results of the Scorecards Action run will be available only to maintainers (on the Security tab scanning dashboard).

Workflow Example

name: Scorecards supply-chain security
on: 
  # Only the default branch is supported.
  branch_protection_rule:
  schedule:
    # Weekly on Saturdays.
    - cron: '30 1 * * 6'
  push:
    branches: [ main, master ]

# Declare default permissions as read only.
permissions: read-all

jobs:
  analysis:
    name: Scorecards analysis
    runs-on: ubuntu-latest
    permissions:
      # Needed to upload the results to code-scanning dashboard.
      security-events: write
      actions: read
      contents: read
    
    steps:
      - name: "Checkout code"
        uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
        with:
          persist-credentials: false

      - name: "Run analysis"
        uses: ossf/scorecard-action@c1aec4ac820532bab364f02a81873c555a0ba3a1 # v1.0.4
        with:
          results_file: results.sarif
          results_format: sarif
          # Read-only PAT token. To create it,
          # follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
          repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
          # 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). Commenting out will disable uploads of run results in SARIF
      # format to the repository Actions tab.
      - name: "Upload artifact"
        uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2 # v2.3.1
        with:
          name: SARIF file
          path: results.sarif
          retention-days: 5
      
      # Upload the results to GitHub's code scanning dashboard.
      - name: "Upload to code-scanning"
        uses: github/codeql-action/upload-sarif@5f532563584d71fdef14ee64d17bafb34f751ce5 # v1.0.26
        with:
          sarif_file: results.sarif
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].