Skip to main content

Job Execution

Scan jobs are the core workflow of RedactedWorld. The platform supports two execution modes: on-demand real-time scans with live terminal output, and scheduled scans that run automatically on a cron cadence.

On-Demand Real-Time Scan Flow

When a user clicks "Start Scan" in the UI, the following sequence executes. The key feature is live terminal output -- the user sees scan tool output in real time, as if they were running the tool locally.

Key Design Decisions

Kubernetes Jobs over long-running workers: Each scan runs in a fresh, isolated pod. This provides process-level isolation, prevents resource leaks, and enables per-scan resource limits (CPU, memory, network).

NATS as the streaming backbone: Scan output is published line-by-line to NATS subjects keyed by scan ID. This decouples the Job pod from the WebSocket connection -- if the user disconnects and reconnects, they can resume the stream from the last received sequence number using JetStream replay.

WebSocket for last-mile delivery: The API Gateway maintains a WebSocket connection per client session. When a scan starts, the gateway subscribes to the corresponding NATS subject and forwards chunks to the browser. The Angular frontend renders them in an xterm.js terminal emulator.

Scheduled Scan Flow

Users can configure recurring scans that run automatically. The scan-service manages scheduling internally using a cron-based system.

Schedule Configuration

Users configure schedules through the UI or API:

FieldDescriptionExample
domainTarget domain (must be verified)example.com
toolScan tool to usenmap
profileTool-specific scan profilestandard
cronCron expression for scheduling0 2 * * 1 (Monday at 02:00 UTC)
notifyNotification preferenceon_findings / always / never
enabledWhether the schedule is activetrue

Differences from On-Demand Scans

AspectOn-DemandScheduled
TriggerUser clicks "Start Scan"Cron scheduler in scan-service
Live outputYes, streamed via WebSocketNo (results available after completion)
NotificationIn-app onlyEmail + in-app based on user preference
ConcurrencyOne scan per user per domainUp to 3 concurrent scheduled scans per organization
Timeout30 minutes (configurable per tool)Same

Resource Limits

Each scan Job pod has resource limits to prevent runaway processes:

ToolCPU RequestCPU LimitMemory RequestMemory LimitTimeout
nmap250m1000m256Mi1Gi30 min
ZAP500m2000m512Mi2Gi60 min
sslyze100m500m128Mi512Mi10 min
DNS Recon100m500m128Mi512Mi15 min