-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): enforce govulncheck and gosec + add permissions hardening (S5) #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
86df1a4
6309c39
effef0d
58a2396
dfe8165
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,8 @@ jobs: | |
| security: | ||
| name: Security Scanning | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
|
|
@@ -103,15 +105,14 @@ jobs: | |
| go-version-file: 'go.mod' | ||
|
|
||
| - name: Run govulncheck | ||
| continue-on-error: true | ||
| run: | | ||
| go install golang.org/x/vuln/cmd/govulncheck@latest | ||
| go install golang.org/x/vuln/cmd/govulncheck@v1.1.4 | ||
| govulncheck ./... | ||
|
Comment on lines
+109
to
110
|
||
|
|
||
| - name: Run gosec (SAST) | ||
| uses: securego/gosec@master | ||
| with: | ||
| args: '-no-fail -fmt json -out gosec-results.json ./...' | ||
| run: | | ||
| go install github.com/securego/gosec/v2/cmd/gosec@v2.22.4 | ||
| gosec -exclude-generated -exclude=G115,G304,G107 -fmt json -out gosec-results.json ./... | ||
|
|
||
| - name: Upload gosec results | ||
| uses: actions/upload-artifact@v4 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ import ( | |
| "io" | ||
| "log" | ||
| "net/http" | ||
| "time" | ||
|
|
||
| "github.com/capiscio/capiscio-core/v2/pkg/simpleguard" | ||
| ) | ||
|
|
@@ -73,7 +74,12 @@ func main() { | |
|
|
||
| log.Println("🛡️ Secure Ping Pong Server running on :8080") | ||
| log.Println(" Waiting for signed requests...") | ||
| if err := http.ListenAndServe(":8080", mux); err != nil { | ||
| srv := &http.Server{ | ||
| Addr: ":8080", | ||
| Handler: mux, | ||
| ReadHeaderTimeout: 10 * time.Second, | ||
| } | ||
| if err := srv.ListenAndServe(); err != nil { | ||
| log.Fatal(err) | ||
| } | ||
|
Comment on lines
+82
to
84
|
||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,14 +1,14 @@ | ||||||||||||
| module github.com/capiscio/capiscio-core/v2 | ||||||||||||
|
|
||||||||||||
| go 1.25.0 | ||||||||||||
| go 1.25.8 | ||||||||||||
|
||||||||||||
| go 1.25.8 | |
| go 1.25.0 | |
| toolchain go1.25.8 |
Copilot
AI
Mar 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go 1.25.8 makes the security job (which uses go-version-file: go.mod) run a different Go patch version than the lint/test jobs pinned to 1.25.0 in .github/workflows/ci.yml. Align these (e.g., use go-version-file everywhere or bump the pinned versions) to avoid inconsistent CI results.
| go 1.25.8 | |
| go 1.25.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
govulncheckis run without theopa_no_wasmbuild tag, while the main build/test jobs compile with-tags opa_no_wasm. This meansgovulncheckmay skip analysis of the tagged code paths (e.g.,pkg/pdp/config.go) and can miss vulnerabilities that ship in the intended build. Consider passing the same build tags to govulncheck (or running it for both tag sets).