Skip to content

Commit

Permalink
run workflow on dispatch event and use token from secrets (#48)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Chaudhary <[email protected]>
  • Loading branch information
ispeakc0de authored Apr 20, 2023
1 parent 449b149 commit 32aab16
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,6 @@ jobs:
- name: Build Image
run: make build


security:
container:
image: litmuschaos/snyk:1.0
volumes:
- /home/runner/work/_actions/:/home/runner/work/_actions/
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: snyk/actions/setup@master
- name: Install packages
run: pip3 install -r requirements.txt
- run: snyk auth ${SNYK_TOKEN}
- name: Snyk monitor
run: snyk test --file=requirements.txt --command=python3


trivy:
runs-on: ubuntu-latest
steps:
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Security Scan
on:
workflow_dispatch:

jobs:
snyk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/python@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

trivy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build an image from Dockerfile
run: |
docker build -f build/Dockerfile -t docker.io/litmuschaos/py-runner:${{ github.sha }} . --build-arg TARGETARCH=amd64
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/litmuschaos/py-runner:${{ github.sha }}'
format: 'table'
exit-code: '1'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'

0 comments on commit 32aab16

Please sign in to comment.