-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: Github Actions CI/CD updated (#57)
Various updates for GH Actions + juice shop example Co-authored-by: Miklós Csécsi <[email protected]>
- Loading branch information
Showing
4 changed files
with
83 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Prebuilt repo + Snyk Security Scanning (OS, Code, Docker, IaC) | ||
|
||
# Runs 4 Snyk Products (Code, Open Source, Container, IaC) | ||
# Snyk installation via npm | ||
# Node.js version: 18.4 | ||
# Outputs the results to the pipeline and in SARIF-format to the security tab | ||
|
||
# Prerequisites: | ||
# - Set a SNYK_TOKEN and a SNYK_ORG in the pipelines secrets | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js for installing Snyk | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18.4 | ||
|
||
# Install & prepare Snyk | ||
- run: npm install --location=global snyk | ||
|
||
# This OPTIONAL step will configure the Snyk CLI to connect to the EU instance of Snyk | ||
#- run: snyk config set use-base64-encoding=true | ||
#- run: snyk config set endpoint=https://app.eu.snyk.io/api' | ||
|
||
- run: snyk auth ${{ secrets.SNYK_TOKEN }} | ||
|
||
- name: Snyk Open Source Scanning | ||
run: snyk test --org=${{ secrets.SNYK_ORG }} --all-projects --sarif-file-output=snyk-oss.sarif | ||
continue-on-error: true | ||
- name: Upload results to GitHub Open Source Scanning | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: snyk-oss.sarif | ||
|
||
- name: Snyk Code Scanning | ||
run: snyk code test --org=${{ secrets.SNYK_ORG }} --sarif-file-output=snyk-code.sarif | ||
continue-on-error: true | ||
- name: Upload results to GitHub Code Scanning | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: snyk-code.sarif | ||
|
||
#- name: Build the Docker Image | ||
# run: docker build . --file Dockerfile --tag sebsnyk/juice-shop:latest | ||
|
||
- name: Snyk Container Scanning | ||
run: snyk container test --org=${{ secrets.SNYK_ORG }} --file=Dockerfile --sarif-file-output=snyk-container.sarif sebsnyk/juice-shop:latest | ||
continue-on-error: true | ||
- name: Upload results to GitHub Container Scanning | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: snyk-container.sarif | ||
|
||
- name: Snyk Infrastructure-as-Code Scanning | ||
run: snyk iac test --org=${{ secrets.SNYK_ORG }} --sarif-file-output=snyk-iac.sarif | ||
continue-on-error: true | ||
- name: Upload results to GitHub IaC Scanning | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: snyk-iac.sarif | ||
|
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.