Skip to content

Latest commit

 

History

History
127 lines (96 loc) · 6.17 KB

File metadata and controls

127 lines (96 loc) · 6.17 KB

CI/CD Pipeline Security Fix - Continue-on-Error Corrections

Summary

Fixed 12 instances of continue-on-error: true in .github/workflows/ci.yml that were allowing failing checks to pass downstream deployment gates. All critical pipeline stages now properly halt on failures.

Changes Made

Security Job

Step Before After Impact
Run root npm audit for high vulnerabilities continue-on-error: true continue-on-error: false Blocks on dependency vulnerabilities
Run root Snyk test for high vulnerabilities continue-on-error: true continue-on-error: false Blocks on security scan failures
Run bridge-starter-node npm audit continue-on-error: true continue-on-error: false Blocks on bridge dependency vulnerabilities
Run bridge-starter-node Snyk test continue-on-error: true continue-on-error: false Blocks on bridge security scan failures

Test Job

Step Before After Impact
Run database migrations continue-on-error: true continue-on-error: false Blocks if migrations fail
Run linter continue-on-error: true continue-on-error: false Blocks on code style violations
Run tests with coverage continue-on-error: true continue-on-error: false Blocks on unit test failures
Build for E2E continue-on-error: true continue-on-error: false Blocks if E2E build fails
Wait for server to be ready continue-on-error: true continue-on-error: false Blocks if server startup fails
Run Playwright e2e tests continue-on-error: true continue-on-error: false Blocks on E2E test failures

Build Job

Step Before After Impact
Build continue-on-error: true continue-on-error: false Blocks on build failures
Check build artifacts continue-on-error: true continue-on-error: false Blocks if build artifacts missing

Acceptance Criteria Status

Failed unit tests immediately halt the CI pipeline

  • Run tests with coverage now has continue-on-error: false
  • Any test failure will cause the job to fail
  • Job failure blocks downstream build and docker jobs

Standard security scan failures block downstream deployments

  • Run root npm audit has continue-on-error: false
  • Run root Snyk test has continue-on-error: false
  • Run bridge-starter-node npm audit has continue-on-error: false
  • Run bridge-starter-node Snyk test has continue-on-error: false
  • The test and build jobs depend on security job
  • Security failures prevent progression to build and deployment

Pipeline Execution Flow

┌─────────────────────────────────────────────────────────────┐
│                     GitHub Actions CI                       │
└─────────────────────────────────────────────────────────────┘
         │
         ├─→ [SECURITY JOB] ✅ BLOCKING
         │   ├─ npm audit (high) — FAIL → STOP
         │   ├─ Snyk scan (high)  — FAIL → STOP
         │   └─ (bridge checks)   — FAIL → STOP
         │
         ├─→ [TEST JOB] ✅ BLOCKING
         │   ├─ Linting         — FAIL → STOP
         │   ├─ Unit Tests      — FAIL → STOP ← PRIMARY FIX
         │   ├─ Build for E2E   — FAIL → STOP
         │   └─ E2E Tests       — FAIL → STOP
         │
         ├─→ [BUILD JOB] ✅ BLOCKING
         │   ├─ Build           — FAIL → STOP
         │   └─ Artifacts Check — FAIL → STOP
         │
         └─→ [DOCKER JOB] (optional)
             └─ Only runs if secrets configured
                 Only runs on main branch push
                 Blocked by failures upstream

Verification

All checks can be verified with:

grep -n "continue-on-error" .github/workflows/ci.yml

Expected output: 12 lines with continue-on-error: false

# Before (VULNERABLE)
grep "continue-on-error: true" .github/workflows/ci.yml  # Returns 12 matches

# After (SECURED)
grep "continue-on-error: false" .github/workflows/ci.yml  # Returns 12 matches
grep "continue-on-error: true" .github/workflows/ci.yml   # Returns 0 matches

Security Implications

Before (Vulnerable)

  • ❌ Test failures would not block pull requests
  • ❌ Linting failures would not block deployments
  • ❌ Security scan failures would pass through
  • ❌ Build failures would progress to Docker build
  • ❌ Broken builds could reach production

After (Secured)

  • ✅ All test failures halt the pipeline
  • ✅ All linting failures halt the pipeline
  • ✅ All security scan failures halt the pipeline
  • ✅ All build failures halt the pipeline
  • ✅ No broken code reaches production through CI gate

Files Modified

  • .github/workflows/ci.yml - 12 changes across security, test, and build jobs

Notes

  • Docker build job remains optional (only runs on main branch push with proper secrets)
  • Slack notification job still respects always() condition for failure reporting
  • All changes maintain backward compatibility with existing workflow structure
  • No code changes required - purely workflow configuration security fix