Fix ZAP baseline scan workflow failure#3186
Conversation
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughRemoved Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 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)
952-967: Consider standardizing ZAP configuration across environments.The production ZAP baseline scan (lines 952-959) explicitly sets
cmd_options: '-a -r zap-report.html'to generate a custom report filename, and the upload path at line 966 matches this filename. However, the staging configuration (lines 604-626) uses the default behavior withoutcmd_options, relying on the default output filenamereport_html.html.For maintainability and consistency, consider:
- Removing
cmd_optionsfrom the production scan (line 959) and updating the upload path toreport_html.html(line 966) to match the staging approach, OR- Adding explicit
cmd_optionsto the staging scan to match the production approachThe current inconsistency between environments could lead to confusion or future issues.
🔎 Option 1: Standardize to default behavior (recommended for simplicity)
- name: Run ZAP Baseline Scan uses: zaproxy/action-baseline@de8ad967d3548d44ef623df22cf95c3b0baf8b25 with: token: ${{ secrets.GITHUB_TOKEN }} target: 'https://nest.owasp.org' allow_issue_writing: false fail_action: false - cmd_options: '-a -r zap-report.html' - name: Upload ZAP report if: always() uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f with: name: zap-baseline-scan-report-${{ github.run_id }} - path: zap-report.html + path: report_html.html
📜 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 (2)
.github/workflows/run-ci-cd.yaml (2)
267-267: AI summary contains inaccuracies regarding job structure.The AI summary incorrectly states that the job was renamed from
build-staging-imagestobuild-production-images. Both jobs exist as separate entities serving different environments (staging at line 267, production at line 628). Additionally, the AI summary describes several production ZAP scan changes (target URL change, removed cmd_options, changed artifact path), but these changes are not marked in the provided code with~markers, suggesting an inconsistency between the summary and actual changes.Also applies to: 628-628
625-625: The artifact pathreport_html.htmlis correct.The staging ZAP baseline scan (lines 612-618) runs without custom
cmd_options, so it uses the default report generation. ZAP baseline action generatesreport_html.htmlby default for HTML reports, making the artifact path change correct.
|
|
Closing in favor of #3198 |



Proposed change
Fixes the ZAP baseline scan workflow so the generated report is uploaded correctly and the ci job completes successfully
Resolves #3183
Checklist
make check-testlocally and all tests passed