Skip to content

Commit e52c7d5

Browse files
ping-huang1claude
andcommitted
Add Socket Security Scan workflow with Tier 1 reachability analysis
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d75d6ba commit e52c7d5

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Socket Security Scan with Tier 1 Reachability Analysis
2+
#
3+
# This workflow scans dependencies and performs reachability analysis
4+
# to identify which vulnerabilities are actually reachable in the code.
5+
#
6+
# Required: SOCKET_SECURITY_API_KEY secret with enterprise plan
7+
# API token scopes needed: socket-basics, uploaded-artifacts, full-scans, repo
8+
9+
name: Socket Security Scan
10+
11+
on:
12+
schedule:
13+
- cron: "0 2 * * *" # Everyday at 2 AM UTC
14+
workflow_dispatch:
15+
inputs:
16+
enable_reachability:
17+
description: "Enable Tier 1 reachability analysis"
18+
required: false
19+
default: "true"
20+
type: choice
21+
options:
22+
- "true"
23+
- "false"
24+
25+
concurrency:
26+
group: socket-security-scan
27+
cancel-in-progress: true
28+
29+
jobs:
30+
socket-security:
31+
name: Socket Security Scan
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 120
34+
permissions:
35+
contents: read
36+
37+
steps:
38+
- name: Checkout repository
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
42+
43+
- name: Setup Python
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: "3.12"
47+
48+
- name: Setup Node.js
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: "20"
52+
53+
- name: Install uv (Python package manager)
54+
uses: astral-sh/setup-uv@v4
55+
56+
- name: Install Socket CLI
57+
run: uv pip install socketsecurity --upgrade --system
58+
59+
- name: Run Socket Security Scan
60+
env:
61+
SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_SECURITY_API_KEY }}
62+
SOCKET_SECURITY_API_TOKEN: ${{ secrets.SOCKET_SECURITY_API_KEY }}
63+
PYTHONUNBUFFERED: "1"
64+
ENABLE_REACH: ${{ github.event.inputs.enable_reachability }}
65+
run: |
66+
REPO_NAME="${GITHUB_REPOSITORY#*/}"
67+
68+
# Build reachability flags if enabled
69+
REACH_FLAGS=""
70+
if [[ "${ENABLE_REACH}" != "false" ]]; then
71+
REACH_FLAGS="--reach --reach-memory-limit 16384 --reach-timeout 3600"
72+
echo "Reachability analysis enabled"
73+
fi
74+
75+
echo "Scanning repository: $REPO_NAME"
76+
77+
socketcli \
78+
--target-path "$GITHUB_WORKSPACE" \
79+
--repo "$REPO_NAME" \
80+
--enable-debug \
81+
$REACH_FLAGS

0 commit comments

Comments
 (0)