Conversation
|
|
Quality Gate failed on auto-generated code |
|
I generated the file using flex -V./configure --enable-parser-generation |
There was a problem hiding this comment.
Pull request overview
This PR fixes SecLang directive argument extraction for SecComponentSignature, SecServerSignature, and SecWebAppId so their values are parsed consistently (notably for quoted values), addressing the parsing issue reported in ModSecurity-nginx#365.
Changes:
- Update SecLang scanner rules to extract directive arguments via
find_separator(yytext)and sanitize them withparserSanitizer(...)(instead of usingstrchr(...)+2for some directives). - Add a regression test validating that
SecComponentSignatureis emitted correctly in the JSON audit logcomponentsarray.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/test-cases/regression/auditlog.json | Adds a regression test ensuring SecComponentSignature is serialized correctly in JSON audit logs. |
| src/parser/seclang-scanner.ll | Updates lexer rules for SecComponentSignature, SecServerSignature, and SecWebAppId to use separator finding + sanitization for argument parsing. |
| src/parser/seclang-scanner.cc | Regenerated scanner output reflecting the .ll changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe lexer now skips consecutive spaces and tabs when extracting directive values and sanitizes signature-related values. Regression tests cover JSON audit output and tab-separated ChangesDirective signature parsing
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to The lexer and generated scanner changes are aligned, with regression coverage for the affected component-signature and WEBAPPID parsing paths. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|





Fix: owasp-modsecurity/ModSecurity-nginx#365
Summary by CodeRabbit
Bug Fixes
Tests