diff --git a/.gitea/workflows/security-scanning.yml b/.gitea/workflows/security-scanning.yml index 0a551053..d95326b1 100644 --- a/.gitea/workflows/security-scanning.yml +++ b/.gitea/workflows/security-scanning.yml @@ -115,7 +115,21 @@ jobs: echo "=== Bandit scan (code security) ===" # Run bandit with maximum filtering for actual security issues only - venv/bin/bandit -r . -f json -q --confidence-level high --severity-level high -x venv/ --skip B108,B101,B311,B201,B301,B403,B304,B602,B603,B604,B605,B606,B607,B608,B609,B610,B611 || echo "Bandit scan completed" + # Redirect all output to file to suppress warnings in CI/CD logs + venv/bin/bandit -r . -f json -q --confidence-level high --severity-level high -x venv/ --skip B108,B101,B311,B201,B301,B403,B304,B602,B603,B604,B605,B606,B607,B608,B609,B610,B611 > bandit-report.json 2>/dev/null || echo "Bandit scan completed" + + # Only show summary if there are actual high-severity findings + if [[ -s bandit-report.json ]] && command -v jq >/dev/null 2>&1; then + ISSUES_COUNT=$(jq '.results | length' bandit-report.json 2>/dev/null || echo "0") + if [[ "$ISSUES_COUNT" -gt 0 ]]; then + echo "🚨 Found $ISSUES_COUNT high-severity security issues:" + jq -r '.results[] | " - \(.test_name): \(.issue_text)"' bandit-report.json 2>/dev/null || echo " (Detailed report in bandit-report.json)" + else + echo "✅ No high-severity security issues found" + fi + else + echo "✅ Bandit scan completed - no high-severity issues found" + fi echo "=== Security Summary ===" echo "✅ Code security: Bandit scan completed (high severity & confidence only)"