Skip to content

Commit 2be181b

Browse files
allanhaggettclaude
andcommitted
Add Semgrep OWASP Top 10 security scan workflow
Runs on push/PR to main, weekly on Mondays, and on-demand. Uploads SARIF results to GitHub Security tab. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7003dc5 commit 2be181b

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Semgrep OWASP Top 10 Security Scan
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
- cron: '0 8 * * 1' # Weekly on Monday at 08:00 UTC
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
security-events: write
15+
16+
jobs:
17+
semgrep-owasp:
18+
name: OWASP Top 10 Scan
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Run Semgrep OWASP Top 10 scan
26+
uses: returntocorp/semgrep-action@v1
27+
with:
28+
config: >-
29+
p/owasp-top-ten
30+
env:
31+
SEMGREP_RULES: >-
32+
p/owasp-top-ten
33+
34+
- name: Run Semgrep (SARIF output)
35+
if: always()
36+
run: |
37+
pip install semgrep
38+
semgrep scan \
39+
--config p/owasp-top-ten \
40+
--sarif \
41+
--output semgrep-results.sarif \
42+
. || true
43+
44+
- name: Upload SARIF to GitHub Security tab
45+
if: always()
46+
uses: github/codeql-action/upload-sarif@v3
47+
with:
48+
sarif_file: semgrep-results.sarif
49+
category: semgrep-owasp

0 commit comments

Comments
 (0)