Skip to content

Add distributed execution support via Redis #5

@shift

Description

@shift

Problem

Currently, vulnz runs providers sequentially or with goroutine-based parallelism on a single machine. For large-scale deployments (e.g., enterprise vulnerability management pipelines), distributed execution across multiple workers would enable:

  • Horizontal scaling of provider runs
  • Resilience against single-node failures
  • Load balancing across geographic regions

Proposed Solution

Implement distributed execution using Redis as the coordination layer:

Architecture

  1. Task Queue: Redis list/streams for provider execution tasks
  2. Worker Pool: Multiple vulnz instances consuming from the queue
  3. Result Aggregation: Centralized storage (S3, PostgreSQL, or shared NFS)
  4. Status Tracking: Redis hashes for task state (pending, running, completed, failed)

Key Components

  • internal/distributed/ - New package for distributed execution
  • internal/distributed/queue.go - Redis queue implementation
  • internal/distributed/worker.go - Worker goroutine consuming tasks
  • internal/distributed/coordinator.go - Task distribution and result collection

Configuration

executor:
  mode: distributed
  distributed:
    redis_url: "redis://localhost:6379/0"
    worker_id: "worker-1"
    result_store: "s3"
    s3:
      bucket: "vulnz-results"
      region: "eu-west-1"

Acceptance Criteria

  • Redis queue implementation for task distribution
  • Worker mode that consumes and executes providers
  • Result aggregation to centralized storage
  • Status tracking visible via vulnz status command
  • Graceful shutdown and task re-queueing on worker failure
  • Tests with Redis testcontainers or mock

Additional Context

This is a larger feature that would significantly enhance vulnz for enterprise deployments. The single-machine executor (internal/provider/executor.go) should remain as the default mode.

Labels: enhancement, help wanted

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions