Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
6d81bc1
add threat scanning workflows
riatzukiza Oct 24, 2025
a2d6d1b
adjusted event triggers
riatzukiza Oct 24, 2025
5fc9d80
reverting accidental edit
riatzukiza Oct 24, 2025
1761693
ci: guard AV workflows on PRs + robust tag resolution
riatzukiza Oct 24, 2025
7ee7e75
ci: enable PR/push AV scans (no releases required)
riatzukiza Oct 24, 2025
43d5102
ci: add heuristic build steps to PR ClamAV job (Node/Rust/Go)
riatzukiza Oct 24, 2025
911b4d6
ci: harden heuristic PR build (corepack, non-fatal builds, tarball)
riatzukiza Oct 24, 2025
72dbdb9
ci: add Bun (bun.lockb) support to PR build (Ubuntu)
riatzukiza Oct 24, 2025
403709a
ci: remove third‑party setup actions in PR scan; install Bun/Rust via…
riatzukiza Oct 24, 2025
f68767d
ci: add minimal smoke workflow (ubuntu/windows/macos) to diagnose sta…
riatzukiza Oct 24, 2025
882bf3b
removeed push action
riatzukiza Oct 24, 2025
ae89716
yaml error
riatzukiza Oct 24, 2025
fc69469
ci: fix scanners (owasp dep-check action pin, clamav DB init, windows…
riatzukiza Oct 24, 2025
e0509db
ci(owasp,defender): fix dep-check inputs (no 'out'; use format=ALL + …
riatzukiza Oct 24, 2025
da6dafc
removed useless smoke test
riatzukiza Oct 24, 2025
9695497
Merge branch 'devops/3415-windows-virus-false-positive' of github.com…
riatzukiza Oct 24, 2025
569c0b1
ci(clamav): detect bun/node/rust/go across repo; only run node when n…
riatzukiza Oct 24, 2025
688d718
ci(defender): avoid Compress-Archive lock by zipping to %RUNNER_TEMP%…
riatzukiza Oct 24, 2025
67ebe1a
ci(defender-pr): scan directory instead of the zip to avoid archive-s…
riatzukiza Oct 24, 2025
20f6f3a
ci(owasp): prep dependencies (bun or node) so ODC sees installed modu…
riatzukiza Oct 24, 2025
4388b7c
ci(defender-pr): fix scan_root propagation (use step outputs) and add…
riatzukiza Oct 24, 2025
80825e0
ci(clamav-pr): build with Bun per README/workflows (no language detec…
riatzukiza Oct 24, 2025
14b2d58
ci(clamav release): build with Bun (single build per README), package…
riatzukiza Oct 24, 2025
779961a
ci(clamav): use local setup-bun action per repo docs; split PATH appl…
riatzukiza Oct 24, 2025
ec148ff
build: add composite action to build with Bun and package single zip …
riatzukiza Oct 24, 2025
4e934c7
ci(clamav-pr): use shared build-package composite; produce single bun…
riatzukiza Oct 24, 2025
23e364e
ci(clamav-release): consume shared build-package; scan extracted bund…
riatzukiza Oct 24, 2025
08fdd67
ci(defender): depend on shared build-package; download single opencod…
riatzukiza Oct 24, 2025
2b38bbe
ci(clamav): unify into single workflow .github/workflows/clam-av.yml;…
riatzukiza Oct 24, 2025
2facd0b
build(composite): use bunx turbo run build (root build script not pre…
riatzukiza Oct 24, 2025
d76454f
ci(owasp): bun monorepo support — setup via local action, bun install…
riatzukiza Oct 24, 2025
5aa0175
ci(setup-bun): pin default Bun to 1.3.0 to satisfy strict build scrip…
riatzukiza Oct 24, 2025
d6876a0
ci(bun): restore setup-bun default to 'latest' to avoid breaking exis…
riatzukiza Oct 24, 2025
f982a98
Delete .github/workflows/clam-av-scan.yml
riatzukiza Oct 24, 2025
af3ec84
Delete .github/workflows/clam-av-pr.yml
riatzukiza Oct 24, 2025
17c167d
chore(format): use `bunx prettier` instead of `bun run prettier` (no …
riatzukiza Oct 24, 2025
cf83524
ci(setup-bun): restore legacy behavior — run `bun install` inside set…
riatzukiza Oct 25, 2025
a06b547
ci: pin Bun to 1.3.0 globally in setup-bun (with install step) and re…
riatzukiza Oct 25, 2025
a3cbade
Merge remote-tracking branch 'origin/dev' into devops/3415-windows-vi…
riatzukiza Oct 25, 2025
0fc67e2
ci(defender): force Bun 1.3.0 in build-package; ensure build job emit…
riatzukiza Oct 25, 2025
6b55890
Merge remote-tracking branch 'fork/devops/3415-windows-virus-false-po…
riatzukiza Oct 25, 2025
30c48aa
nope
riatzukiza Oct 25, 2025
7e01b17
so we may have needed that one
riatzukiza Oct 25, 2025
5f545ad
I can read
riatzukiza Oct 25, 2025
a187586
oops
riatzukiza Oct 25, 2025
7c4bf37
????
riatzukiza Oct 25, 2025
1b654ba
specify bun version file for setup-bun action
riatzukiza Oct 25, 2025
550f861
I can definitely read
riatzukiza Oct 25, 2025
d03c0b0
lock in bun version
riatzukiza Oct 25, 2025
514284b
be specific
riatzukiza Oct 25, 2025
865f369
add bun version to hash function
riatzukiza Oct 25, 2025
6dd6d72
stuff
riatzukiza Oct 25, 2025
ef7f2da
ci(setup-bun): make cache version-strict & self-invalidating; clear ~…
riatzukiza Oct 25, 2025
be9b068
ci(setup-bun): read version from .bun-version and disable tool-cache;…
riatzukiza Oct 25, 2025
6824092
Kill robot fantasy
riatzukiza Oct 25, 2025
c5bccf4
well then
riatzukiza Oct 25, 2025
04a24f6
EICAR string test
riatzukiza Oct 25, 2025
b0cd175
ooops
riatzukiza Oct 25, 2025
20d58ee
trying to trigger security check
riatzukiza Oct 25, 2025
9d23888
it should only pass if it fails
riatzukiza Oct 25, 2025
541fdd5
robot's don't want you to be safe
riatzukiza Oct 25, 2025
bea6975
Won't work in github ci
riatzukiza Oct 25, 2025
204c0d2
Ensure ClamAV workflow validates EICAR detection
riatzukiza Oct 26, 2025
903121b
Add polling for Defender detections
riatzukiza Oct 26, 2025
26fb605
Add on-demand Defender scan for EICAR verification
riatzukiza Oct 26, 2025
a4a83e3
Update .github/workflows/clam-av.yml
riatzukiza Oct 26, 2025
dd01120
Ensure ClamAV workflow validates EICAR detection
riatzukiza Oct 26, 2025
eb17530
Merge pull request #4 from riatzukiza/devops/3415-deterministic-defen…
riatzukiza Oct 28, 2025
b663abc
Merge pull request #3 from riatzukiza/codex/add-eicar-check-to-clamav…
riatzukiza Oct 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bun-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.3.0
33 changes: 33 additions & 0 deletions .github/actions/build-package/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and package (Bun -> single zip)
description: Build with Bun (Turbo) and package a single distributable archive
outputs:
archive_path:
description: Absolute path to the archive
value: ${{ steps.pkg.outputs.archive_path }}
runs:
using: composite
steps:
- name: Setup Bun (from .bun-version)
uses: ./.github/actions/setup-bun

- name: Build (Turbo)
shell: bash
run: bunx turbo run build

- name: Ensure zip is available
shell: bash
run: sudo apt-get update -y && sudo apt-get install -y zip

- name: Package single file
id: pkg
shell: bash
run: |
set -e
mkdir -p bundle
if [ -d dist ]; then SRC=dist; elif [ -d build ]; then SRC=build; else SRC=.; fi
if [ "$SRC" = "." ]; then
zip -r bundle/opencode.zip . -x '.git/*' '.github/*' 'node_modules/*'
else
(cd "$SRC" && zip -r ../bundle/opencode.zip .)
fi
echo "archive_path=$(pwd)/bundle/opencode.zip" >> "$GITHUB_OUTPUT"
51 changes: 37 additions & 14 deletions .github/actions/setup-bun/action.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,43 @@
name: "Setup Bun"
description: "Setup Bun with caching and install dependencies"
name: setup-bun
description: Setup Bun from .bun-version (or input) and install workspace deps
inputs:
bun-version:
description: Fallback Bun version if .bun-version is absent
required: false
default: '1.3.0'
outputs:
resolved-version:
description: The Bun version that was installed
value: ${{ steps.ver.outputs.version }}
runs:
using: "composite"
using: composite
steps:
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Resolve Bun version (prefer .bun-version)
id: ver
shell: bash
run: |
if [ -f .bun-version ]; then
ver=$(tr -d '[:space:]' < .bun-version)
else
ver='${{ inputs.bun-version }}'
fi
echo "version=$ver" >> "$GITHUB_OUTPUT"
echo "Resolved Bun version: $ver"

- name: Cache ~/.bun
id: cache-bun
uses: actions/cache@v4
- name: Setup Bun (no tool-cache, exact version)
uses: oven-sh/setup-bun@v2
with:
path: ~/.bun
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lockb', 'bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
bun-version: ${{ steps.ver.outputs.version }}
no-cache: true

- name: Verify Bun version
shell: bash
run: |
set -e
echo "bun version: $(bun --version)"
test "$(bun --version | awk '{print $1}')" = "${{ steps.ver.outputs.version }}"

- name: Install dependencies
run: bun install
# Historical behavior: run bun install during setup
- name: Install workspace dependencies
shell: bash
run: bun install --frozen-lockfile || bun install
74 changes: 74 additions & 0 deletions .github/workflows/clam-av.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: av-clamav
on:
pull_request:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read
actions: read

jobs:
clamav:
runs-on: ubuntu-latest
steps:
# Checkout the right ref
- name: Checkout (release tag)
if: github.event_name == 'release'
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Checkout (PR/default)
if: github.event_name != 'release'
uses: actions/checkout@v4

# Single source-of-truth build -> one file
- name: Build and package
id: build
uses: ./.github/actions/build-package

# Install fresh ClamAV DB
- name: Install & update ClamAV DB
run: |
set -e
sudo apt-get update
sudo apt-get install -y clamav clamav-freshclam unzip
sudo systemctl stop clamav-freshclam || true
sudo mkdir -p /var/lib/clamav
sudo chown -R clamav:clamav /var/lib/clamav
sudo freshclam --verbose
ls -lh /var/lib/clamav

# Scan extracted bundle so counts reflect actual files
- name: Verify ClamAV detects EICAR signature
run: |
set -euo pipefail
printf 'X5O!P%%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' > eicar.com
status=0
clamscan eicar.com > eicar.log || status=$?
cat eicar.log
if [ "$status" -ne 1 ]; then
echo "ClamAV failed to report the EICAR signature" >&2
exit 1
fi
grep -q 'eicar.com: Eicar-Test-Signature FOUND' eicar.log
grep -q 'Infected files: 1' eicar.log
rm -f eicar.com eicar.log

- name: Extract bundle and scan
run: |
set -e
rm -rf scan && mkdir -p scan
unzip -q bundle/opencode.zip -d scan
echo "File count in payload: $(find scan -type f | wc -l)"
clamscan -ri --scan-archive=yes scan | tee clamav.log
! grep -qE 'Infected files: [1-9][0-9]*' clamav.log

- name: Upload scan results
uses: actions/upload-artifact@v4
with:
name: clamav-scan-results
path: |
clamav.log
bundle/opencode.zip
66 changes: 66 additions & 0 deletions .github/workflows/owasp-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: owasp-dependency-check
on:
pull_request:
release:
types: [published]
workflow_dispatch:

permissions:
contents: read
security-events: write

jobs:
depcheck:
runs-on: ubuntu-latest
steps:
- name: Checkout (release tag)
if: github.event_name == 'release'
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
- name: Checkout (PR/default)
if: github.event_name != 'release'
uses: actions/checkout@v4

- name: Setup Bun (repo action)
uses: ./.github/actions/setup-bun

- name: Install workspace deps (Bun)
run: bun install --frozen-lockfile || bun install

- name: Ensure per-package node_modules (symlink to root)
run: |
set -e
root_nm="$(pwd)/node_modules"
if [ ! -d "$root_nm" ]; then echo 'No root node_modules after bun install' >&2; exit 1; fi
# create a node_modules symlink in every workspace package that lacks one
git ls-files -z | tr '\0' '\n' | grep -E '(^|/)package.json$' | while read -r pj; do
pkgdir="$(dirname "$pj")"
[ "$pkgdir" = ".github/actions/setup-bun" ] && continue
if [ ! -d "$pkgdir/node_modules" ]; then
echo "linking $pkgdir/node_modules -> $root_nm"
ln -s "$root_nm" "$pkgdir/node_modules" || true
fi
done

- name: Cache dependency-check data
uses: actions/cache@v4
with:
path: ~/.m2/repository/org/owasp/dependency-check-data/
key: depcheck-data-${{ runner.os }}-v2
restore-keys: |
depcheck-data-${{ runner.os }}-

- name: Run OWASP Dependency-Check
uses: dependency-check/[email protected]
with:
project: OpenCode
path: .
format: ALL
args: --enableExperimental

- name: Upload reports
uses: actions/upload-artifact@v4
with:
name: owasp-depcheck-report
path: reports/**
Loading