Skip to content

Commit d9e87e1

Browse files
authored
fix(ci): SAST actually scans the code + drop deprecated flaky semgrep action (ruvnet#930)
Two real problems in the Static Application Security Testing job: 1. **It scanned a path that no longer exists.** `bandit -r src/` and `semgrep … src/` pointed at the repo-root `src/`, but the Python code moved to `archive/v1/src/` (64 .py files) when the runtime was rewritten in Rust. So the SAST scan matched nothing — a silent no-op (this is also why `bandit-results.sarif` was "Path does not exist" on recent runs). Fixed both to `archive/v1/src/`. 2. **Deprecated + redundant + flaky semgrep step.** The `returntocorp/semgrep-action@v1` step pulled `returntocorp/semgrep-agent:v1` from Docker Hub every run (intermittently timing out → red check, e.g. on ruvnet#929) and is EOL. It was redundant: the pip `semgrep --sarif` step is what feeds GitHub Security; the action only pushed to the Semgrep cloud app via SEMGREP_APP_TOKEN. Removed it and folded its `p/docker` + `p/kubernetes` rulesets into the pip semgrep command, so coverage is preserved with no Docker pull. The job stays `continue-on-error: true` (non-gating). YAML validated.
1 parent be48143 commit d9e87e1

1 file changed

Lines changed: 17 additions & 16 deletions

File tree

.github/workflows/security-scan.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ jobs:
4646
4747
- name: Run Bandit security scan
4848
run: |
49-
bandit -r src/ -f sarif -o bandit-results.sarif
49+
# The Python codebase lives under archive/v1/src (it moved there when
50+
# the runtime was rewritten in Rust). Scanning `src/` matched nothing,
51+
# so this SAST step was a silent no-op.
52+
bandit -r archive/v1/src/ -f sarif -o bandit-results.sarif
5053
continue-on-error: true
5154

5255
- name: Upload Bandit results to GitHub Security
@@ -57,22 +60,20 @@ jobs:
5760
sarif_file: bandit-results.sarif
5861
category: bandit
5962

60-
- name: Run Semgrep security scan
61-
continue-on-error: true
62-
uses: returntocorp/semgrep-action@v1
63-
with:
64-
config: >-
65-
p/security-audit
66-
p/secrets
67-
p/python
68-
p/docker
69-
p/kubernetes
70-
env:
71-
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
72-
73-
- name: Generate Semgrep SARIF
63+
# Removed the deprecated `returntocorp/semgrep-action@v1` step: it was
64+
# redundant (the pip `semgrep --sarif` below is what feeds GitHub Security;
65+
# the action only pushed to the Semgrep cloud app via SEMGREP_APP_TOKEN) and
66+
# it pulled `returntocorp/semgrep-agent:v1` from Docker Hub on every run,
67+
# which intermittently timed out and turned this check red. The pip semgrep
68+
# (installed above) needs no Docker pull. The action's `p/docker` +
69+
# `p/kubernetes` rulesets are folded into the command below so coverage is
70+
# preserved.
71+
- name: Run Semgrep + generate SARIF
7472
run: |
75-
semgrep --config=p/security-audit --config=p/secrets --config=p/python --sarif --output=semgrep.sarif src/
73+
semgrep \
74+
--config=p/security-audit --config=p/secrets --config=p/python \
75+
--config=p/docker --config=p/kubernetes \
76+
--sarif --output=semgrep.sarif archive/v1/src/
7677
continue-on-error: true
7778

7879
- name: Upload Semgrep results to GitHub Security

0 commit comments

Comments
 (0)