ci: add ZAP Baseline Scan to CI/CD pipeline#3172
Conversation
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughAdds a new CI job Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/run-ci-cd.yaml (1)
571-594: Well-implemented ZAP baseline scan with minor suggestions.The implementation correctly follows the PR objectives: runs after staging deployment, is non-blocking, and uploads reports for review. The configuration with
fail_action: falseandallow_issue_writing: falseis appropriate for initial iteration.Consider these improvements for consistency with other staging jobs:
- Add
environment: stagingdeclaration (other staging jobs likedeploy-staging-nestandbuild-staging-imagesinclude this at lines 270, 425, 542)- Add
timeout-minutes: 10or similar to prevent indefinite hangs🔎 Suggested improvements for consistency
zap-baseline-scan: name: ZAP Baseline Scan + environment: staging + if: | + github.repository == 'OWASP/Nest' && + github.ref == 'refs/heads/main' needs: - deploy-staging-nest-proxy permissions: contents: read runs-on: ubuntu-latest steps: - name: Run ZAP Baseline Scan uses: zaproxy/action-baseline@v0.15.0 with: token: ${{ secrets.GITHUB_TOKEN }} target: 'https://nest.owasp.dev' allow_issue_writing: false fail_action: false cmd_options: '-a -r zap-report.html' - name: Upload ZAP report if: always() uses: actions/upload-artifact@v4 with: name: zap-baseline-scan-report-${{ github.run_id }} path: zap-report.html + timeout-minutes: 15
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/run-ci-cd.yaml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-21T19:03:59.068Z
Learnt from: ahmedxgouda
Repo: OWASP/Nest PR: 1139
File: .github/workflows/setup-backend-environment/action.yaml:16-27
Timestamp: 2025-12-21T19:03:59.068Z
Learning: Composite actions (runs: using: composite) execute as steps within the calling job's context and can access the job context, including job.services.* properties (e.g., job.services.<service_id>.id, job.services.<service_id>.ports). Service containers must be defined at the job level, but a composite action's steps can reference them via the job context.
Applied to files:
.github/workflows/run-ci-cd.yaml
🔇 Additional comments (1)
.github/workflows/run-ci-cd.yaml (1)
580-580: No action required — v0.15.0 is the latest stable version.The zaproxy/action-baseline version in use is current with no known security advisories. Standard security practices apply: ensure you have permission to scan target URLs and use GitHub Secrets for sensitive data rather than storing them in repository files.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/run-ci-cd.yaml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-21T19:03:59.068Z
Learnt from: ahmedxgouda
Repo: OWASP/Nest PR: 1139
File: .github/workflows/setup-backend-environment/action.yaml:16-27
Timestamp: 2025-12-21T19:03:59.068Z
Learning: Composite actions (runs: using: composite) execute as steps within the calling job's context and can access the job context, including job.services.* properties (e.g., job.services.<service_id>.id, job.services.<service_id>.ports). Service containers must be defined at the job level, but a composite action's steps can reference them via the job context.
Applied to files:
.github/workflows/run-ci-cd.yaml
|
Hii @arkid15r I initially used zaproxy/action-baseline@v0.15.0 (i.e latest version), but Sonar failed the Quality Gate since it requires GitHub Actions to be pinned to a full commit SHA. I updated it to the SHA corresponding to v0.15.0, which resolved the Sonar warning. However, CodeRabbit is now suggesting reverting back to the version tag. Could you please advise which approach you’d prefer for OWASP Nest? CodeRabbit also suggested adding a timeout-minutes to the ZAP Baseline Scan job to align with other jobs and avoid potential hangs. If so, what timeout would you recommend? If any other changes are needed, please let me know -- I’ll update them accordingly. Thanks!! |
|
arkid15r
left a comment
There was a problem hiding this comment.
I'm wondering why it's that hard to follow the guidelines and run code quality checks locally 🤷♂️
|
@arkid15r I'm really sorry about that -- I did run the checks locally and they passed at the time. The issue was around the version tag vs commit SHA usage. After seeing your update and how it was handled in the workflow, I understood the preferred approach. Thanks for the guidance !!! and will try my best to contribute effectively and better to OWASP Nest !! |
63b9a56#diff-a280dcee078c7a8e6a03991e799754b56572bbde31aceb69c9a5bd3faef378dcR297 |
@arkid15r ohh, about this -- apologies from my side !!!, actually that mistake happened after commiting correct quality code in github and then after editing the file directly on GitHub which i bymistakely deleted that blank line, but i ensure that from now onwards i will take care of this things and always run code quality checks locally before every commit !!! -- inconvenience regretted |



Proposed change
Resolves #3154
This PR adds ZAP Baseline Scan to the CI/CD pipeline to introduce automated security scanning for the Nest application.
The scan runs against the staging environment after deployment and performs a passive security analysis.
For the initial iteration, the scan is configured as non-blocking to avoid disrupting the pipeline while findings are reviewed.
Implementation follows the official ZAP Baseline Scan documentation:
Checklist
make check-testlocally and all tests passed