-
Notifications
You must be signed in to change notification settings - Fork 517
feat(ci): govulncheck - add gVisor sandboxing via geomys/sandboxed-step #4598
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -40,8 +40,9 @@ permissions: | |
| jobs: | ||
| # Non-blocking: generates SARIF and uploads to GitHub Code Scanning. | ||
| # Replaces Dependabot Security Alerts with reachability-aware findings. | ||
| # Uses govulncheck@latest installed directly (golang/govulncheck-action is | ||
| # not in the DataDog enterprise action allowlist). | ||
| # govulncheck execution is sandboxed via geomys/sandboxed-step (gVisor) | ||
| # to strip ambient authority from the runner — see PR description for | ||
| # allowlist request context. | ||
| # NOTE: Only core packages are scanned here. Contrib modules (each with | ||
| # their own go.mod) are scanned in govulncheck-tests, which blocks merges, | ||
| # but contrib vulnerabilities do not appear in GitHub Code Scanning alerts. | ||
|
|
@@ -57,15 +58,18 @@ jobs: | |
| with: | ||
| go-version: stable | ||
| cache-dependency-path: '**/go.sum' | ||
| - name: Install govulncheck | ||
| run: go install golang.org/x/vuln/cmd/govulncheck@latest | ||
| - name: Run govulncheck (SARIF) | ||
| - name: Run govulncheck (SARIF, sandboxed) | ||
| # geomys/sandboxed-step uses gVisor to confine execution, preventing | ||
| # supply chain attacks from exfiltrating tokens or making network calls. | ||
| # -format sarif exits 0 even when vulnerabilities are found, so the | ||
| # upload step always runs. The blocking check is in govulncheck-tests. | ||
| run: |- | ||
| govulncheck -format sarif \ | ||
| ./ddtrace/... ./appsec/... ./profiler/... ./internal/... ./instrumentation/... \ | ||
| > govulncheck.sarif || true | ||
| uses: geomys/sandboxed-step@v1.2.1 | ||
| with: | ||
| run: |- | ||
| go install golang.org/x/vuln/cmd/govulncheck@latest | ||
| govulncheck -format sarif \ | ||
|
Comment on lines
+69
to
+70
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In this sandbox Useful? React with 👍 / 👎. |
||
| ./ddtrace/... ./appsec/... ./profiler/... ./internal/... ./instrumentation/... \ | ||
| > govulncheck.sarif || true | ||
| - name: Upload SARIF to GitHub Code Scanning | ||
| if: always() | ||
| uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 | ||
|
|
@@ -75,6 +79,7 @@ jobs: | |
|
|
||
| # Blocking: fails the build if any reachable vulnerability is found. | ||
| # Scans both core packages and all contrib modules (each with its own go.mod). | ||
| # govulncheck execution is sandboxed via geomys/sandboxed-step (gVisor). | ||
| govulncheck-tests: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
@@ -87,9 +92,12 @@ jobs: | |
| with: | ||
| go-version: stable | ||
| cache-dependency-path: '**/go.sum' | ||
| - name: Install govulncheck | ||
| run: go install golang.org/x/vuln/cmd/govulncheck@latest | ||
| - name: Run govulncheck (core) | ||
| run: govulncheck ./ddtrace/... ./appsec/... ./profiler/... ./internal/... ./instrumentation/... | ||
| - name: Run govulncheck (contrib) | ||
| run: ./.github/workflows/apps/govulncheck-contribs-v2.sh | ||
| - name: Run govulncheck (sandboxed) | ||
| # geomys/sandboxed-step uses gVisor to confine execution, preventing | ||
| # supply chain attacks from exfiltrating tokens or making network calls. | ||
| uses: geomys/sandboxed-step@v1.2.1 | ||
| with: | ||
| run: | | ||
| go install golang.org/x/vuln/cmd/govulncheck@latest | ||
| govulncheck ./ddtrace/... ./appsec/... ./profiler/... ./internal/... ./instrumentation/... | ||
| ./.github/workflows/apps/govulncheck-contribs-v2.sh | ||
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.
This step writes
govulncheck.sarifinsidegeomys/sandboxed-step, but the followingupload-sarifstep runs back on the host and readsgovulncheck.sariffrom the workspace. The action documents that workspace changes do not persist by default and its default forpersist-workspace-changesisfalse(https://raw.githubusercontent.com/geomys/sandboxed-step/v1.2.1/README.md), so once the command succeeds the report is discarded with the sandbox overlay and Code Scanning has no SARIF file to upload; setpersist-workspace-changes: 'true'for this SARIF-producing step or copy the report out another way.Useful? React with 👍 / 👎.