DSL Engine
Proposed change
This PR introduces DSL (Domain Specific Language) support for service/version extraction in Nettacker. (This work is derived from the DSL PR by Rishi after minor changes) Fixes #1586
Type of change
- [x] New core framework functionality
- [ ] Bugfix (non-breaking change that fixes an issue)
- [ ] Code refactoring without any functionality changes
- [ ] New or existing module/payload change
- [ ] Documentation/localization improvement
- [ ] Test coverage improvement
- [ ] Dependency upgrade
- [ ] Other improvement (best practice, cleanup, optimization, etc)
Checklist
- [x] I've followed the contributing guidelines
- [x] I've digitally signed all my commits in this PR
- [x] I've run
make pre-commitand confirm it didn't generate any warnings/changes - [x] I've run
make testand I confirm all tests passed locally - [x] I've added/updated any relevant documentation in the
docs/folder - [x] I've linked this PR with an open issue
- [x] I've tested and verified that my code works as intended and resolves the issue as described
- [x] I've attached screenshots demonstrating that my code works as intended (if applicable)
- [x] I've checked all other open PRs to avoid submitting duplicate work
- [x] I confirm that the code and comments in this PR are not direct unreviewed outputs of AI
- [x] I confirm that I am the Sole Responsible Author for every line of code, comment, and design decision
[!WARNING]
Review limit reached
@Aarush289, you've reached your PR review limit, so we couldn't start this review.Next review available in: 18 minutes
Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. You're only billed for reviews past your plan's rate limits ($0.25/file).
How can I continue?
After more reviews become available, a review can be triggered using the
@coderabbitai reviewcommand as a PR comment. Alternatively, push new commits to this PR.To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.
How do review limits work?
CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.
For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.
Please refer docs for additional details.
Review details
โ๏ธ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID:
a1931ee9-93d3-4589-868f-0f2354d29a15๐ฅ Commits
Reviewing files that changed from the base of the PR and between 1a5e19999f3b7e9a05a368e6e8f02d19cf112486 and 7d306f818f3474088ffcca49560b026a79ca26f7.
๐ Files selected for processing (1)
nettacker/core/lib/http.py
Walkthrough
Adds a DSLMatcher for version expressions, comparison operators, range matching, and response extraction. Wrapper helpers expose the matcher, HTTP response conditions support version matching from content or headers, and semver is added as a runtime dependency.
Changes
Version DSL Engine and HTTP Integration
| Layer / File(s) | Summary |
|---|---|
Matcher foundation and dependency nettacker/core/utils/dsl_matcher.py, pyproject.toml |
Defines DSLMatcher, normalizes versions, adds the semver dependency, and creates a shared matcher instance. |
DSL evaluation and comparison operators nettacker/core/utils/dsl_matcher.py |
Supports logical connectors, comma-separated conditions, comparisons, semantic operators, ranges, wildcards, and fallback version comparisons. |
CVE ranges and response extraction nettacker/core/utils/dsl_matcher.py |
Matches exact and range-style CVE expressions and extracts versions from response content using regex patterns. |
Helper wrappers and HTTP conditions nettacker/core/utils/common.py, nettacker/core/lib/http.py |
Adds matcher wrappers and integrates version_match and version_dsl response conditions for content and headers. |
Estimated code review effort: 4 (Complex) | ~50 minutes
Suggested reviewers: arkid15r, securestep9
๐ฅ Pre-merge checks | โ 4 | โ 1
โ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | โ ๏ธ Warning | Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
โ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Title check | โ Passed | The title is short and clearly references the DSL engine added in this PR. |
| Description check | โ Passed | The description matches the PR and explains the DSL/version-extraction work. |
| Linked Issues check | โ Passed | The changes implement DSL-based version extraction and scanning, matching issue #1586. |
| Out of Scope Changes check | โ Passed | The changes stay focused on DSL/version matching and a supporting dependency update. |
โจ Finishing Touches
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
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 @coderabbitai help to get the list of available commands.
@codex review