Files
rengine/shared/services/focused.py
T
Yogesh OjhaandClaude Fable 5.1 db030d733c feat(bounty-hub): watch a program
Scope-true continuous discovery for a bounty program, bug bounty mode only
(capability `program_watches`).

Watching a program imports its in-scope targets under the program's
organization, writes out-of-scope entries as exclusions and the rate ceiling
on a `Watch · <program>` scan context, schedules an optional baseline, and
streams certificate transparency for the watched apexes. A new in-scope host
is resolved, written into the covering scan with source `ct_log`, probed by a
focused run with a screenshot, evaluated against the watch's alert query and
alerted once per fingerprint through the chosen channels.

- ct-stream compose service: certspotter 0.24.2 under a supervisor that
  regenerates the watchlist from active watches, spools events through a
  hook script that emits only certspotter fields, and reports over Redis
- worker tasks: certificate, settle, recheck, reconcile; finalize dispatches
  settle for any probe run; reconcile after every program or feed sync
- notifier: named channels bypass per-channel preferences; attachments;
  new `watch` notification type
- API under /bounty-programs/watches with preview, ledger, events, marks
- Bounty Hub: Watching tab, Watch dialog, watch sheet, program badge,
  certificate stream card in Settings
- schedules carry an intensity; scan_schedules.intensity

Two review rounds folded in: compare-and-set probe claim, resolver-down
handling, spool kept on failed dispatch, schedule cap, mute keeps prior
state, ledger-derived totals, event filters, mode lockout of worker and
stream in corporate mode.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ba2f7gwu2GXiETCKqRztyB
2026-09-12 21:51:18 +05:30

27 lines
792 B
Python

"""Stage overrides for a focused run."""
from __future__ import annotations
from shared.enums.scan import Phase, StageRole
_DISCOVERY = Phase.DISCOVERY.value
def focused_overrides(picked: list[str] | tuple[str, ...]) -> dict:
"""Disable every stage that enumerates the target."""
from stages.registry import stage_by_name # noqa: PLC0415
known = stage_by_name()
overrides = {
name: {"enabled": False}
for name, spec in known.items()
if not spec.catalog_hidden
and (
spec.role == StageRole.CAPABILITY.value
or (not spec.consumes and (spec.produces or spec.phase == _DISCOVERY))
)
}
for name in picked:
overrides[name] = {**(overrides.get(name) or {}), "enabled": True}
return overrides