mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-19 23:01:29 +02:00
A scan no longer needs a saved engine. The launch dialog has two configuration modes: Scan Engine (default, runs a saved engine exactly as configured, shown as a pipeline and its YAML) and Custom Scan (pick the capabilities to run; dependent and supporting stages are included automatically). Targets are created on launch from typed values, the scan context is a first-class field, and "Run again" restores the engine or the selection that ran. Backend - scans.engine_id is nullable; an absent engine resolves through AdHocEngine and the run is named after its capabilities (plan_label) - ScanCreate/ScanBatchCreate accept target_value(s) (create or reuse via TargetService.ensure_targets), a per-run intensity, and preview works for a target that does not exist yet - every stage declares consumes/produces (AssetKind), group (StageGroup) and role (capability | support); the registry validates them and the catalog serves them with groups and seed_produces - stage_effects walks levels so a producer only feeds later levels and marks an unfed consumer skipped_no_input Frontend - components/scans/launch/: launch-dialog, launch-state, target-picker, plan-picker (segmented Scan Engine | Custom Scan, pipeline + YAML Config views, capability pills with full per-stage settings), stage-pill, stage-config-popover, launch-summary + what-runs, launch-context-field, launch-context-form, save-engine-dialog - utilities/launch-plan.ts resolves implied producers and following support stages; the last engine and last custom selection persist - quick-scan-fields offers presets and engines in one select; the command palette offers "Scan <value>"; scan list action is "Run again" - effect-panel drops its explanatory header; NO_CONTEXT_LABEL is "No scan context"; launch-modal and execution-preview are removed Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014erb6Jbm6v9sxPgYFBxB7E
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from shared.enums.scan import AssetKind, Intensity, StageGroup
|
|
from shared.enums.target import TargetType
|
|
|
|
DEFAULT_LAUNCH_INTENSITY = Intensity.NORMAL.value
|
|
QUICK_SCAN_LABEL = "Quick scan"
|
|
MAX_LABEL_STAGES = 3
|
|
|
|
STAGE_GROUP_LABELS: dict[str, str] = {
|
|
StageGroup.HOSTS.value: "Hosts",
|
|
StageGroup.ADDRESSES.value: "Addresses",
|
|
StageGroup.SERVICES.value: "Services",
|
|
StageGroup.WEB.value: "Web",
|
|
StageGroup.ENDPOINTS.value: "Endpoints",
|
|
StageGroup.VULNERABILITIES.value: "Vulnerabilities",
|
|
}
|
|
|
|
ASSET_KIND_LABELS: dict[str, str] = {
|
|
AssetKind.HOSTS.value: "hosts",
|
|
AssetKind.ADDRESSES.value: "addresses",
|
|
AssetKind.PORTS.value: "open ports",
|
|
AssetKind.HTTP_ASSETS.value: "HTTP assets",
|
|
AssetKind.ENDPOINTS.value: "endpoints",
|
|
AssetKind.VULNERABILITIES.value: "findings",
|
|
}
|
|
|
|
# asset kinds the seed itself supplies before any stage runs
|
|
SEED_PRODUCES: dict[str, frozenset[str]] = {
|
|
TargetType.URL.value: frozenset({AssetKind.HOSTS.value}),
|
|
}
|
|
|
|
|
|
def seed_produces(target_type: str) -> frozenset[str]:
|
|
return SEED_PRODUCES.get(target_type, frozenset())
|