diff --git a/README.md b/README.md new file mode 100644 index 0000000..7024667 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# .github + +This repository stores GitHub specific information that applies to all the repositories within the +enterprise-contract GitHub organization. + +## Community Health Files + +Currently, this repostory defines the following [community health +files](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file): + +* [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) +* [CONTRIBUTING.md](./CONTRIBUTING.md) +* [SECURITY.md](./SECURITY.md) + +## Required Workflows + +The [workflows](./workflows) defined in this repository are meant to be used by other repositories +within this organization. They should be included in a [repository +ruleset](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/about-rulesets) +at the organization level. This is not done automatically. When adding a new workflow, be sure to +also update the corresponding ruleset +[here](https://github.com/organizations/enterprise-contract/settings/rules). diff --git a/workflows/dependency-review.yml b/workflows/dependency-review.yml new file mode 100644 index 0000000..c3baf67 --- /dev/null +++ b/workflows/dependency-review.yml @@ -0,0 +1,25 @@ +--- +# This workflow will scan dependency manifest files that change as part of a Pull Request, +# surfacing known-vulnerable versions of the packages declared or updated in the PR. +# Once installed, if the workflow run is marked as required, +# PRs introducing known-vulnerable packages will be blocked from merging. +name: 'Dependency Review' +"on": [pull_request] + +permissions: + contents: read + +jobs: + dependency-review: + runs-on: ubuntu-latest + steps: + - name: Harden Runner + uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 + with: + egress-policy: audit + disable-telemetry: true + + - name: 'Checkout Repository' + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + - name: 'Dependency Review' + uses: actions/dependency-review-action@6c5ccdad469c9f8a2996bfecaec55a631a347034 # v3.1.0 diff --git a/workflows/scorecard.yml b/workflows/scorecard.yml new file mode 100644 index 0000000..8e42e04 --- /dev/null +++ b/workflows/scorecard.yml @@ -0,0 +1,61 @@ +--- +name: Scorecard supply-chain security +"on": + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: '20 7 * * 2' + push: + branches: ["main"] + +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + contents: read + actions: read + + steps: + - name: Harden Runner + uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.1 + with: + egress-policy: audit + disable-telemetry: true + + - name: "Checkout code" + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + with: + persist-credentials: false + + - name: "Run analysis" + uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031 # v2.2.0 + with: + results_file: results.sarif + results_format: sarif + # https://github.com/ossf/scorecard-action#publishing-results. + 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 + 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@6a28655e3dcb49cb0840ea372fd6d17733edd8a4 # v2.21.8 + with: + sarif_file: results.sarif