Skip to content

Commit d974b50

Browse files
committed
VirusTotal: scan extracted binaries, not archives
Archives >3MB may not be unpacked by VirusTotal, meaning only the container gets scanned (meaningless). Now extracts the actual executables from tar.gz/zip before uploading to VirusTotal. Users still download archives (preserves Unix permissions). Also fixes analysis ID parsing (base64 format, not SHA256). Also fixes SBOM format (SPDX 2.3 instead of CycloneDX).
1 parent 88f8908 commit d974b50

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,23 +513,44 @@ jobs:
513513
persist-credentials: false
514514

515515
# ── VirusTotal scan ──────────────────────────────────────
516-
- name: Download draft release binaries
516+
# Extract raw binaries from archives before scanning.
517+
# VirusTotal may not unpack archives >3MB, so we scan the
518+
# actual executables that users will run.
519+
- name: Download and extract release binaries
517520
env:
518521
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
519522
VERSION: ${{ inputs.version }}
520523
run: |
521-
mkdir -p assets
524+
mkdir -p assets binaries
522525
gh release download "$VERSION" --dir assets --repo "$GITHUB_REPOSITORY" --pattern '*.tar.gz' --pattern '*.zip'
523526
ls -la assets/
524527
525-
- name: Scan all binaries with VirusTotal
528+
# Extract binaries from archives for scanning
529+
for f in assets/*.tar.gz; do
530+
NAME=$(basename "$f" .tar.gz)
531+
tar -xzf "$f" -C binaries/ 2>/dev/null || true
532+
# Rename to include platform for identification
533+
if [ -f binaries/codebase-memory-mcp ]; then
534+
mv binaries/codebase-memory-mcp "binaries/${NAME}"
535+
fi
536+
done
537+
for f in assets/*.zip; do
538+
NAME=$(basename "$f" .zip)
539+
unzip -o "$f" -d binaries/ 2>/dev/null || true
540+
if [ -f binaries/codebase-memory-mcp.exe ]; then
541+
mv binaries/codebase-memory-mcp.exe "binaries/${NAME}.exe"
542+
fi
543+
done
544+
echo "=== Extracted binaries for scanning ==="
545+
ls -la binaries/
546+
547+
- name: Scan extracted binaries with VirusTotal
526548
uses: crazy-max/ghaction-virustotal@d34968c958ae283fe976efed637081b9f9dcf74f # v4
527549
id: virustotal
528550
with:
529551
vt_api_key: ${{ secrets.VIRUS_TOTAL_SCANNER_API_KEY }}
530552
files: |
531-
assets/*.tar.gz
532-
assets/*.zip
553+
binaries/*
533554
534555
# ── Wait for ALL VirusTotal engines to complete, then check ──
535556
# The action outputs comma-separated "file=URL" pairs.

0 commit comments

Comments
 (0)