Skip to content

Commit

Permalink
Merge pull request #74 from MorpheusAIs/ryanleung-sec
Browse files Browse the repository at this point in the history
Add security workflow
  • Loading branch information
LachsBagel authored Oct 11, 2024
2 parents 5001441 + 9a0eba7 commit dbfac77
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/security_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Security Scan

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
security_scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install safety bandit
- name: Run Safety check
run: safety check -r requirements.txt
continue-on-error: true

- name: Run Bandit
run: bandit -r . -f custom
continue-on-error: true

- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/[email protected]
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ requests
setuptools
pyinstaller
torch
safety
bandit

0 comments on commit dbfac77

Please sign in to comment.