Skip to content

Commit a5df1fd

Browse files
wthrbtnclaude
andcommitted
feat: add dependency review workflow with CVE check and AI security analysis
Two-layer review for dependency update PRs: 1. actions/dependency-review-action — blocks PRs introducing high/critical CVEs 2. Claude AI security review — analyzes upstream commits for supply chain attack patterns (phantom deps, obfuscation, install scripts, C2 calls) and always reports findings, even when clean Triggers on changes to go.mod, go.sum, workflows, and Dockerfile. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8587c2b commit a5df1fd

1 file changed

Lines changed: 66 additions & 0 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Dependency Review
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'go.mod'
7+
- 'go.sum'
8+
- '.github/workflows/**'
9+
- 'Dockerfile'
10+
11+
permissions: {}
12+
13+
jobs:
14+
# Layer 1: Known CVE + license check (free, fast)
15+
vulnerability-check:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
pull-requests: write
20+
steps:
21+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
22+
- uses: actions/dependency-review-action@2031cfc080254a8a887f58cffee85186f0e49e48 # v4.9.0
23+
with:
24+
fail-on-severity: high
25+
26+
# Layer 2: AI security review of upstream changes
27+
ai-dependency-review:
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: read
31+
pull-requests: read
32+
issues: read
33+
id-token: write
34+
steps:
35+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
36+
with:
37+
fetch-depth: 2
38+
39+
- name: Claude dependency security review
40+
uses: anthropics/claude-code-action@88c168b39e7e64da0286d812b6e9fbebb6708185 # v1
41+
with:
42+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
43+
allowed_bots: 'renovate[bot],air-gapped-cooked-renovate[bot],dependabot[bot]'
44+
direct_prompt: |
45+
You are a supply chain security reviewer. Analyze this dependency update PR for security risks.
46+
47+
For EACH changed dependency, report:
48+
49+
1. **What changed**: versions, SHAs, new/removed dependencies
50+
2. **Upstream verification**: Use `gh api` to check the commits between old and new versions:
51+
- Who authored the commits? Are they known maintainers?
52+
- Are commits signed/verified?
53+
- What files changed upstream? (flag changes to dist/, action.yml, install scripts, CI config)
54+
- How many commits? (a "patch" with 50+ commits is suspicious)
55+
3. **Red flags check**: Look for these specific indicators from real 2026 attacks:
56+
- New dependencies that are never imported (phantom deps — Axios attack pattern)
57+
- Base64/encoded strings, eval(), exec() (tj-actions, LiteLLM pattern)
58+
- New postinstall/preinstall scripts (Axios RAT dropper pattern)
59+
- New .pth files in Python packages (LiteLLM pattern)
60+
- New network calls to unexpected hosts (Telnyx C2 pattern)
61+
- Self-deleting code (Axios anti-forensics pattern)
62+
- Registry publish with no matching source commit (LiteLLM, Telnyx pattern)
63+
4. **Verdict**: SAFE / NEEDS ATTENTION / SUSPICIOUS with reasoning
64+
65+
ALWAYS leave a comment with your findings, even if everything looks clean.
66+
A clean report confirming the update is legitimate is valuable — it shows the review happened.

0 commit comments

Comments
 (0)