Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Semgrep

on:
push:
branches: ["main", "develop"]
pull_request:
branches: ["main", "develop"]
schedule:
- cron: '0 8 * * 1' # weekly full scan every Monday 8am

jobs:
semgrep:
name: Semgrep Scan
runs-on: ubuntu-latest
container:
image: semgrep/semgrep

permissions:
contents: read
security-events: write # required for SARIF upload to GitHub Security tab

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # full history needed for accurate diff on PRs

- name: Run SAST (Code)
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
run: |
semgrep ci \
--config=auto \
--sarif \
--output=semgrep-sast.sarif
continue-on-error: true # remove this if you want SAST to block the pipeline

- name: Run SCA (Supply Chain)
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
run: |
semgrep ci \
--supply-chain \
--sarif \
--output=semgrep-sca.sarif
continue-on-error: true

- name: Run Secrets Detection
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
run: |
semgrep ci \
--secrets \
--sarif \
--output=semgrep-secrets.sarif
continue-on-error: true

- name: Upload SAST results to GitHub Security
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: semgrep-sast.sarif
category: semgrep-sast
if: always()

- name: Upload SCA results to GitHub Security
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: semgrep-sca.sarif
category: semgrep-sca
if: always()

- name: Upload Secrets results to GitHub Security
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: semgrep-secrets.sarif
category: semgrep-secrets
if: always()
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ MarkupSafe==2.0.1
requests==2.27.1
urllib3==1.26.8
waitress==2.1.1
Werkzeug==2.0.1
Werkzeug==2.0.0