-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run vulnerability scan on latest release version
Previously the scan ran on the current state of the codebase. This fails to identify vulnerabilities in dependencies for the latest release version if those dependencies have already been updated in the development codebase. The gating factor for whether a new release is required should be whether the previous release contains vulnerabilities. This change runs the scheduled vulnerability scan on the latest release tag. It also adds vulnerability scanning to pull request builds. This is purely informational. A scan failure does not fail the pull request build. Signed-off-by: Mark S. Lewis <Mark.S.Lewis@outlook.com>
- Loading branch information
1 parent
2d0e9b7
commit 2cd00f3
Showing
3 changed files
with
60 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: "Security vulnerability scan" | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ref: | ||
description: Branch, tag or SHA to scan. | ||
type: string | ||
required: false | ||
default: "" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
# Job to handle the auditing of the code | ||
# NPM audit is run on a 'fake' installation of the libraries | ||
# Pulling in all the dependencies it will be able to run NPM AUDIT, and if that returns a | ||
# error code the job will fail. | ||
scan: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.ref }} | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Install | ||
run: node common/scripts/install-run-rush.js install | ||
- name: Build packages | ||
run: node common/scripts/install-run-rush.js publish --include-all --pack --release-folder tgz --publish | ||
- name: Start local NPM registry | ||
run: node common/scripts/install-run-rush.js start-verdaccio # script will check for the ci variable and use built images | ||
- name: Deploy scan project | ||
run: | | ||
mkdir -p audit | ||
cd audit | ||
npm init --yes | ||
npm install --save --package-lock-only --registry http://localhost:4873 fabric-shim fabric-shim-api fabric-contract-api | ||
- name: Scan | ||
working-directory: audit | ||
run: npm audit --omit=dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters