Skip to content

Security: zyvorai/veyron

Security

SECURITY.md

Security Policy

Related documentation: README.md (install and verify), docs/api.md (authentication and roles), docs/deploy.md (TLS, release binaries).

Supported Versions

We release patches for security vulnerabilities for the following versions:

Version Supported
0.4.x βœ…
< 0.4 ❌

Versions 0.3.x were never released as binaries; container images with those tags on ghcr.io/zyvorai/veyron predate the Kairon rewrite and are not supported.

Reporting a Vulnerability

We take the security of veyron seriously. If you have discovered a security vulnerability, please follow these steps:

πŸ”’ Private Disclosure

Please do not report security vulnerabilities through public GitHub issues.

Instead, please report them via one of the following methods:

  1. GitHub Security Advisories (Preferred)

    • Go to the Security tab
    • Click "Report a vulnerability"
    • Fill in the details
  2. Email

    • Send an email to: security@zyvor.dev
    • Include as much information as possible (see below)

πŸ“ What to Include

Please include the following information:

  • Type of vulnerability (e.g., buffer overflow, SQL injection, XSS, etc.)
  • Full paths of source file(s) related to the vulnerability
  • Location of the affected source code (tag/branch/commit or direct URL)
  • Step-by-step instructions to reproduce the issue
  • Proof-of-concept or exploit code (if possible)
  • Impact of the issue, including how an attacker might exploit it

⏱️ Response Timeline

  • Initial Response: Within 48 hours
  • Assessment: Within 1 week
  • Fix Timeline: Depends on severity
    • Critical: Within 7 days
    • High: Within 14 days
    • Medium: Within 30 days
    • Low: Next regular release

πŸ›‘οΈ Security Update Process

  1. Acknowledgment: We'll acknowledge receipt of your vulnerability report
  2. Investigation: We'll investigate and assess the severity
  3. Fix Development: We'll develop a fix (with your help if desired)
  4. Notification: We'll notify you when the fix is ready
  5. Release: We'll release a security update
  6. Disclosure: We'll publish a security advisory (crediting you if you wish)

πŸ† Credit

We believe in giving credit where credit is due. If you report a valid security issue:

  • We'll acknowledge your contribution in the security advisory
  • We'll include your name (or handle) in the CHANGELOG
  • You can choose to remain anonymous if you prefer

πŸ” Security Best Practices

When using veyron:

  1. Keep Updated: Always use the latest version
  2. Least Privilege: Run with minimum required permissions
  3. Review Configs: Validate VM configurations before applying
  4. Audit Logs: Monitor veyron operations in production
  5. Secure Credentials: Never commit credentials or secrets to git
  6. Network Security: Use appropriate network policies in Kubernetes

πŸ›‘οΈ Security Hardening

Veyron implements the following security measures:

