Skip to content

Deployment ​

This page covers running IDVIZE in production: Docker containers, a production checklist, backup and restore, and upgrade procedures.

Current state

Docker files and compose configuration ship with the repository. The deployment model has been tested on single-node Docker Compose. Kubernetes manifests and multi-replica orchestration are planned but not yet built.

Architecture overview ​

A production IDVIZE deployment has three components:

ComponentImageDefault portPurpose
APIidvize-api3001Express backend, schema migrations, assessment engine, platform adapters
Webidvize80 (Nginx)React SPA, serves static assets, proxies API requests
PostgreSQLpostgres:165432All persistent state: tenants, users, assessments, audit logs, credentials

The API is the only component that connects to PostgreSQL. The web container serves the compiled frontend and proxies /v1/* requests to the API.

Docker ​

Building images ​

bash
# API (multi-stage: build with Node, run with Node slim)
cd idvize-api
docker build -t idvize-api:latest .

# Frontend (multi-stage: build with Node, serve with Nginx)
cd idvize
docker build -t idvize:latest .

Docker Compose ​

The repository includes docker-compose.yml at the root. Start everything:

bash
docker compose up -d

This starts PostgreSQL, waits for it to accept connections, runs schema migrations automatically on API startup, then starts the web frontend.

Environment variables ​

Pass environment variables to the API container. Required:

VariablePurpose
DATABASE_URLPostgreSQL connection string for the owner role (migrations)
JWT_SIGNING_SECRETHMAC-SHA-256 secret for JWT and plan approval hashes. No default in production — the server refuses to start without it.
API_KEYStatic API key for machine-to-machine endpoints.
SEED_MODEproduction for an empty database. demo loads sample tenants and data.

Optional:

VariablePurposeDefault
DATABASE_APP_URLPostgreSQL connection for the restricted idvize_app role (runtime queries, RLS enforced). Set this in production. If unset, the API derives it from DATABASE_URL by switching to user idvize_app with the built-in development password, which is published in the source code.DATABASE_URL host with idvize_app and the development password
PORTAPI listen port3001
NODE_ENVproduction enables stricter validationdevelopment
LOG_LEVELdebug, info, warn, errorinfo
CORS_ORIGINSComma-separated allowed frontend originslocalhost defaults
ANTHROPIC_API_KEYEnables AI-assisted cost analysis and plan review. Without it, AI features return graceful fallbacks.None
CONTINUOUS_ASSESSMENT_INTERVAL_MINUTESHow often the assessment sweep runs. 0 disables it.60
COMMERCIAL_ENFORCEMENTobserve (log-only) or enforce (block unlicensed actions)observe

Platform connector credentials (Entra, SailPoint, CyberArk, Okta) are configured per-tenant through the integrations API, not as global environment variables. See Integrations.

Health check ​

GET /health

Returns JSON with service status, running commit, branch, uptime, active modules and integration status. Unauthenticated — suitable for load balancer and container orchestrator probes.

The Docker image includes a built-in healthcheck that polls /health every 30 seconds with a 5-second timeout and a 40-second start period.

Networking ​

The API container exposes port 3001. The web container exposes port 80. In production, place both behind a reverse proxy (Nginx, Caddy, or a cloud load balancer) that terminates TLS.

WARNING

IDVIZE does not terminate TLS itself. Always run it behind a TLS-terminating proxy in production.

Production checklist ​

Before going live, verify each item:

Security ​

  • [ ] JWT_SIGNING_SECRET is a cryptographically random string (min 32 characters), not a default or example value
  • [ ] API_KEY is unique per environment
  • [ ] SEED_MODE is production (never demo or development in production)
  • [ ] TLS is terminated at the reverse proxy; no plaintext HTTP is reachable from the internet
  • [ ] PostgreSQL is not exposed to the public network
  • [ ] DATABASE_APP_URL uses a restricted role (not the owner) for runtime queries — RLS enforces tenant isolation at the database level
  • [ ] The idvize_app role's password is changed from the development default after the first migration (ALTER ROLE idvize_app PASSWORD '<random>'), and DATABASE_APP_URL carries the new password. The migration creates the role with a password that is in the source code.
  • [ ] Connector credentials are stored through the integrations API (AES-256-GCM encrypted at rest), not as environment variables
  • [ ] CORS_ORIGINS lists only the production frontend origin

Database ​

  • [ ] PostgreSQL 14 or later
  • [ ] Dual-role setup: an owner role (for migrations) and an app role (for runtime, RLS enforced)
  • [ ] Automated backups configured (see Backup and restore)
  • [ ] Connection pooling in place (PgBouncer or equivalent) if serving more than one tenant

Operations ​

  • [ ] Health check endpoint (/health) is polled by a load balancer or monitoring system
  • [ ] Container logs are shipped to a log aggregator (the API uses structured JSON logging)
  • [ ] CONTINUOUS_ASSESSMENT_INTERVAL_MINUTES is set to an appropriate cadence for the workload
  • [ ] DNS and TLS certificates are configured for the production domain

Known limitations ​

  • Single-instance only. Several in-memory caches (replay protection, adapter tenant locks) are not shared across replicas. Running multiple API instances against the same database will work for reads but may produce duplicate assessment writes or race on ingestion locks. Multi-instance support requires a shared cache layer.
  • No built-in rate limiting. Apply rate limits at the reverse proxy or API gateway.
  • No refresh tokens. JWTs expire after 8 hours. Users must re-authenticate after expiry.

Backup and restore ​

What to back up ​

All persistent state is in PostgreSQL. The application has no local file state that needs backup.

Critical tables (data loss is unrecoverable):

CategoryTables
Tenants and userstenants, users, revoked_sessions
Assessmentsassessments (append-only ledger), assessments_archive, assessment_sweeps
Decisions and baselinesbaseline_decisions, control_declarations, automation_policy_versions
Identities and accountsidentities, accounts, account_correlations, account_owners, account_retirements
Access objectsaccess_objects, access_edges, auth_policies, auth_policy_reads, authentication_methods
Executionexecution_sessions, execution_approvals, execution_evidence, rollback_objects
Commercialtenant_product_grants, usage_ledger, ai_usage_ledger
SoDsod_policies, sod_policy_sides, sod_violations, sod_violation_history
Auditaudit_logs (append-only — the compliance trail)
Credentialsconnector_credentials (AES-256-GCM encrypted)

Taking a backup ​

Use pg_dump for logical backups:

bash
pg_dump -Fc -f idvize-backup-$(date +%Y%m%d-%H%M).dump \
  -U idvize_owner idvize

For large databases, use pg_dump with --jobs for parallel dump:

bash
pg_dump -Fd -j 4 -f idvize-backup-$(date +%Y%m%d-%H%M) \
  -U idvize_owner idvize

Restore ​

bash
pg_restore -d idvize -U idvize_owner --clean --if-exists \
  idvize-backup-20261116-0800.dump

After restore, restart the API server. It will re-apply RLS policies and grants on startup.

Backup schedule ​

Recommended:

FrequencyRetentionMethod
Every hour48 hourspg_dump to local storage
Daily30 dayspg_dump to offsite / object storage
Weekly1 yearFull backup to offsite with integrity check

The assessments and audit_logs tables are append-only and grow continuously. Plan storage accordingly.

Upgrading ​

Standard upgrade (zero-downtime on single instance) ​

  1. Pull the latest code or image.

    bash
    git pull origin main
    # or
    docker pull idvize-api:latest
    docker pull idvize:latest
  2. Back up the database before applying migrations.

    bash
    pg_dump -Fc -f pre-upgrade-$(date +%Y%m%d-%H%M).dump \
      -U idvize_owner idvize
  3. Restart the API container. Migrations run automatically on startup. The migration system uses a PostgreSQL advisory lock, so concurrent starts are safe — one instance runs migrations while others wait.

    bash
    docker compose up -d --build
  4. Verify.

    bash
    curl -s http://localhost:3001/health | jq .

    Confirm status: "ok" and that the build.commit matches the expected version.

Rollback ​

If a migration introduces a problem:

  1. Stop the API container.
  2. Restore the pre-upgrade database backup.
  3. Deploy the previous image or checkout the previous commit.
  4. Restart.

WARNING

Migrations are forward-only. There is no automated rollback for schema changes. Always take a backup before upgrading.

API versioning ​

The API is served under /v1/.... When a breaking change is introduced, a new version (/v2/...) is added alongside the old one. The previous version continues to serve requests with Deprecation and Sunset headers until the announced sunset date. See the versioning policy for details.

Monitoring ​

Logs ​

The API emits structured JSON logs to stdout. Ship them to your log aggregator (ELK, Datadog, CloudWatch, etc.).

Key log fields:

  • level: debug, info, warn, error
  • tenantId: Present on tenant-scoped requests
  • requestId: Correlation ID from X-Request-ID header (auto-generated if absent)
  • method, path, statusCode, durationMs: On every HTTP request

Metrics to watch ​

MetricWhere to find itAlert threshold
Health checkGET /healthAny non-200 response
Assessment sweep ageGET /v1/controls/monitoring (lastComplete.ageMinutes)> 2x the configured interval
Database connectionsPostgreSQL pg_stat_activity> 80% of max_connections
Audit log growthSELECT count(*) FROM audit_logs WHERE created_at > now() - interval '1 hour'Unusual spikes may indicate brute force or misconfiguration
Disk usageContainer and database volumes> 80% capacity

Alerting ​

IDVIZE does not include a built-in alerting system. Use your infrastructure's monitoring to alert on:

  • Health check failures
  • Container restarts
  • Assessment sweep not completing within its interval
  • Database connection exhaustion
  • Disk space on the PostgreSQL volume