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

sec/sast

lib/sec/sast.vk

lib/sec/sast.vk Pure-Veko Static Application Security Testing (SAST) engine, federal/FIPS policy checker, manifest capability & lockfile auditor, and SARIF-backed workspace scanner. Zero top-level mut heap globals (RT-GLOBALS safe) and zero src/* imports.

SastOpts struct
signature
SastOpts = struct { profile enum = ..., fips bool = ..., strict_caps bool = ..., excludes block[str] = ..., baseline_path str = ..., fail_on enum = ... }

Configuration options for sast/scan-source, sast/scan-manifest, sast/scan-file, and sast/scan-dir.

signature
effective-fips? = fn [opts SastOpts] bool

Returns true when FIPS 140-3 / CNSA 2.0 rules should be enforced (opts.fips or opts.profile == .federal).

SastReport struct
signature
SastReport = struct { files_scanned i64, findings block[sarif/Finding], suppressed_count i64, summary map }

Aggregate SAST scan result across one file or workspace directory.

signature
scan-source = fn [file_path str, src str, opts SastOpts] block[sarif/Finding]

Scans a single Veko source string src (associated with file_path) and returns unsuppressed findings.

scan-manifest fn caps: .fs
signature
scan-manifest = fn [project_dir str, used_caps map, opts SastOpts] block[sarif/Finding]

Audits <project_dir>/veko.vk and veko.lock for over-privileged capabilities (VKSEC010) and unpinned/untrusted dependencies (VKSEC015).

scan-file fn caps: .fs
signature
scan-file = fn [file_path str, opts SastOpts] SastReport

Scans a single .vk source file or veko.vk manifest and returns a SastReport.

scan-dir fn caps: .fs
signature
scan-dir = fn [target_path str, opts SastOpts] SastReport

Recursively scans all .vk files and veko.vk inside target_path (or delegates to scan-file if target_path is a file).