VARUX AXIS Deterministic PostgreSQL Write-Path Control
v0.6 · Pilot Readiness
AXIS Documentation / Getting Started / Configuration

Configuration

Environment-drivenFail-fast validation

AXIS is configured through environment variables (loaded from the process environment and a .env file via dotenvy). Invalid or contradictory configuration fails startup — there is no "unlimited mode" and no silent downgrade path.

.env.example is local-only. .env.production.example is a placeholder template containing no real secrets. Never commit .env.production.local.

Core settings

VariableDefaultNotes
LISTEN_ADDR0.0.0.0:6543HTTP listener address
DATABASE_URLbuilt from DB fieldsPostgreSQL connection
DB_HOST / DB_PORT / DB_NAME / DB_USER / DB_PASSlocalhost / 5432 / prod_main / varux / varuxCompose uses demo credentials only
OPERATING_MODEenforceOne of shadow, approval_first, enforce, emergency_bypass — see Operating Modes
AXIS_OPERATOR_TOKENunsetRequired for mutating policy lifecycle endpoints and approval resolution; header X-AXIS-Operator-Token or Authorization: Bearer <token>

Policy store

VariableDefaultNotes
AXIS_POLICY_DIR./policiesPolicy directory (compose mounts it read-only)
AXIS_POLICY_MANIFEST./policies/policy_manifest.jsonManifest is authoritative at startup
AXIS_ENABLE_POLICY_RELOADfalseControlled reload is internal-only in v0.9 and disabled by default; no HTTP reload endpoint exists
POLICY_PATH./policies/prod_main.jsonDeprecated compatibility variable
AXIS_POLICY_STORE_PATH./data/policiesLocal lifecycle store (active.json, manifest.json, versions/)

Policy lifecycle details (validation, dry-run, activation, rollback, operator protection) are on the Policy Engine page.

Audit & evidence paths

VariableDefaultNotes
AUDIT_WAL_PATH./audit.walCanonical append-only audit WAL (enterprise compose uses AXIS_AUDIT_WAL_PATH)
AUDIT_LOG_PATH./audit.logJSONL projection (non-authoritative; enterprise name AXIS_AUDIT_LOG_PATH)
AXIS_APPROVAL_DB_PATH./data/approvals.sqliteApproval store (install guide; the security model also documents a JSONL-backed store at approvals.jsonl)
AUDIT_INDEX_PATH./data/index/audit_index_v1.jsonDerived read-model index; safe to delete, rebuild or ignore — WAL remains canonical
AXIS_AUDIT_EXPORT_REQUIRES_OPERATORfalseProduction default is enabled; local mode leaves export public because Evidence Bundle V1 is redacted

Runtime hardening & limits

VariableDefaultNotes
AXIS_RUNTIME_PROFILElocal or production; invalid value fails startup. Production fails fast without a strong operator token; weak values (changeme, default, password, secret, ...) are rejected
AXIS_REQUEST_TIMEOUT_MS10000Must be greater than AXIS_DB_QUERY_TIMEOUT_MS
AXIS_DB_QUERY_TIMEOUT_MS8000DB operation timeout; on expiry execution state is reported as unknown
AXIS_DB_CONNECT_TIMEOUT_MS5000Connection acquisition timeout
AXIS_DB_POOL_MAX_CONNECTIONS10DB pool size
AXIS_DB_POOL_ACQUIRE_TIMEOUT_MS3000Pool acquire timeout → db_pool_exhausted
AXIS_MAX_BODY_BYTES1048576Request body limit → request_body_too_large
AXIS_MAX_SQL_BYTES262144SQL text limit (must be ≤ body limit) → sql_too_large; oversized SQL is never written raw
AXIS_RATE_LIMIT_ENABLEDtrueRate limiting on; /health is not rate-limited
AXIS_RATE_LIMIT_REQUESTS_PER_MINUTE120Per-actor limit; first enforced key for POST /query is actor
AXIS_RATE_LIMIT_BURST30Burst allowance → rate_limited (429)

Protected writes are never retried automatically after a timeout; reconcile database state first (see Failure & Recovery).

Operator auth (JWT)

VariableDefaultNotes
AXIS_AUTH_MODEjwt_hs256 for local/demo JWT validation; HS256 is not full enterprise IAM
AXIS_JWT_REQUIREDfalseWhen true, /query requires Authorization: Bearer <token>; spoofed JSON body fields are ignored and conflicts are recorded in request audit payloads
AXIS_JWT_HS256_SECRETStrong managed local validation secret

Evidence signing

