SpectraStrike Documentation

Operational, architecture, SDK, and integration guidance

VectorVue API Client Design (Sprint 4)

SpectraStrike Logo

Goal

Define a secure, testable, and extensible Python API client for delivering SpectraStrike telemetry and findings to VectorVue client and integration APIs.

Scope (Roadmap Alignment)

This design maps to docs/ROADMAP.md Phase 3:

API Surface (VectorVue)

Base URL (local default): https://127.0.0.1

Authentication:

Primary integration endpoints:

Optional client telemetry endpoint:

Response Contract

All SpectraStrike integration endpoints return an envelope with:

Proposed Package Layout

Primary Interfaces

  1. VectorVueConfig
    • base_url: str = "https://127.0.0.1"
    • username: str | None
    • password: str | None
    • tenant_id: str | None
    • token: str | None (optional pre-provisioned token)
    • timeout_seconds: float = 10.0
    • verify_tls: bool = True
    • max_retries: int = 3
    • backoff_seconds: float = 0.5
    • max_batch_size: int = 100
    • signature_secret: str | None
    • require_https: bool = True
  2. VectorVueClient
    • login() -> str
    • send_event(event: dict[str, Any], idempotency_key: str | None = None) -> ResponseEnvelope
    • send_events_batch(events: list[dict[str, Any]]) -> ResponseEnvelope
    • send_finding(finding: dict[str, Any]) -> ResponseEnvelope
    • send_findings_batch(findings: list[dict[str, Any]]) -> ResponseEnvelope
    • get_ingest_status(request_id: str) -> ResponseEnvelope
  3. ResponseEnvelope
    • request_id: str | None
    • status: str
    • data: dict[str, Any] | list[Any] | None
    • errors: list[dict[str, Any]]
    • signature: str | None
    • http_status: int
    • headers: dict[str, str]

Security and Integrity Requirements

  1. Enforce HTTPS base URL when require_https=True.
  2. Use Bearer JWT for all integration/status calls.
  3. Support optional HMAC request signing when signature_secret is configured:
    • X-Timestamp
    • X-Signature
  4. Redact credentials/tokens/signatures in logs.
  5. Preserve tenant isolation guarantees (treat 404 on status lookup as possible cross-tenant protection behavior).

Idempotency and Replay Handling

For POST /events:

Transport and Retry Model

Validation Model

Client-side validation before submit:

Server error model expected:

Logging and Observability

Emit local logs for each outbound request with:

Never log raw token, password, or signature material.

Test Strategy

  1. Unit tests:
    • config validation (https, auth inputs)
    • signing header generation
    • response envelope parsing
    • retry/non-retry matrix
    • idempotency replay/conflict behavior
    • batch-size guard
  2. Integration-style tests (mock transport):
    • success for each endpoint
    • partial failure batch handling
    • ingest status polling parse
    • auth failure and validation failure mapping
  3. QA hooks (Roadmap Sprint 5):
    • smoke script for login + single event + single finding + status poll
    • TLS verification mode test (verify=True / controlled local cert mode)

Implemented QA hooks:

Compatibility