Skip to content

Commit 6711caf

Browse files
ci: add Semgrep SAST scanning on pull requests (#149)
Adds Semgrep static analysis on PRs to main via the reusable workflow in kernel/security-workflows. Includes .semgrepignore for generated code, test fixtures, and lock files. Made with [Cursor](https://cursor.com) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk CI-only change that adds a new PR workflow; main risk is potential noisy findings or CI time/permissions issues. > > **Overview** > Adds a new GitHub Actions workflow `semgrep.yml` to run Semgrep SAST on pull requests to `main` via the reusable `kernel/security-workflows` workflow, configured with the `p/golang` and `p/trailofbits` rulesets. > > Introduces `.semgrepignore` to exclude common generated/dependency artifacts and test files (`node_modules/`, `vendor/`, `dist/`, `*_test.go`, `go.sum`) from scanning. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2f53190. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 82d943f commit 6711caf

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

.github/workflows/semgrep.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Semgrep
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
scan:
13+
uses: kernel/security-workflows/.github/workflows/semgrep.yml@main
14+
with:
15+
extra-configs: '--config p/golang --config p/trailofbits'
16+
codebase-description: 'Kernel CLI tool authenticating with customer API keys'
17+
secrets: inherit

.semgrepignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
vendor/
3+
dist/
4+
*_test.go
5+
go.sum

0 commit comments

Comments
 (0)