Skip to content

Snyk Security

Snyk Security #51

Workflow file for this run

# A sample workflow which sets up Snyk to analyze the full Snyk platform (Snyk Open Source, Snyk Code,
# Snyk Container and Snyk Infrastructure as Code)
# The setup installs the Snyk CLI - for more details on the possible commands
# check https://docs.snyk.io/snyk-cli/cli-reference
# The results of Snyk Code are then uploaded to GitHub Security Code Scanning
#
# In order to use the Snyk Action you will need to have a Snyk API token.
# More details in https://github.com/snyk/actions#getting-your-snyk-token
# or you can signup for free at https://snyk.io/login
#
# For more examples, including how to limit scans to only high-severity issues
# and fail PR checks, see https://github.com/snyk/actions/
name: Snyk Security
#on:
#push:
#branches: ["main" ]
#pull_request:
# branches: ["main"]
on:
workflow_dispatch:
permissions:
contents: read
jobs:
snyk:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Snyk IaC scan
continue-on-error: true
uses: snyk/actions/iac@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --severity-threshold=low --sarif-file-output=snyk-output.sarif --report
#- uses: actions/checkout@master
#- name: Python Snyk scan
#uses: snyk/actions/python@master
#continue-on-error: true
#env:
#SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
#with:
#args: --severity-threshold=high --all-projects --exclude=docs --command=python3 --report --sarif-file-output=snyk-output.sarif
# Build the docker image for testing
- uses: actions/checkout@v2
- name: Build a Docker image
run: docker build -t psq-docker-scan .
- name: Run Snyk to check Docker image for vulnerabilities
# Snyk can be used to break the build when it detects vulnerabilities.
# In this case we want to upload the issues to GitHub Code Scanning
continue-on-error: true
uses: snyk/actions/docker@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
image: psq-docker-scan
args: --file=Dockerfile
#- name: Upload result to GitHub Code Scanning
#uses: github/codeql-action/upload-sarif@v3
#with:
#sarif_file: snyk-container-output.sarif
# Push the Snyk Code results into GitHub Code Scanning tab
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: snyk-output.sarif