Skip to content

Commit be92a63

Browse files
fix(security): replace broken jobs in OSS-CLI security workflow
PR #91's first run surfaced four breakages in the new security.yml; this commit fixes each in place so the (B) stack actually runs: - osv-scanner: google/osv-scanner-action's action.yml has no top-level `runs:` (it is meta-only). Replace the action with a `gh release download` of the official `osv-scanner_linux_amd64` v2.3.5 binary, then run `osv-scanner --recursive --skip-git ./`. Uses the preinstalled `gh` CLI so no curl/wget per CLAUDE.md. - semgrep: the pinned `semgrep/semgrep@sha256:...` digest does not exist in the registry, so `Initialize containers` fails before any code runs. Drop the container and install Semgrep via `actions/setup-python@v6.2.0` (SHA-pinned) + `pip install semgrep`, then `semgrep scan --error --severity ERROR --metrics off` against p/security-audit + p/owasp-top-ten + p/java. - gitleaks: gitleaks-action requires a paid license for orgs (RandomCodeSpace is an org → upstream blocks the run). The CLI itself is MIT-licensed and free. Replace the action with a `gh release download` of the v8.30.1 linux_x64 tarball and run `gitleaks detect --redact --no-banner --exit-code 1`. - jscpd: `--languages` is not a valid CLI option in jscpd@4. Use `--format "java,javascript,typescript"` (the documented flag). Trivy + SBOM jobs already pass and are unchanged. References: * RAN-46 board ruling comment fa5ba510 (path B) * PR #91 first-run failures: OSV/Semgrep/Gitleaks/jscpd * /home/dev/.claude/CLAUDE.md (no-curl, ctx fetch policy) Co-Authored-By: Paperclip <noreply@paperclip.ing>
1 parent 05ea72f commit be92a63

1 file changed

Lines changed: 48 additions & 15 deletions

File tree

.github/workflows/security.yml

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,24 @@ jobs:
2222
runs-on: ubuntu-latest
2323
permissions:
2424
contents: read
25+
env:
26+
OSV_SCANNER_VERSION: 2.3.5
27+
GH_TOKEN: ${{ github.token }}
2528
steps:
2629
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
27-
- uses: google/osv-scanner-action@c51854704019a247608d928f370c98740469d4b5 # v2.3.5
28-
with:
29-
scan-args: |-
30-
--recursive
31-
--skip-git
32-
./
30+
# Install osv-scanner from the official GitHub release (binary, not the
31+
# action — google/osv-scanner-action's `action.yml` is composite-only and
32+
# fails when invoked as a job step). Using the preinstalled `gh` CLI
33+
# avoids any external `curl`/`wget` per /home/dev/.claude/CLAUDE.md.
34+
- name: Install osv-scanner
35+
run: |
36+
gh release download "v${OSV_SCANNER_VERSION}" \
37+
--repo google/osv-scanner \
38+
--pattern 'osv-scanner_linux_amd64' \
39+
--output osv-scanner
40+
chmod +x osv-scanner
41+
- name: Run osv-scanner (recursive, skip git history)
42+
run: ./osv-scanner --recursive --skip-git ./
3343

3444
trivy:
3545
name: Trivy (filesystem + container scan)
@@ -51,26 +61,49 @@ jobs:
5161
runs-on: ubuntu-latest
5262
permissions:
5363
contents: read
54-
container:
55-
image: semgrep/semgrep@sha256:6f5ee7e5c4c8e09e25a3cabf61a4df04df80e11e82e7e3d6ea8cb6dfbf9e2a0d
5664
steps:
5765
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
58-
- run: semgrep ci --error --config p/security-audit --config p/owasp-top-ten --config p/java
59-
env:
60-
SEMGREP_RULES: p/security-audit p/owasp-top-ten p/java
66+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
67+
with:
68+
python-version: '3.12'
69+
- name: Install semgrep
70+
run: python -m pip install --quiet --upgrade pip semgrep
71+
- name: Run semgrep (security-audit + owasp-top-ten + java)
72+
run: |
73+
semgrep scan \
74+
--error \
75+
--config p/security-audit \
76+
--config p/owasp-top-ten \
77+
--config p/java \
78+
--severity ERROR \
79+
--metrics off
6180
6281
gitleaks:
6382
name: Gitleaks (secret scan)
6483
runs-on: ubuntu-latest
6584
permissions:
6685
contents: read
86+
env:
87+
GITLEAKS_VERSION: 8.30.1
88+
GH_TOKEN: ${{ github.token }}
6789
steps:
6890
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2
6991
with:
7092
fetch-depth: 0
71-
- uses: gitleaks/gitleaks-action@83373cf2f8c4db6e24b41c1a9b086bb9619e9cd3 # v2.3.7
72-
env:
73-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
# The official `gitleaks/gitleaks-action` requires a paid license for
94+
# GitHub organisations. The underlying gitleaks CLI is MIT-licensed and
95+
# free; install it directly from the upstream release. Using the
96+
# preinstalled `gh` CLI avoids any external `curl`/`wget`.
97+
- name: Install gitleaks
98+
run: |
99+
gh release download "v${GITLEAKS_VERSION}" \
100+
--repo gitleaks/gitleaks \
101+
--pattern "gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" \
102+
--output gitleaks.tar.gz
103+
tar -xzf gitleaks.tar.gz gitleaks
104+
chmod +x gitleaks
105+
- name: Run gitleaks (full git history)
106+
run: ./gitleaks detect --source . --redact --no-banner --exit-code 1
74107

75108
jscpd:
76109
name: jscpd (duplication < 3% on touched code)
@@ -86,7 +119,7 @@ jobs:
86119
npx --yes jscpd@4 \
87120
--threshold 3 \
88121
--reporters consoleFull \
89-
--languages java,javascript,typescript \
122+
--format "java,javascript,typescript" \
90123
--ignore "**/target/**,**/node_modules/**,**/grammar/**,**/generated-sources/**,**/dist/**" \
91124
./
92125

0 commit comments

Comments
 (0)