Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(ci): run security scans directly on release instead of checking past runs

LearningCircuit4b9618036517
diff --git a/.github/workflows/container-security.yml b/.github/workflows/container-security.yml
index c23ecfa68d..cf313840ae 100644
--- a/.github/workflows/container-security.yml
+++ b/.github/workflows/container-security.yml
@@ -1,6 +1,7 @@
name: Container Security
on:
+ workflow_call: # Allow calling from release workflow
workflow_dispatch:
schedule:
# Run container security scan daily at 4 AM UTC
diff --git a/.github/workflows/owasp-zap-scan.yml b/.github/workflows/owasp-zap-scan.yml
index ed4f0619f1..7e78c4fe5a 100644
--- a/.github/workflows/owasp-zap-scan.yml
+++ b/.github/workflows/owasp-zap-scan.yml
@@ -4,6 +4,7 @@ name: OWASP ZAP Security Scan
# Full scan is in owasp-zap-full-scan.yml.
on:
+ workflow_call: # Allow calling from release workflow
workflow_dispatch:
schedule:
# Run ZAP baseline and API scans daily at 3:30 AM UTC
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index e9baa18501..03e8b97da1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -11,15 +11,34 @@ on:
permissions: {} # Minimal permissions at workflow level for OSSF Scorecard
jobs:
- # Security gate: verify daily security scans have passed before releasing
- security-check:
- uses: ./.github/workflows/security-release-gate.yml
+ # Run all security scans on the release code
+ security-tests:
+ uses: ./.github/workflows/security-tests.yml
permissions:
contents: read
+
+ semgrep-scan:
+ uses: ./.github/workflows/semgrep.yml
+ permissions:
+ contents: read
+ security-events: write
+ actions: read
+
+ container-security:
+ uses: ./.github/workflows/container-security.yml
+ permissions:
+ contents: read
+ security-events: write
actions: read
+ owasp-zap-scan:
+ uses: ./.github/workflows/owasp-zap-scan.yml
+ permissions:
+ contents: read
+ security-events: write
+
build:
- needs: [security-check]
+ needs: [security-tests, semgrep-scan, container-security, owasp-zap-scan]
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
diff --git a/.github/workflows/security-release-gate.yml b/.github/workflows/security-release-gate.yml
deleted file mode 100644
index 018eb17521..0000000000
--- a/.github/workflows/security-release-gate.yml
+++ /dev/null
@@ -1,157 +0,0 @@
-name: Security Release Gate
-
-# This workflow checks that daily security scans have passed before allowing releases.
-# It verifies:
-# 1. All security workflows have completed runs
-# 2. The most recent runs were successful
-# 3. The scans are not stale (ran within the last 48 hours)
-
-on:
- workflow_call:
- outputs:
- security_status:
- description: "Overall security check status"
- value: ${{ jobs.check-security.outputs.status }}
- workflow_dispatch:
-
-permissions:
- contents: read
- actions: read
-
-jobs:
- check-security:
- name: Verify Security Scans
- runs-on: ubuntu-latest
- outputs:
- status: ${{ steps.check.outputs.status }}
-
- steps:
- - name: Harden the runner (Audit all outbound calls)
- uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
- with:
- egress-policy: audit
-
- - name: Check security workflow statuses
- id: check
- env:
- GH_TOKEN: ${{ github.token }}
- run: |
- set -e
-
- REPO="${{ github.repository }}"
- FAILED_WORKFLOWS=""
- MISSING_WORKFLOWS=""
- STALE_WORKFLOWS=""
-
- # Maximum age for security scans (48 hours in seconds)
- MAX_AGE_SECONDS=$((48 * 60 * 60))
-
- echo "Checking security workflow statuses for $REPO..."
- echo "Maximum scan age: 48 hours"
- echo ""
-
- # List of security workflows to check
- WORKFLOWS=(
- "security-tests.yml"
- "semgrep.yml"
- "container-security.yml"
- "owasp-zap-scan.yml"
- "gitleaks.yml"
- )
-
- for workflow in "${WORKFLOWS[@]}"; do
- echo "Checking $workflow..."
-
- # Get the most recent completed run for this workflow on main branch
- RESULT=$(gh api \
- -H "Accept: application/vnd.github+json" \
- -H "X-GitHub-Api-Version: 2022-11-28" \
- "/repos/$REPO/actions/workflows/$workflow/runs?status=completed&branch=main&per_page=1" \
- --jq '.workflow_runs[0] | {conclusion: .conclusion, created_at: .created_at, html_url: .html_url, head_sha: .head_sha}' \
- 2>/dev/null || echo '{"conclusion": "not_found"}')
-
- CONCLUSION=$(echo "$RESULT" | jq -r '.conclusion // "not_found"')
- CREATED_AT=$(echo "$RESULT" | jq -r '.created_at // "N/A"')
- URL=$(echo "$RESULT" | jq -r '.html_url // "N/A"')
- HEAD_SHA=$(echo "$RESULT" | jq -r '.head_sha // "N/A"')
-
- if [ "$CONCLUSION" = "not_found" ] || [ "$CONCLUSION" = "null" ]; then
- echo " ❌ $workflow: No completed runs found on main branch"
- MISSING_WORKFLOWS="$MISSING_WORKFLOWS $workflow"
- elif [ "$CONCLUSION" = "success" ]; then
- # Check staleness
- if [ "$CREATED_AT" != "N/A" ]; then
- SCAN_TIMESTAMP=$(date -d "$CREATED_AT" +%s 2>/dev/null || echo "0")
- NOW_TIMESTAMP=$(date +%s)
- AGE_SECONDS=$((NOW_TIMESTAMP - SCAN_TIMESTAMP))
-
- if [ "$AGE_SECONDS" -gt "$MAX_AGE_SECONDS" ]; then
- AGE_HOURS=$((AGE_SECONDS / 3600))
- echo " ⚠️ $workflow: STALE - Last run was ${AGE_HOURS}h ago (max: 48h)"
- echo " Last run: $URL"
- STALE_WORKFLOWS="$STALE_WORKFLOWS $workflow"
- else
- AGE_HOURS=$((AGE_SECONDS / 3600))
- echo " ✅ $workflow: PASSED (${AGE_HOURS}h ago, sha: ${HEAD_SHA:0:7})"
- fi
- else
- echo " ✅ $workflow: PASSED (last run: $CREATED_AT)"
- fi
- else
- echo " ❌ $workflow: FAILED (conclusion: $CONCLUSION)"
- echo " Last run: $URL"
- FAILED_WORKFLOWS="$FAILED_WORKFLOWS $workflow"
- fi
- echo ""
- done
-
- # Determine overall status
- HAS_ISSUES=""
-
- if [ -n "$MISSING_WORKFLOWS" ]; then
- echo "::error::Security workflows with no completed runs:$MISSING_WORKFLOWS"
- HAS_ISSUES="true"
- fi
-
- if [ -n "$FAILED_WORKFLOWS" ]; then
- echo "::error::Security checks failed for:$FAILED_WORKFLOWS"
- HAS_ISSUES="true"
- fi
-
- if [ -n "$STALE_WORKFLOWS" ]; then
- echo "::error::Security scans are stale (>48h) for:$STALE_WORKFLOWS"
- HAS_ISSUES="true"
- fi
-
- if [ -n "$HAS_ISSUES" ]; then
- echo "status=failed" >> "$GITHUB_OUTPUT"
- exit 1
- else
- echo "✅ All security checks passed and are up-to-date!"
- echo "status=passed" >> "$GITHUB_OUTPUT"
- fi
-
- - name: Generate summary
- if: always()
- run: |
- {
- echo "## Security Release Gate Results"
- echo ""
- if [ "${{ steps.check.outputs.status }}" = "passed" ]; then
- echo "✅ **All security scans passed** - Release is approved from a security perspective."
- echo ""
- echo "All checks verified:"
- echo "- All required security workflows have completed runs"
- echo "- All runs were successful"
- echo "- All scans ran within the last 48 hours"
- else
- echo "❌ **Security gate failed** - Release is blocked."
- echo ""
- echo "Possible issues:"
- echo "- Security workflow failed (fix the issues and re-run)"
- echo "- Security workflow missing runs (trigger manually)"
- echo "- Security scans are stale >48h (trigger daily scans manually)"
- echo ""
- echo "Review the failed workflows and address any issues before proceeding."
- fi
- } >> "$GITHUB_STEP_SUMMARY"
diff --git a/.github/workflows/security-tests.yml b/.github/workflows/security-tests.yml
index a549c79711..dfc02f126f 100644
--- a/.github/workflows/security-tests.yml
+++ b/.github/workflows/security-tests.yml
@@ -1,6 +1,7 @@
name: Security Tests
on:
+ workflow_call: # Allow calling from release workflow
workflow_dispatch:
schedule:
# Run security tests daily at 2 AM UTC
diff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.yml
index 758871397e..fc63d8b3b7 100644
--- a/.github/workflows/semgrep.yml
+++ b/.github/workflows/semgrep.yml
@@ -1,6 +1,7 @@
name: Semgrep Security Scan
on:
+ workflow_call: # Allow calling from release workflow
workflow_dispatch:
schedule:
# Run security scan daily at 5 AM UTC