Repository navigation
feat(serve): accept an explicit target list in POST /run - #2
Merged
Merged
Conversation
A request may now carry `targets`, the CLI's --targets: the run scans exactly those hosts, `domain` becomes an optional label, and the report says `run.input: targets` with no source queried. The list goes through enumerate.LoadTargets, the loader the CLI uses, before the run takes the instance: a host with a scheme, path or port, or an empty list, is a 400 and nothing is scanned. Exclusions still add to the deployment's and apply to the list. A list configured on the deployment no longer runs in place of, or merged into, the request's. The body cap goes from 64 KiB to 1 MiB so a list fits; past it the request is refused, never truncated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
POST /rungains atargetsfield: the same "scan a known list" mode the CLI has with--targets/--targets-file/--targets-url. This is what Recon needs to periodically verify known hosts throughfastrecon serve.Example request body:
{ "targets": ["api.example.com", "www.example.com", "shop.example.net"], "exclude": ["staging.example.com"], "stages": "resolve", "ports": "80,443,8080,8443", "timeout": "30m" }targets,domainis an optional report label (like-din CLI targets mode).run.inputistargets,sourcesis empty, andstats.enumeratedcounts the list. Withouttargets,domainstays required.enumerate.LoadTargets, the CLI's own loader, inrunConfig— so it is checked before the run takes the instance. A host with a scheme, path or port, a single label, or an empty list ("targets": []) answers400and nothing is scanned. No second validator.excludestill only adds to the deployment's exclusions, and both apply to the list.429, no caller-supplied webhook, credentials from the environment only.Behaviour changes to note
400, never truncated.FASTRECON_TARGETS*) is now cleared per request: the request says what to scan. Before, adomainrequest on such a deployment would have scanned the deployment's list instead.Tests
app.Appbehind the handler: a targets request returnsrun.input == "targets", no sources, the list normalized, and both the deployment's and the request's exclusions remove matching targets.400without reaching the pipeline.make lint testpasses.Docs:
docs/04-deployment.md(field table and example),docs/01-usage.md,docs/05-design.md.🤖 Generated with Claude Code