|
| 1 | +### |
| 2 | +# @format |
| 3 | +# ----- |
| 4 | +# Project: zenstack-monorepo |
| 5 | +# File: security-scorecard.yml |
| 6 | +# Path: \.github\workflows\security-scorecard.yml |
| 7 | +# Created Date: Monday, February 19th 2024 |
| 8 | +# Author: Jonathan Stevens, jonathan@resnovas.com |
| 9 | +# Github: https://github.com/TGTGamer |
| 10 | +# ----- |
| 11 | +# Contributing: Please read through our contributing guidelines. |
| 12 | +# Included are directions for opening issues, coding standards, |
| 13 | +# and notes on development. These can be found at |
| 14 | +# https://github.com/zenstack-monorepo/blob/develop/CONTRIBUTING.md |
| 15 | +# ----- |
| 16 | +# Code of Conduct: This project abides by the Contributor Covenant, v2.0 |
| 17 | +# Please interact in ways that contribute to an open, welcoming, diverse, |
| 18 | +# inclusive, and healthy community. Our Code of Conduct can be found at |
| 19 | +# https://github.com/zenstack-monorepo/blob/develop/CODE_OF_CONDUCT.md |
| 20 | +# ----- |
| 21 | +# Copyright (c) 2024 ZenstackHQ - All Rights Reserved |
| 22 | +# LICENSE: MIT License (MIT) |
| 23 | +# ----- |
| 24 | +# This program has been provided under confidence of the copyright holder and |
| 25 | +# is licensed for copying, distribution and modification under the terms |
| 26 | +# of the MIT License (MIT) published as the License, |
| 27 | +# or (at your option) any later version of this license. |
| 28 | +# This program is distributed in the hope that it will be useful, |
| 29 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 30 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 31 | +# MIT License for more details. |
| 32 | +# You should have received a copy of the MIT License |
| 33 | +# along with this program. If not, please write to: jonathan@resnovas.com, |
| 34 | +# or see https://opensource.org/licenses/MIT |
| 35 | +# ----- |
| 36 | +# DELETING THIS NOTICE AUTOMATICALLY VOIDS YOUR LICENSE |
| 37 | +### |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | +# This workflow uses actions that are not certified by GitHub. They are provided |
| 42 | +# by a third-party and are governed by separate terms of service, privacy |
| 43 | +# policy, and support documentation. |
| 44 | + |
| 45 | +name: Security - Scorecard supply-chain security |
| 46 | +on: |
| 47 | + # For Branch-Protection check. Only the default branch is supported. See |
| 48 | + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection |
| 49 | + branch_protection_rule: |
| 50 | + # To guarantee Maintained check is occasionally updated. See |
| 51 | + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained |
| 52 | + schedule: |
| 53 | + - cron: '21 9 * * 6' |
| 54 | + push: |
| 55 | + branches: |
| 56 | + - main |
| 57 | + - develop |
| 58 | + |
| 59 | +# Declare default permissions as read only. |
| 60 | +permissions: |
| 61 | + contents: read |
| 62 | + |
| 63 | +jobs: |
| 64 | + analysis: |
| 65 | + name: Scorecard analysis |
| 66 | + runs-on: ubuntu-latest |
| 67 | + permissions: |
| 68 | + # Needed to upload the results to code-scanning dashboard. |
| 69 | + security-events: write |
| 70 | + # Needed to publish results and get a badge (see publish_results below). |
| 71 | + id-token: write |
| 72 | + # Uncomment the permissions below if installing in a private repository. |
| 73 | + # contents: read |
| 74 | + # actions: read |
| 75 | + |
| 76 | + steps: |
| 77 | + - name: Harden Runner |
| 78 | + uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 |
| 79 | + with: |
| 80 | + egress-policy: audit |
| 81 | + |
| 82 | + - name: Workflow Telemetry |
| 83 | + uses: catchpoint/workflow-telemetry-action@6705383eabd01833acfe8412ec697384830e1455 # v1.8.7 |
| 84 | + with: |
| 85 | + github_token: ${{ secrets.BOT_TOKEN || github.token }} # Bot Token is a PAT for a automation account. |
| 86 | + comment_on_pr: false |
| 87 | + theme: dark |
| 88 | + proc_trace_sys_enable: true |
| 89 | + |
| 90 | + # checks out the repository |
| 91 | + - uses: actions/checkout@v4 |
| 92 | + with: |
| 93 | + submodules: 'recursive' |
| 94 | + token: ${{ secrets.BOT_TOKEN || github.token }} # Bot Token is a PAT for a automation account. |
| 95 | + |
| 96 | + - name: "Run analysis" |
| 97 | + uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2 |
| 98 | + with: |
| 99 | + results_file: results.sarif |
| 100 | + results_format: sarif |
| 101 | + repo_token: ${{ secrets.BOT_TOKEN || github.token }} # Bot Token is a PAT for a automation account. |
| 102 | + publish_results: true |
| 103 | + |
| 104 | + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF |
| 105 | + # format to the repository Actions tab. |
| 106 | + - name: "Upload artifact" |
| 107 | + uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0 |
| 108 | + with: |
| 109 | + name: SARIF file |
| 110 | + path: results.sarif |
| 111 | + retention-days: 5 |
| 112 | + |
| 113 | + # Upload the results to GitHub's code scanning dashboard. |
| 114 | + - name: "Upload to code-scanning" |
| 115 | + uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4 |
| 116 | + with: |
| 117 | + sarif_file: results.sarif |
0 commit comments