Authentication & Authorization

  • JWT Bearer token auth with HMAC-SHA256 signature verification and OIDC issuer checking
  • Multi-key RBAC via VEYRON_API_KEYS environment variable with three roles: admin (full access), write (create/modify operations), readonly (read-only access)
  • API key authentication via X-API-Key header or Authorization: Bearer. The legacy ?token= query parameter is accepted only on WebSocket upgrade routes (/vnc, /serial, /tunnel, /ws/metrics), where browsers cannot set headers; elsewhere it is ignored (URLs are logged by proxies). Prefer one-time ?ticket=
  • VEYRON_API_KEY is required: without it the API denies every request (503), even if other keys, JWT or OIDC are configured
  • Session tokens from POST /auth/login are 24 h JWTs revoked when the user is deleted or their password is reset (checked against the user list, cache up to 5 s; a role change is not applied until the token expires; tokens minted by older versions expire on their own). Login attempts are rate limited per client IP (30 per 5 minutes) and per IP and username (10 per 5 minutes), keyed on the TCP peer address (X-Forwarded-For is not trusted; behind a reverse proxy all users share the proxy's budget)
  • veyron api-key-create, api-key-delete and api-key-list do not persist anything and now fail with an explanation: keys come from VEYRON_API_KEY / VEYRON_API_KEYS
  • OIDC bearer tokens are verified for signature, issuer and expiry, and audience when VEYRON_OIDC_AUDIENCE is set (unset: not checked)
  • Constant-time API key comparison prevents timing attacks
  • Auth bypass removed: A previous referer-based dashboard bypass has been removed. The dashboard now sends the API key via the X-API-Key header like any other client, ensuring uniform authentication for all API requests.

Audit & Secrets

  • API audit trail: every mutating call on VMs, snapshots, expose routes, the guest agent, /soc/, AI proposals and models, and sandboxes is recorded in the SOC event log (veyron-soc-events ConfigMap) with the caller's key name, username or token subject, after authentication succeeds. The log keeps the newest 500 events within 900 KB; request paths are cut at 256 bytes and actors at 128 so a caller cannot crowd out or block later entries. It is a rolling buffer, not an archive: export to a SIEM (docs/soc.md) for retention. GET /audit/trail lists Kubernetes Events, not this log
  • The interactive TUI keeps a separate local audit file (audit_trail.json in the veyron folder of your user data directory); it records what that terminal session did, not API calls
  • Approving a VeyronAction and changing a VeyronPolicy need the admin role (a write key cannot, since 0.4.1)
  • Interactive consoles (/vnc, /serial) and the TCP tunnel need the write role; a readonly key cannot open them (before 0.4.1 it could open VNC and serial)
  • Local secrets encryption with key expansion and integrity tag for at-rest protection
  • Secret values are zeroized on drop, rotate, and revoke using the zeroize crate
  • Secret type does not implement Clone to prevent accidental copies that bypass zeroization
  • Secret values are excluded from serialization (#[serde(skip_serializing)])
  • Custom Debug implementation redacts secret values

SSRF Prevention

  • Webhook URLs are validated against private/internal IP ranges (RFC 1918, RFC 6598 CGNAT, link-local, loopback)
  • DNS resolution is performed upfront and all returned addresses are validated
  • Both the CLI's and the API's webhook delivery re-validate at delivery time and pin curl to the validated IP via --resolve (no second DNS lookup, no redirects, --proto =https). The API's delivery (src/api/webhooks.rs) passes the secret and all headers to curl on stdin (--config -), never on its command line. CGNAT (RFC 6598) is blocked by the CLI's check only; the API's check covers RFC 1918, loopback, link-local and unique-local ranges
  • Only https:// webhook URLs are accepted

Data Persistence

  • Persistent data is never written to world-readable /tmp
  • All file writes use atomic write-to-temp + fsync + rename to prevent corruption
  • Temp files use randomized names to prevent race conditions
  • Files are created with mode 0600 on Unix

API Security

  • CORS disabled by default; requires explicit origin configuration
  • Outbound TLS verification is on by default. Explicit opt-outs exist for self-signed lab setups: VEYRON_KAIRON_NODE_TLS_INSECURE, VEYRON_IMAGE_STORE_INSECURE_TLS, VEYRON_NETRA_TLS_VERIFY, VEYRON_PAQTRA_TLS_VERIFY, the Gryvia and MCP server settings, and the legacy KubeVirt console proxy (VEYRON_KUBEVIRT_WS_INSECURE_TLS=1; by default it verifies the Kubernetes API certificate against the cluster CA)
  • PAM usernames limited to 32 characters
  • API error responses do not leak internal details
  • Security headers on all responses (CSP, X-Frame-Options DENY, HSTS, no-sniff, no-referrer)
  • Image-store uploads are capped (VEYRON_IMAGE_STORE_MAX_BYTES, default 64 GiB, 0 = unlimited)
  • The HTTP-to-HTTPS redirect listener uses VEYRON_PUBLIC_HOST when set, otherwise only a well-formed Host header
  • Global rate limiting (--rate-limit, requests per minute, default 60, one shared bucket; health, OIDC config/token and operator GET polling are exempt, the console shell and assets are not; 0 disables it)
  • JSON request bodies are capped at 10 MiB; /ws/metrics streams at VEYRON_WS_METRICS_MAX (64); cpus at 256, gpu.count at 16, guest-exec timeout at 3600 s
  • Kubernetes name validation (RFC 1123) on all VM/snapshot names
  • On Kairon, VNC and serial WebSockets are proxied to the kairon-node relay with its bearer token (KAIRON_NODE_CONSOLE_TOKEN); on the legacy KubeVirt backend they go through the Kubernetes API's subresources.kubevirt.io WebSocket
  • VeyronPolicy CRD enforcement: VM creation evaluates VeyronPolicy CRDs before proceeding. Policies with Deny enforcement block creation outright; policies with Warn enforcement log warnings but allow the operation to continue.
  • Structured error types: The API returns proper HTTP status codes (e.g., 401 for auth failures, 409 for conflicts) instead of returning 200 with silent failures where feasible. VM lifecycle routes use Kubernetes directly; analytics routes may return heuristic projections labeled in JSON where applicable.
  • Input validation on batch operations: Batch VM operations validate Kubernetes names (RFC 1123) before processing. Budget creation ensures the veyron-system namespace exists before writing resources.
  • CRDPolicyRule structured value field: Policy conditions use a structured value field for thresholds instead of parsing values from message strings, which was fragile and potentially exploitable via crafted input.

Dashboard Security

  • The session token (or API key) is kept in the browser's localStorage and sent as Authorization: Bearer; any script that runs on the console origin can read it
  • 401 responses clear the stored session and return to sign-in
  • CSP is default-src 'self' with script-src 'self' 'unsafe-inline' (inline scripts are allowed) and Google Fonts for styles/fonts; no external script CDNs
  • noVNC bundled locally (no runtime CDN fetches)
  • Dashboard page served without auth; all API calls require valid key
  • Core endpoints return cluster-backed data; auxiliary endpoints document estimate/disclaimer fields where values are not sourced from billing or external SaaS.

Operator Security

  • CEL policy expressions: The Veyron Operator supports CEL (Common Expression Language) policy expressions for custom compliance rules, evaluated safely in a sandboxed environment.
  • Operator Prometheus metrics: 7 custom metrics exposed for monitoring operator health and policy enforcement activity.

Metrics Security

  • Real Kubernetes metrics: Replaced random number generation (rand::thread_rng) with real data from the Kubernetes Metrics Server. When the Metrics Server is unavailable, the API returns allocation-only metrics (zeros) instead of fabricated random numbers, preventing misleading resource reporting.

🚨 Known Security Considerations

Note: Several previous security considerations have been addressed: the referer-based auth bypass has been removed, random metric generation has been replaced with real Metrics Server data, all experimental modules have been promoted (no feature gates), JWT Bearer auth and multi-key RBAC have been added, and local secrets encryption is now available. See the "Security Hardening" section above for details.

Kubernetes Access

  • veyron requires access to Kubernetes API
  • Use appropriate RBAC policies to limit access
  • Review and restrict service account permissions

Configuration Files

  • Configuration files may contain sensitive data
  • Use .gitignore to exclude sensitive configs
  • Never commit cloud-init user-data with passwords

Container Images

  • Container disk images are pulled from registries
  • Verify image sources and use trusted registries
  • Consider using private registries for production

Cloud-Init

  • Cloud-init user-data can execute arbitrary code in VMs
  • Review cloud-init scripts before deployment
  • Avoid hardcoded credentials in cloud-init

πŸ“š Security Resources

🀝 Security Hall of Fame

We'd like to thank the following people for responsibly disclosing security issues:

No security issues reported yet.


Thank you for helping keep veyron and our users safe!

There aren't any published security advisories