VariableNotes
AXIS_EVIDENCE_SIGNING_ENABLEDtrue enables optional server-side Ed25519 signing of Evidence Bundle V1 exports
AXIS_EVIDENCE_SIGNING_KEY_IDKey identifier recorded in bundle metadata (kid)
AXIS_EVIDENCE_SIGNING_PRIVATE_KEY_B64 / AXIS_EVIDENCE_SIGNING_PUBLIC_KEY_B64Base64 raw keys; invalid key material makes export fail safely with a structured error — no key material is leaked

Unsigned exports are marked signature_status: disabled / signature_algorithm: none and are never presented as signed evidence. Audit WAL signing itself requires AXIS_AUDIT_SIGNING_KEY_PATH in production startup (tests use ephemeral local keys).

TLS / mTLS (hardened core)

VariableNotes
AXIS_TLS_REQUIRE_CLIENT_CERTProduction rejects false; local mode allows cleartext only when TLS material is not configured
AXIS_TLS_CLIENT_CA_BUNDLE_PATH / AXIS_TLS_SERVER_CERT_PATH / AXIS_TLS_SERVER_KEY_PATHClient-to-AXIS TLS termination material
AXIS_TLS_UPSTREAM_CLIENT_CERT_PATH / AXIS_TLS_UPSTREAM_CLIENT_KEY_PATH / AXIS_TLS_UPSTREAM_CA_BUNDLE_PATHAXIS-to-PostgreSQL mTLS material

These variables exist in the hardened core. The v0.6 pilot package itself does not yet deliver a complete TLS/mTLS deployment story — see mTLS & Network.

pg_hba baseline (native path)

VariableNotes
AXIS_PG_HBA_PROXY_CIDRAllowed proxy CIDR; drift → signed AXIS_PG_HBA_DRIFT_DETECTED audit event
AXIS_ENFORCE_PG_HBA_BASELINEChecks pg_hba_file_rules against the proxy-only hostssl/cert baseline
AXIS_PG_HBA_CHECK_INTERVAL_MINUTESBaseline check interval

Audit checkpoint anchoring

VariableNotes
AXIS_AUDIT_CHECKPOINT_INTERVAL_EVENTS / AXIS_AUDIT_CHECKPOINT_INTERVAL_MINUTESCheckpoint frequency (signed compact statement of the durable WAL head)
AXIS_AUDIT_CHECKPOINT_FAILURE_ALERT_THRESHOLD / AXIS_AUDIT_CHECKPOINT_MAX_BACKOFF_SECONDSFailure escalation and bounded exponential backoff
AXIS_AUDIT_CHECKPOINT_FILE_REPLICA_PATHAppend-only file replica sink
AXIS_AUDIT_CHECKPOINT_WEBHOOK_URL / AXIS_AUDIT_CHECKPOINT_WEBHOOK_BEARER_TOKENWebhook sink; failures do not roll back a locally committed WAL event

Native PG wire listener (lab)

VariableDefaultNotes
AXIS_PGWIRE_ENABLEDfalseDisabled by default; lab-only Simple Query listener
AXIS_PGWIRE_LISTEN_ADDR0.0.0.0:6544PG wire listener address
AXIS_PGWIRE_BACKEND_ADDR127.0.0.1:5432Upstream PostgreSQL
AXIS_PGWIRE_LAB_MODEtrueCleartext startup/auth pass-through, lab only
AXIS_PGWIRE_UNSUPPORTED_FAIL_CLOSEDtrueUnsupported protocol messages fail closed

Control Plane

VariableDefaultNotes
AXIS_CONTROL_PLANE_MODErealreal reads live endpoints; mock is explicit server-side demo behavior only, not production evidence
AXIS_BACKEND_URLhttp://localhost:6543Server-only; the browser must never receive the backend URL
AXIS_PROXY_TIMEOUT_MS8000Server-side proxy timeout
NEXT_PUBLIC_REFRESH_INTERVAL_MS5000Dashboard refresh interval

Policy file format

The active policy is a JSON file (e.g. policies/prod_main.json). The manifest (policies/policy_manifest.json) declares the active policy version and stores the raw policy file SHA-256; the manifest is authoritative at startup.

policies/prod_main.json (shape)
{
  "schema_version": "1.0",
  "policy_version": "prod_main@1.0.0",
  "defaults": { "read": "ALLOW", "write": "BLOCK", "ddl": "REQUIRE_APPROVAL" },
  "write_rules": [
    {
      "id": "rule-1",
      "action": "REQUIRE_APPROVAL",
      "match": { "operation": "DELETE", "condition": "bulk_limit > 100" },
      "approver_group": "platform-leads",
      "reason_code": "approval_required_batch"
    }
  ]
}

Accepted action values: ALLOW, BLOCK, REQUIRE_APPROVAL (the alias APPROVAL_REQUIRED is accepted in policy deserialization). Validation is read-only; invalid policy JSON prevents healthy startup.

Secret handling

See Operations and mTLS & Network for the related runbook material.