veko doc
Self-Contained API Reference • Gradual Types • Capabilities • Wasm Sandbox

sec/dast

lib/sec/dast.vk

lib/sec/dast.vk Pure-Veko Dynamic Application Security Testing (DAST) runner supporting: - Mode 1 (scan-url): Live HTTP/HTTPS probing with non-loopback ownership guardrail, rate-limit (rps) pacing, request caps (max_requests), and cumulative timeout_ms. - Mode 2 (scan-web-app): Zero-socket in-process CI probing against web/App via web/handle-request. Zero top-level mut heap globals (RT-GLOBALS safe).

DastOpts struct
signature
DastOpts = struct { target_url str = ..., routes block[str] = ..., openapi_path str = ..., auth_bearer_env str = ..., cookie_env str = ..., profile enum = ..., rps i64 = ..., max_requests i64 = ..., timeout_ms i64 = ..., i_own_this_target bool = ..., fail_on enum = ... }

Execution configuration for scan-url and scan-web-app.

DastReport struct
signature
DastReport = struct { mode str, target str, requests_sent i64, duration_ms i64, findings block[sarif/Finding], summary map }

Aggregate DAST scan result across live HTTP/HTTPS or in-process web/App execution.

signature
is-loopback-url? = fn [u str] bool

Returns true when u targets a loopback host (localhost, 127.0.0.1, ::1, or [::1]).

load-routes-file fn caps: .fs
signature
load-routes-file = fn [path str] block[str]

Reads non-empty, non-# route lines starting with '/' from path, normalizing parameterized segments.

load-openapi-routes fn caps: .fs
signature
load-openapi-routes = fn [path str] block[str]

Reads an OpenAPI JSON file from path and extracts normalized paths routes (e.g., /users/{id} -> /users/1).

scan-url fn caps: .clocks
signature
scan-url = fn [opts DastOpts] DastReport

Mode 1: Scans a live HTTP/HTTPS target (opts.target_url) with loopback/ownership guardrails, RPS pacing, and budget limits.

scan-web-app fn caps: .clocks
signature
scan-web-app = fn [app web/App, opts DastOpts] DastReport

Mode 2: Zero-socket in-process CI DAST scan dispatching probes directly through web/handle-request.