feat(api_discover): hand off discovered OpenAPI specs to nuclei#1269
Merged
Conversation
When api_discover finds an exposed OpenAPI/Swagger spec, the new --spec option routes it to nuclei with input-mode=openapi + DAST fuzzing, which parses the spec and fuzzes every documented endpoint with the correct method/parameters. This recovers the contextual API testing kiterunner used to provide, using a maintained tool already integrated in secator (no new dependency). - nuclei task: add a `dast` flag (-dast) to enable fuzzing templates. - api_discover.yaml: add --spec option and a nuclei step targeting discovered spec URLs (openapi/swagger/api-docs), gated behind --spec. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the OpenAPI-spec handoff to
api_discover: when discovery finds an exposed OpenAPI/Swagger spec, hand it off to nuclei (already integrated) to parse the spec and DAST-fuzz every documented endpoint.This recovers the contextual API testing that kiterunner used to provide (correct method + parameters per route) — but with a maintained tool already in secator, so no new dependency.
What's included
secator/tasks/nuclei.py— newdastflag (-dast) to enable nuclei's fuzzing templates (required to fuzz OpenAPI endpoints). Defaults to off; no change to existing behavior.secator/configs/workflows/api_discover.yaml— new--specoption and anucleistep that targets discovered spec URLs (openapi/swagger/api-docs) withinput_mode=openapi+dast. Gated behind--spec(off by default), so pure discovery is unchanged.How it works
Typical usage:
secator w api_discover <url> --fuzz --spec(fuzz surfaces the spec, --spec scans it).Design notes
-input-mode openapi, its SpecDownloader fetches a remote spec URL) and DAST fuzzing (-dast). Adding schemathesis/CATS/apifuzzer would either duplicate this or drag in an unmaintained tool / Java runtime — against secator's design principle Fix issue with parsing nmap XML #1.url_crawlgates its optional trufflehog step.Testing
nuclei ... -input-mode openapi -dastemitted correctly.api_discoverloads and builds with--spec(tasks: katana, ffuf, wafw00f, httpx, nuclei).dastflag).flake8 secator/tasks/nuclei.pyclean.🤖 Generated with Claude Code