Defense-in-Depth • Zero-JIT W^X • Airgapped Federal AppSec

Security & Federal AppSec Toolchain

Veko treats security as a single coherent stack — from deterministic One Reference Only (ORO) memory safety, type-level .secret taint firewalls, strict W^X No-JIT execution, and NIST Post-Quantum Cryptography up to an airgap-ready, zero-external-scanner SBOM, SAST, DAST, IAST, RASP & Federal ATO Audit toolchain embedded directly inside the single veko executable.

Section 1 • Memory, Taint, Capability & Crypto Guarantees

Built-In Language & Runtime Security

Before any scanner runs, Veko eliminates whole vulnerability classes by construction across its lexer, type checker, ORO ownership model, capability sandbox, and pure-Veko cryptographic stack.

Memory SafetyZero UAF • Zero Double-Free • Zero GC Pauses

One Reference Only (ORO) Deterministic Memory

Every heap value has exactly one owner and is freed deterministically when its lexical scope exits. Read sharing uses Copy-on-Write (CoW), while in-place mutation requires explicit mut at both parameter and call site — including statically checked disjoint field loans like mut conn.tx_buf.

Concurrency & RT-GLOBALS Hygiene: Workers created via spawn are shared-nothing (cannot capture outer mut bindings). Because module-level RT-GLOBALS live outside actor isolation, Veko prohibits top-level mut heap caches (VKSEC011) and routes shared mutable state through typed chan/* actors.

ORO Disjoint Loans & Channel Actor Hygiene
ORO + chan/*
// Deterministic ORO ownership + disjoint mut field loan + actor state
pub append-frame = fn [mut conn ConnState, payload bytes] [
    bytes/push-u32-be mut conn.tx_buf (len payload)   // disjoint field loan
    bytes/append mut conn.tx_buf payload
]   // payload moves or drops deterministically at scope exit

// Never share top-level mut heap globals across OS threads:
// own mutable state inside a dedicated chan/* actor instead.
audit_ch = chan/new 64
spawn [
    mut count = 0
    while true [
        ev = chan/recv/or audit_ch [ break ]
        count = count + 1
    ]
]
Secret HygieneCompile-Time Taint + Volatile Wipe

The .secret Compiler Firewall

Annotating a binding or struct field as secret str or secret bytes activates an information-flow firewall across veko check --strict-types. Secret values cannot cross json/encode, net/*, os/write-file, spawn, or chan/send — and print / mold automatically redact them to <secret>.

Scope-Exit Zeroization: Secret buffers are wiped with volatile memory stores on scope exit and loaded safely via os/getenv/secret/or or desktop GUI d/read-secret without ever entering plain state maps.

.secret Firewall & Safe Credential Loading
secret str / bytes
// .secret Compiler Firewall + volatile zeroization on scope exit
pub ServiceCfg = struct {
    endpoint str,
    bearer   secret str = ''
}

load-cfg = fn [] ServiceCfg [
    tok = os/getenv/secret/or 'VEKO_SERVICE_TOKEN' [ bytes/with-secret 0 ]
    print tok   // prints '<secret>' — never leaks raw bytes to logs/json/net
    ServiceCfg { endpoint = 'https://api.veko-lang.org', bearer = tok }
]
// Desktop GUI passwords use `d/read-secret ctx 'field_id'` -> secret str
Execution IsolationStrict W^X • Least Privilege • Fuel Bounds

No-JIT (W^X) Execution & Capability Sandbox

Veko executes ahead-of-time across its 64-bit VKO VM, WebAssembly 3.0 sandbox, and 8 native machine-code targets with zero runtime JIT code generation — preserving strict W^X page protections on server, desktop, and mobile.

Capabilities, Paths, SSRF & Wasm Bounds: Manifests declare explicit allow-caps = [.fs .clocks .env .net .exec .ffi .ui], filesystem ops enforce canonical path confinement, outbound HTTP supports --no-private-net / --allow-hosts, and untrusted Wasm plugins run under deterministic --fuel= and --mem-pages= budgets.

veko.vk Capability Sandbox & Wasm Fuel Caps
W^X + allow-caps
// veko.vk — least-privilege capability manifest (zero ambient authority)
name = 'ledger-service'
root = 'src/main.vk'
allow-caps = [.fs .clocks .env .net]

// Enforce capability checks + SSRF protection + Wasm 3.0 fuel caps:
//   veko check --strict-types src/main.vk
//   veko run --no-private-net --allow-hosts=api.veko-lang.org src/main.vk
//   veko run --wasm --fuel=5000000 --mem-pages=256 plugin.vk
Post-Quantum & Supply ChainFIPS 203/204/205 • X25519MLKEM768

Post-Quantum Cryptography & Signed Artifacts

Veko implements NIST Post-Quantum standards natively in pure Veko: crypto/mlkem (FIPS 203), crypto/mldsa (FIPS 204), and crypto/slhdsa (FIPS 205), alongside Hybrid TLS 1.3 (X25519MLKEM768) and constant-time AEAD (crypto/aesgcm, crypto/chacha20).

Verifiable Software Supply Chain: Every VKP1 package bundle carries Ed25519 / ML-DSA-65 signatures, leaf SHA-256 hashes, and Merkle roots pinned in veko.lock and verified against trust-keys.json.

Pure-Veko FIPS 203 ML-KEM & Signed Supply Chain
PQC + VKP1
// Post-Quantum Cryptography (FIPS 203/204/205) + Hybrid TLS 1.3
use [mlkem = crypto/mlkem, mldsa = crypto/mldsa, sha = crypto/sha256]

kp = mlkem/keygen 768                 // FIPS 203 ML-KEM-768
enc = mlkem/encaps kp.public_key
shared = mlkem/decaps kp.secret_key enc.ciphertext

// Signed VKP1 packages & SBOM verification:
//   veko pkg add http_router@1.2.0   (Ed25519 / ML-DSA-65 + trust-keys.json)
//   veko sbom --verify --include-stdlib --format=cyclonedx -o dist/sbom.cdx.json
Section 2 • Zero External Scanners • 8 Embedded Stdlib Modules

Pure-Veko AppSec Toolchain (lib/sec/*)

Airgap- and SCIF-ready security engineering with zero JVM, Node.js, Python, Docker, or external scanner binaries. All 8 modules live inside the embedded VKFS standard library.

sec/sbom

Verified SBOM (CycloneDX & SPDX)

Generates CycloneDX 1.5 and SPDX 2.3 JSON documents with optional embedded stdlib VKFS module digests (--include-stdlib), OpenVEX attachment (--vex=), lockfile/Merkle/signature verification (--verify), and ML-DSA-65 artifact signing (--sign-key=).

sec/sast & sec/sast_rules

SAST (VKSEC001–VKSEC018 + VKAUDIT002)

AST/CFG taint & policy analyzer covering hardcoded credentials, unmarked secret fields, SQLi, CMDi, path traversal, SSRF, XSS, weak crypto, plaintext HTTP URLs, over-privileged allow-caps, RT-GLOBALS hazards, discarded errors, unbounded loops/bodies, .ffi calls, floating deps, open redirects, --fips (VKSEC017), and --profile=federal auth failure auditing (VKSEC018), with SARIF 2.1.0 --baseline support.

sec/dast & sec/dast_probes

DAST (VKDAST001–VKDAST012)

Twelve OWASP/NIST HTTP probes checking security headers, cookie flags, CORS, exposed dotfiles, traversal, reflected XSS, SQLi signatures, open redirects, verbose errors/secret disclosure, TRACE, CRLF injection, and 128 KiB unbounded bodies. Runs in Mode 1 (live HTTP/HTTPS via veko dast) or Mode 2 (zero-socket in-process dast/scan-web-app in tests).

sec/iastORO VM Shadow Taint

Interactive Application Security Testing (VKIAST001–VKIAST008)

Instruments the 64-bit VKO VM with per-value shadow taint tags (sql, cmd, path, url, html, redirect, header, secret) tracked dynamically across function calls, concatenations, and collections during veko iast and veko test --iast with full call-stack SARIF reporting.

sec/rasp & sec/sarifCEF & JSONL SIEM • Monitor / Enforce

Runtime Self-Protection (VKRASP001–VKRASP010) & SARIF 2.1.0

Drop-in rasp/middleware and sink guards (rasp/guard-sql, guard-exec, guard-path, guard-url, guard-html, guard-header) detect and block attacks at runtime while emitting CEF / JSONL SIEM events. Use compiler injection (--rasp=monitor|enforce) across VM, Wasm, and native binaries without touching handler code.

Stdlib Module(s)Rule / Artifact CoverageStandards & Compliance MappingExecution / Output
sec/sarifUnified SARIF 2.1.0 schema builder, fingerprint & baseline filterCWE, OWASP Top 10, NIST SP 800-53, EO 14028 SSDFConsumed by GitHub Code Scanning, GitLab & ATO bundles
sec/sbomCycloneDX 1.5, SPDX 2.3, OpenVEX, Merkle/signature verificationNTIA Minimum Elements, EO 14028 Sec. 4(e)Signed JSON + optional `.sig.json` (ML-DSA-65)
sec/sast_rules, sec/sastVKSEC001-VKSEC018 + VKAUDIT002 (taint, caps, FIPS, RT-GLOBALS)IA-5, SI-10, SC-7, SC-13 (FIPS 140-3), AC-6, AU-9Text, JSON, SARIF 2.1.0 (`--profile=federal --fips`)
sec/dast_probes, sec/dastVKDAST001-VKDAST012 (headers, CORS, XSS, SQLi, traversal, CRLF)SC-8, CM-7, AC-3, SI-10, SI-11, SC-5 (SSDF PW.8)Mode 1 live HTTP/S & Mode 2 zero-socket `dast/scan-web-app`
sec/iastVKIAST001-VKIAST008 (VM shadow taint across 8 sink classes)SI-10, IA-5, AU-9 (zero false-positive dynamic taint)`veko iast` & `veko test --iast` (Text / JSON / SARIF)
sec/raspVKRASP001-VKRASP010 (HTTP middleware, SQL/Exec/Path/SSRF/XSS/CRLF)SI-10, SC-7, SI-4 (SIEM CEF / JSONL audit telemetry)Explicit `rasp/*` guards or `--rasp=monitor|enforce` pass
Section 3 • Single-Binary CLI & ATO Evidence Generation

CLI & Compiler Security Reference

Every AppSec command ships inside the self-hosted compiler binary with deterministic exit codes (--fail-on), SARIF 2.1.0 outputs, and a one-command Federal ATO evidence collector.

CommandKey Flags & Safety ControlsPurpose
veko sbom [dir]--format=cyclonedx|spdx --include-stdlib --verify --vex=<p> --sign-key=<p> -o <out>Emit verified CycloneDX 1.5 / SPDX 2.3 SBOMs with optional ML-DSA-65 signature.
veko sast [path]--profile=standard|federal --fips --strict-caps --baseline=<p> --exclude=<g> --format=sarif --fail-on=<sev>Run AST/CFG static analysis, capability audit, and FIPS 140-3 crypto verification.
veko dast <url>--routes=<f> --openapi=<f> --profile=quick|standard|full --auth-bearer=<env:VAR> --cookie=<env:VAR> --i-own-this-targetRun safe, rate-limited (`--rps`, `--max-requests`, `--timeout`) DAST probes. Non-loopback requires `--i-own-this-target`.
veko iast <entry.vk>--format=text|json|sarif -o <out> --fail-on=<sev> (also `veko test --iast`)Execute under ORO VM shadow taint instrumentation across SQL, Exec, Path, URL, HTML, and `.secret` sinks.
veko run / compile--rasp=monitor|enforce [--native|--wasm] [--no-private-net] [--allow-hosts=...]Compiler-inject `sec/rasp` guards into handlers and sinks across VM, Wasm, and native binaries.
veko audit [dir]--profile=federal --fips --strict-caps --iast --dast-url=<url> --sign-key=<p> --out-dir=dist/ato-evidenceOrchestrate SBOM + SAST + IAST + DAST + RASP posture into a SHA-256-manifested Federal ATO evidence folder.
Verified CLI & Compiler Security Commands
veko CLI 1.0
# 1. Supply-chain verification & CycloneDX / SPDX SBOM
veko sbom --verify --include-stdlib --format=cyclonedx -o dist/sbom.cdx.json
veko sbom --verify --format=spdx --sign-key=keys/mldsa65.key -o dist/sbom.spdx.json

# 2. Pure-Veko SAST with Federal + FIPS 140-3 checks & SARIF 2.1.0 output
veko sast --profile=federal --fips --strict-caps --format=sarif -o dist/sast.sarif .

# 3. Safe HTTP/HTTPS DAST (authenticated via env vars, rate-limited)
veko dast http://127.0.0.1:8080 --routes=routes.txt --profile=standard --format=sarif -o dist/dast.sarif
veko dast https://staging.veko-lang.org --openapi=openapi.json --auth-bearer=env:DAST_TOKEN --i-own-this-target

# 4. VM-native IAST shadow taint analysis (standalone or during test suites)
veko iast src/main.vk --format=sarif -o dist/iast.sarif
veko test --iast tests/

# 5. Compiler-injected Runtime Application Self-Protection (RASP)
veko run --rasp=enforce src/main.vk
veko compile --native --rasp=enforce src/main.vk -o dist/server.exe

# 6. End-to-end Federal ATO Evidence Bundle (NIST SP 800-53 / EO 14028 SSDF)
veko audit --profile=federal --fips --strict-caps --iast --include-stdlib --out-dir=dist/ato-evidence
veko audit --profile=federal --out-dir=dist/ato-evidence

Federal ATO Evidence Bundle Contents

Running veko audit with --out-dir=dist/ato-evidence writes a deterministic, auditor-ready package anchored by a SHA-256 integrity manifest:

  • ato_summary.md — Executive summary of scan counts, RASP posture, FIPS mode, and severity totals
  • evidence_manifest.sha256.json — SHA-256 digest & byte-size inventory of every generated evidence file
  • nist_800_53_ssdf_summary.json — Machine-readable NIST SP 800-53 Rev. 5 & EO 14028 SSDF control status
  • rasp_policy.json — Detected server surface, RASP import/middleware posture, and recommended enforcement CLI
  • sast.sarif.json — Full SARIF 2.1.0 static findings (plus dast.sarif.json / iast.sarif.json when enabled)
  • sbom.cdx.json — CycloneDX 1.5 SBOM (with optional ML-DSA-65 sbom.cdx.json.sig.json)
  • sbom.spdx.json — SPDX 2.3 SBOM for cross-tool federal procurement workflows
Read Security Chapter (Reference Book)Read AppSec Recipes (Cookbook)
Section 4 • Copy-Ready DevSecOps & Offline Evidence

CI/CD & Federal ATO Pipelines

Drop these verified workflows directly into GitHub Actions, GitLab CI, or airgapped SCIF build environments with zero third-party scanner dependencies.

GitHub Actions — SARIF + SBOM + IAST
.github/workflows/veko-appsec.yml
name: Veko Federal AppSec
on: [push, pull_request]
permissions:
  contents: read
  security-events: write
jobs:
  appsec:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Veko SDK
        run: curl -fsSL https://veko-lang.org/install.sh | sh
      - name: Strict Type, ORO & .secret Firewall Check
        run: veko check --strict-types src/main.vk
      - name: Pure-Veko SAST (Federal + FIPS 140-3)
        run: veko sast --profile=federal --fips --strict-caps --format=sarif -o dist/sast.sarif .
      - name: Upload SARIF to GitHub Code Scanning
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: dist/sast.sarif
      - name: Generate Verified CycloneDX 1.5 SBOM
        run: veko sbom --verify --include-stdlib --format=cyclonedx -o dist/sbom.cdx.json
      - name: Run Unit Tests + ORO VM IAST Taint Analysis
        run: veko test --iast --coverage=dist/cov.html tests/
GitLab CI — Federal ATO Gate
.gitlab-ci.yml
veko_federal_gate:
  stage: test
  script:
    - veko check --strict-types src/main.vk
    - >
      veko audit --profile=federal --fips --strict-caps --iast
      --include-stdlib --out-dir=dist/ato-evidence --fail-on=high
  artifacts:
    when: always
    paths:
      - dist/ato-evidence/
    reports:
      sast: dist/ato-evidence/sast.sarif.json
      cyclonedx: dist/ato-evidence/sbom.cdx.json
Airgapped SCIF ATO Evidence & Hardened Native Build
ato-scif-collect.sh
#!/bin/sh
set -eu
# Airgapped / SCIF ATO Evidence & Hardened Binary Build (zero network calls)
# All 123 stdlib modules and 8 AppSec engines live inside the single veko binary.

export VEKO_OFFLINE=1
veko check --strict-types src/main.vk
veko audit \
  --profile=federal \
  --fips \
  --strict-caps \
  --iast \
  --include-stdlib \
  --sign-key=keys/mldsa65.key \
  --out-dir=dist/ato-evidence \
  --fail-on=high

veko compile --native --rasp=enforce src/main.vk -o dist/app-hardened
sha256sum dist/ato-evidence/evidence_manifest.sha256.json dist/app-hardened