Vectasec · Reference
CLI and API reference
Reference for the vectasec and vectasec-collector commands and the Vectasec engine HTTP API: endpoints, auth headers, roles and error codes.
On this page
The Vectasec CLI#
vectasec is the operator's entry point to the engine. Run it from the engine directory of the release as uv run vectasec <command>. It loads the nearest .env at or above your working directory and talks to Postgres directly through DATABASE_URL, not through the API. It acts with that database credential rather than a user token, so run it only on hosts that should hold DATABASE_URL. Commands that read or write tenant data take --tenant <uuid> and default to the demo tenant that the first migration seeds. connections add and connections rm write an audit log row with the actor cli.
Connector flags#
scan and connections add share these flags. Each one sets the config key of the same name.
Values pass through as strings, for example --set timeout=30, and each connector converts what it reads. When connections add rejects a config, it prints the problems and the flags that type takes. Every connector's fields are listed in the Connector reference.
Collector CLI#
The collector ships its own command, vectasec-collector, with three subcommands:
run(the default) enrolls, then sends heartbeats, polls for jobs, scans and pushes results.previewscans every configured target and prints exactly what would be pushed. It contacts no control plane.checkvalidates the configuration and prints each target's non-secret config, without contacting the targets or the control plane.
API basics#
The engine API is a FastAPI service. Start it with its bundled entry point from the engine directory of the release (it reads .env, ENGINE_HOST and ENGINE_PORT); don't start it with bare uvicorn. It listens on http://127.0.0.1:8000 by default and serves interactive docs at /docs. Read the Security model before you bind it to any other address.
Every route except /health, /collector/enroll and the interactive docs needs Authorization: Bearer <token>. Requests that carry only X-VectaSec-* headers are refused unless VECTASEC_DEV_TRUST_HEADERS is set. That switch is off by default; keep it unset on any engine another host can reach. The /collector/* routes take the collector token described below. Everywhere else, the token is one of two kinds:
- The engine service token (
VECTASEC_ENGINE_TOKEN), for a trusted server such as the console. Name the tenant inX-VectaSec-TenantunlessVECTASEC_ENGINE_TOKEN_TENANTpins it. Every mutation also needsX-VectaSec-Actor, the acting user's UUID, and the engine checks that user's role in the tenant. - A Supabase user access token. The engine verifies it against your project's public keys, so set
SUPABASE_URLon the engine. The actor is the token's subject and the tenant comes from membership. SendX-VectaSec-Tenantonly if you belong to more than one tenant.
Roles come from each member's role in the organization. A viewer can call every GET. An analyst or editor can also scan, triage, change finding status, suppress, attest and manage connections. An admin or owner can also manage integrations, routing rules and members. Every action is recorded in the audit log with its actor.
There are no list endpoints for findings or assets. The console reads those from Postgres under row-level security, and the API carries actions, reports and the few reads RLS can't serve.
curl -s -X POST http://127.0.0.1:8000/connections -H "Authorization: Bearer $VECTASEC_ENGINE_TOKEN" -H "X-VectaSec-Tenant: <tenant-uuid>" -H "X-VectaSec-Actor: <user-uuid>" -H 'Content-Type: application/json' -d '{"type":"kafka","name":"prod-kafka","config":{"bootstrap":"broker-1:9092"}}'
The 201 response carries connection_id and created. Queue a scan with POST /connections/{id}/scan.
Endpoints#
Scans and connections#
Findings and compliance#
Reports and graph#
Tenant administration#
Collector#
Error codes#
Next steps#
- Configuration: the variables behind every token and flag on this page.
- Security model: authentication paths, roles and what to set before you expose the engine.
- Connector reference: the fields each connector takes.
- Run a collector in your network: enrollment, targets and the redaction boundary.
- Compliance, reports and alerts: the export formats and alert routing.