mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-21 07:41:28 +02:00
- Added new definitions for dashboard windows and stale target management. - Expanded domain definitions to include additional public second-level domains. - Created rescan models and logic to handle asset rechecks based on previous scan results. - Implemented new scan scopes (FULL and FOCUSED) to differentiate between complete scans and focused rescans. - Developed asset seed stage to initiate scans from previously identified assets. - Enhanced scan factory and resolution services to support new scanning configurations and seed assets. - Updated existing scan models and services to accommodate new features and ensure compatibility. - Added logging and error handling for focused rescans during scan finalization.
99 lines
2.1 KiB
Python
99 lines
2.1 KiB
Python
from enum import Enum
|
|
|
|
|
|
class ScanStatus(Enum):
|
|
PENDING = "pending"
|
|
RUNNING = "running"
|
|
COMPLETED = "completed"
|
|
FAILED = "failed"
|
|
CANCELLED = "cancelled"
|
|
|
|
|
|
class ScanScope(Enum):
|
|
FULL = "full"
|
|
FOCUSED = "focused"
|
|
|
|
|
|
class ScanActivityStatus(Enum):
|
|
PENDING = "pending"
|
|
RUNNING = "running"
|
|
SUCCESS = "success"
|
|
PARTIAL = "partial"
|
|
FAILED = "failed"
|
|
SKIPPED = "skipped"
|
|
ABORTED = "aborted"
|
|
|
|
|
|
SCAN_LIVE_STATUSES = (ScanStatus.PENDING.value, ScanStatus.RUNNING.value)
|
|
SCAN_TERMINAL_STATUSES = (
|
|
ScanStatus.COMPLETED.value,
|
|
ScanStatus.FAILED.value,
|
|
ScanStatus.CANCELLED.value,
|
|
)
|
|
ACTIVITY_TERMINAL_STATUSES = (
|
|
ScanActivityStatus.SUCCESS.value,
|
|
ScanActivityStatus.PARTIAL.value,
|
|
ScanActivityStatus.FAILED.value,
|
|
ScanActivityStatus.SKIPPED.value,
|
|
ScanActivityStatus.ABORTED.value,
|
|
)
|
|
|
|
|
|
class Intensity(Enum):
|
|
PASSIVE = "passive"
|
|
NORMAL = "normal"
|
|
AGGRESSIVE = "aggressive"
|
|
|
|
|
|
INTENSITIES = tuple(i.value for i in Intensity)
|
|
|
|
|
|
class Phase(Enum):
|
|
DISCOVERY = "discovery"
|
|
EXPANSION = "expansion"
|
|
DEPTH = "depth"
|
|
FINALIZE = "finalize"
|
|
|
|
|
|
PHASE_ORDER: dict[str, int] = {
|
|
Phase.DISCOVERY.value: 0,
|
|
Phase.EXPANSION.value: 1,
|
|
Phase.DEPTH.value: 2,
|
|
Phase.FINALIZE.value: 3,
|
|
}
|
|
|
|
|
|
class AssetKind(Enum):
|
|
HOSTS = "hosts"
|
|
ADDRESSES = "addresses"
|
|
PORTS = "ports"
|
|
HTTP_ASSETS = "http_assets"
|
|
ENDPOINTS = "endpoints"
|
|
VULNERABILITIES = "vulnerabilities"
|
|
|
|
|
|
class StageRole(Enum):
|
|
CAPABILITY = "capability"
|
|
SUPPORT = "support"
|
|
|
|
|
|
class StageGroup(Enum):
|
|
HOSTS = "hosts"
|
|
ADDRESSES = "addresses"
|
|
SERVICES = "services"
|
|
WEB = "web"
|
|
ENDPOINTS = "endpoints"
|
|
VULNERABILITIES = "vulnerabilities"
|
|
|
|
|
|
class ScanEventKind(Enum):
|
|
SCAN_STARTED = "scan_started"
|
|
SCAN_COMPLETED = "scan_completed"
|
|
SCAN_FAILED = "scan_failed"
|
|
SCAN_CANCELLED = "scan_cancelled"
|
|
STAGE_STARTED = "stage_started"
|
|
STAGE_PROGRESS = "stage_progress"
|
|
STAGE_COMPLETED = "stage_completed"
|
|
COMMAND_STARTED = "command_started"
|
|
COMMAND_FINISHED = "command_finished"
|